[R] parameter constraints with sem

2006-03-16 Thread James Fowler
I would like to constrain three of the parameters I am estimating using sem (strucutral equation model package) but do not know how. Specifically, I would like to use the following constraint: beta1 + beta2 + beta3 = 1 can I assign variable names as the values for fixed parameters? If so, I coul

[R] Help with faster optimization for large parameter problem

2007-03-02 Thread James Fowler
Hello all, I have a large parameter problem with the following very simple likelihood function: fn<-function(param) { x1<-param[1:n] g1<-param[(n+1):(2*n)] beta<-param[(2*n+1):(2*n+k)] sigma2<-param[2*n+k+1]^2 meang1sp<-mean(g1[sp]) mu<-beta%*%matrix(x1,1,n)-(g1[sp]-meang1sp)%*%matri