[R] constrOptim

songm4 songm4 at mail.nih.gov
Thu Nov 29 01:03:00 CET 2012


Dear R users,

 I am using the function "constrOptim" to minimize the -1*log-likelihood
where \beta_i>=0 i=1,...,p and \beta_0 is unconstrained.

I construct u_i as 


0    0    0                   ...       0
0    1    0                   ...       0
0    0    1                   ...       0
.      .     .                   ...        0
.      .     .                   ...        0
.      .     .                    ...        0
0    0    0                 ...           1

and  c_i as (-1,0,...,0).

Then whatever value \beta_0 takes, the first value of u_i%*%theta_i  is
always zero, which automatically is larger than -1.  That is how I construct
u_i and c_i.

contrOptim returns the barrier.value. I am wondering whether the value
corresponds to -1*\mu*(\sum_{i=1}^p log(\hat{\beta_i}-0)+\log(1)).

I need to get the information matrix which also takes into account the
additional barrier term so I need to figure out what the value of \mu is.
Assuming what I wrote down above is right, I obtain \mu as
-1*barrier.value/(log(\beta_1)+...+log(\beta_p)). 

I would be extremely grateful if anyone checks whether my ways to construct
u_i and c_i and to obtain \mu in the barrier term are right. 

Thanks!

Minsun












constrOptim(beta,fr_general,score_single_parameter,ui=rbind(rep(0,dim(x)[2]+1),cbind(rep(0,dim(x)[2]),diag(1,nrow=dim(x)[2]))),ci=c(-1,rep(0,dim(x)[2])),hessian=TRUE,
method="BFGS")





--
View this message in context: http://r.789695.n4.nabble.com/constrOptim-tp4651227.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list