Displaying 1 result from an estimated 1 matches for "meang1sp".
2007 Mar 02
1
Help with faster optimization for large parameter problem
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)%*%matrix(g1,1,n)
return(sum((ydc-mu)^2)/(2*sigma2) + n*k*log(sqrt(sigma2)) +
mean(x1)^2 + mean(g1)^2 + 1000*(x1[1]>x1[n]))
}
There's nothing special here -- it's just plain old OLS, except all the
variables on the r...