[R] "nlmnib" Package + Hessian Output

nserdar snes1982 at hotmail.com
Thu Oct 11 13:52:51 CEST 2012


Sorry but I don't modified my function with "mle2" :( :( 

Can you give example how to obtain Hessian with  numDeriv ?

Serdar 

######################### Function
Linn=function(param){

 phi1=((param[1]^2/(1+param[1]^2)))
 phi2=((param[2]^2/(1+param[2]^2)))
 phi3=((param[3]^2/(1+param[3]^2)))
 phi4=((param[4]^2/(1+param[4]^2)))
 
 sigw1=sqrt(exp(param[5]))
 sigw2=sqrt(exp(param[6]))
 sigw3=sqrt(exp(param[7]))
 sigw4=sqrt(exp(param[8]))
 
 sigv=sqrt(exp(param[9]))
 
 Betam1=((param[10]*100)/(sqrt(1+param[10]^2)))
 Betam2=((param[11]*100)/(sqrt(1+param[11]^2)))
 Betam3=((param[12]*100)/(sqrt(1+param[12]^2)))
 Betam4=((param[13]*100)/(sqrt(1+param[13]^2)))

phi=diag(c(phi1,phi2,phi3,phi4),4,4)
betam=c(Betam1,Betam2,Betam3,Betam4)
sigw=diag(c(sigw1,sigw2,sigw3,sigw4),4,4)

a<-(1.001)
mu0=c(ols[1,1],ols[2,1],ols[3,1],ols[4,1])
sigma0=diag(c(a,a,a,a),4,4)
  
 kf=kfilter1(n,rt,rm,mu0,sigma0,phi,betam,sigw,sigv)
 
 return(kf$like)
 
 }

a<-(1.001)
init.par<-c(0.5,0.5,0.5,0.5,a,a,a,a,a,ols[1,1],ols[2,1],ols[3,1],ols[4,1])

###########################






--
View this message in context: http://r.789695.n4.nabble.com/nlmnib-Package-Hessian-Output-tp4645768p4645838.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list