Simple example from Guide to Statistics using gradient and trace with S+6 on
Windows 2000.
No Trace?
> lprob2 <- deriv( ~log(1+ exp(D*alpha)) - D*alpha, c("alpha"),
function(D,alpha) NULL)
> ms( ~lprob2(D,alpha),data=pingpong,start=list(alpha=.008),trace=T)
value: 1127.635
parameters:
alpha
0.01114251
formula: ~ lprob2(D, alpha)
3017 observations
call: ms(formula = ~ lprob2(D, alpha), data = pingpong, start = list(alpha
= 0.008), trac
e = T )
Add Hessian with deriv3 from MASS and get trace. Is this normal behavior?
I used this simple example because I am getting same behavior with more
complicated likelihood functions.
> lprob2 <- deriv3( ~log(1+ exp(D*alpha)) - D*alpha, c("alpha"),
function(D,alpha) NULL)
> ms( ~lprob2(D,alpha),data=pingpong,start=list(alpha=.008),trace=T)
Iteration: 0 , 1 function calls, F= 1161.12
Parameters:
[1] 0.008
Iteration: 1 , 2 function calls, F= 1129.615
Parameters:
etc.
Thanks
Roy Robertson
Rohm and Haas, Co.
"Opinions expressed are mine and not those of Rohm and Haas Company".
|