Re: [R] Estimating parameters of 2 phase Coxian using optim

2007-03-08 Thread Laura Hill
On 7/3/07 00:15, Gad Abraham [EMAIL PROTECTED] wrote: Andy Fugard wrote: Hi There, Perhaps the problem is the line loglik-log(p %*% expm(Q * y(i)) %*% q) You mention that y is a vector but here you're treating it as a function. Maybe try loglik-log(p %*%

Re: [R] Estimating parameters of 2 phase Coxian using optim

2007-03-08 Thread Gad Abraham
Laura Hill wrote: On 7/3/07 00:15, Gad Abraham [EMAIL PROTECTED] wrote: Andy Fugard wrote: Hi There, Perhaps the problem is the line loglik-log(p %*% expm(Q * y(i)) %*% q) You mention that y is a vector but here you're treating it as a function. Maybe try

[R] Estimating parameters of 2 phase Coxian using optim

2007-03-06 Thread Laura Hill
Hi, My name is Laura. I'm a PhD student at Queen's University Belfast and have just started learning R. I was wondering if somebody could help me to see where I am going wrong in my code for estimating the parameters [mu1, mu2, lambda1] of a 2-phase Coxian Distribution.

[R] Estimating parameters of 2 phase Coxian using optim

2007-03-06 Thread Laura Hill
Hi, My name is Laura. I'm a PhD student at Queen's University Belfast and have just started learning R. I was wondering if somebody could help me to see where I am going wrong in my code for estimating the parameters [mu1, mu2, lambda1] of a 2-phase Coxian Distribution. cox2.lik-function(theta,

Re: [R] Estimating parameters of 2 phase Coxian using optim

2007-03-06 Thread Andy Fugard
Hi There, Perhaps the problem is the line loglik-log(p %*% expm(Q * y(i)) %*% q) You mention that y is a vector but here you're treating it as a function. Maybe try loglik-log(p %*% expm(Q * y[i]) %*% q) ? Don't have a clue about the correctness of the contents of

Re: [R] Estimating parameters of 2 phase Coxian using optim

2007-03-06 Thread Gad Abraham
Andy Fugard wrote: Hi There, Perhaps the problem is the line loglik-log(p %*% expm(Q * y(i)) %*% q) You mention that y is a vector but here you're treating it as a function. Maybe try loglik-log(p %*% expm(Q * y[i]) %*% q) ? Don't have a clue about the