I am facing a similar problem
The code which i am pasting below has been taken from the book "Bayesian
Computation with R" by Jim Albert.
laplace=function (logpost, mode, par)
{
options(warn=-1)
fit=optim(mode, logpost, gr = NULL, par, hessian=TRUE,
control=list(fnscale=-1))
o
On 19/09/2008, at 2:33 PM, sandsky wrote:
I have an error for a simple optimization problem.
It is not a simple optimization problem. It is a
totally silly optimization problem.
Is there anyone knowing
about this error?
lambda1=-9
lambda2=-6
L<-function(a){
s2i2f<-(exp(-l
I have an error for a simple optimization problem. Is there anyone knowing
about this error?
lambda1=-9
lambda2=-6
L<-function(a){
s2i2f<-(exp(-lambda1*(250^a)-lambda2*(275^a-250^a))
-exp(-lambda1*(250^a)-lambda2*(300^a-250^a)))
logl<-log(s2i2f)
return(-logl)}
optim(1,L)
Error in optim(1,
3 matches
Mail list logo