Hi All:
I am trying to compute a Hessian of a log likelihood function in a
Metropolis-Hastings MCMC algorithm. The coefficient vector of the model
has seven elements.
A call to
ForwardDiff.hessian(PF_RE_AR1_outer_alt, parms)
returns
ERROR: LoadError: InexactError()
in setindex! at array.jl:314
in PF_RE_AR1_outer_alt at
/home/jim_nason/jmn_work/smith/NS4/jl_code_Summer2015/RE_rho/MH_PF_test/PF_RE_AR1_outer_alt.jl:55
in _calc_hessian at
/home/jim_nason/.julia/v0.4/ForwardDiff/src/api/hessian.jl:98
Lines 52 and 55 of PF_RE_AR1_outer_alt.jl are
cs00V = eye(dsts)
cs22n = sigu*sigu
cs22d = 1/(1.0 - rho1*rho1)
cs00V[2,2] = cs22n*cs22d
where sigu and rho1 are two coefficients of the model restricted as sigu >
0 and -1 < rho1 < 1 and dsts = 2.
Suggestions or advice to fix the problem are welcome.
Thanks.
Best,
Jim