Re: [R] likelihood function involving integration, error in nlm

2012-10-19 Thread stats12
Thanks for pointing that out. Made some modifications and it worked. -- View this message in context: http://r.789695.n4.nabble.com/likelihood-function-involving-integration-error-in-nlm-tp4646697p4646764.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] likelihood function involving integration, error in nlm

2012-10-19 Thread Berend Hasselman
On 19-10-2012, at 04:40, stats12 wrote: > Dear R users, > > I am trying to find the mle that involves integration. > > I am using the following code and get an error when I use the nlm function > > d<-matrix(c(1,1,0,0,0,0,0,0,2,1,0,0,1,1,0,1,2,2,1,0),nrow=10,ncol=2) > h<-matrix(runif(20,0,1),

[R] likelihood function involving integration, error in nlm

2012-10-18 Thread stats12
Dear R users, I am trying to find the mle that involves integration. I am using the following code and get an error when I use the nlm function d<-matrix(c(1,1,0,0,0,0,0,0,2,1,0,0,1,1,0,1,2,2,1,0),nrow=10,ncol=2) h<-matrix(runif(20,0,1),10) integ<-matrix(c(0),nrow=10, ncol=2) ll<-function(p){