Troubleshooting RPANDA code


I’m trying to test maximum likelihood fit of environmental birth death model specified in Helen Morlone’s paper.

Using the code given in the manual:

dof<-smooth.spline(InfTemp[,1], InfTemp[,2])$df

f.lamb <-function(t,x,y){y[1] * exp(y[2] * x)}<-function(t,x,y){0}
lamb_par<-c(0.10, 0.01)
result_exp <-fit_env(Cetacea,InfTemp,tot_time,f.lamb,,lamb_par,mu_par, f=21/40,,df=dof,dt=1e-3)

This code gives me the following error.

Error in optim(init, optimLH, method = meth) : function cannot be evaluated at initial parameters.

What should I modify in my code to troubleshoot this?


It is hard to troubleshoot this without a working example. What is a above? Does it correspond with the Cetacea data? If not, that would explain the failure.