[R] Missing Argument in optim()

voodooochild at gmx.de voodooochild at gmx.de
Mon Mar 27 13:04:47 CEST 2006


Hello everybody,

i already searched the archieves, but i still don't know what is wrong 
in my implementation, mybe anybody coud give me some advice

ll1<-function(rho,theta,beta1,beta2,beta3,beta4,t,Szenariosw5,Testfaellew5,X1,X2) 
{
    n<-length(t)     
    t<-cumsum(t)
      tn<-t[length(t)]
      Szenn<-Szenariosw5[length(Szenariosw5)]
      Testn<-Testfaellew5[length(Testfaellew5)]
      X1n<-X1[length(X1)]
    X2n<-X2[length(X2)]
    n/rho-(tn^theta)*(beta1*Szenn+beta2*Testn+beta3*X1n+beta4*X2n)
}

p0<-c(rho=1,theta=1,beta1=1,beta2=1,beta3=1,beta4=1)

optim(p0,fn=ll1,t=t,Szenariosw5=Szenariosw5,Testfaellew5=Testfaellew5,X1=X1,X2=X2)

i always got an error message: Argument "theta" is missing, with no default
but i don't know what is wrong?

thanks!




More information about the R-help mailing list