[R] Missing value or an infinity produced when evaluating the model
tong
tchen10 at qub.ac.uk
Sat Jul 6 16:33:46 CEST 2013
Dear all,
I want to estimate a nlrq using normal copula.The model is
<http://r.789695.n4.nabble.com/file/n4671010/%E6%97%A0%E6%A0%87%E9%A2%98.png>
I want to estimate the delta in the above formula.
The full codes I use are as following:
> NormModel<-function(x, delta, mu, sigma, tau){
+ z<-qnorm(pnorm(delta*qnorm(pnorm(x))+sqrt((1-delta*delta)*qnorm(tau)))
+ mu+sigma*z
+ }
> fit<-nlrq(y~NormModel(x, delta, mu, sigma, tau=0.5), data=dailyvix,
> tau=0.5,
+ start=list(delta=-0.5, mu=0, sigma=0.1),
+ trace=TRUE)
However, I get:
127.2531 : -0.5 0.0 0.1
Error in numericDeriv(form[[3]], names(ind), env) :
Missing value or an infinity produced when evaluating the model
In addition: Warning message:
In sqrt(1 - delta * delta) : NaNs produced
Error in nlrq.calc(m, ctrl, trace) : optim unable to find valid step size
I think I do sth wrong with the "start=list".
I try different initial values but fail to find proper ones.
In addition, the coefficient delta is expected to range from (-1,1).
how can I deal with the "In sqrt(1 - delta * delta) : NaNs produced"?
thanks,
Tong
--
View this message in context: http://r.789695.n4.nabble.com/Missing-value-or-an-infinity-produced-when-evaluating-the-model-tp4671010.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list