Hi,
Im trying to estimate different parameters in an alternative wrapped Cauchy distribution (where mu (mui) is dependent on several variables (such as c, z and mu0), where c is a constant) and using the following log-likelihood and MLE functions: ###log likelihood for wrapped cauchy ### wrappedCauchy.lik<-function(theta,y,x,z){ n<-nrow(y) mu0 <- theta[1] rho <- theta[2] c <- theta[3] mui <- mu0+(x-mu0)*(1-exp(-c*z)) logl<-sum(log((1-(rho^2))/(1+(rho^2)-2*rho*cos(y-mui))/(2*pi))) return(-logl) } ##Method for MLE### d <- optim(c(mu0,rho0, 2.3),wrappedCauchy.lik,y=turn1,x = HRturns1, z = HRDistance1, method="CG") The problem here is that the optim results are equal to the initial values and therefore changes dependent on those values am I doing something wrong here? When I run a simpler version of the wrapped cauchy just estimating mu and rho (without mu being dependent on c), the optim estimates seem to work as the are different from the initial values. Is it a problem trying to get MLE for a constant in this case c? Thanks Lene ___________________________ Lene Jung Kjær Studsdalvej 20, Taulov 7000 Fredericia, Danmark Tlf: 29 86 96 14 email: ljk...@hotmail.com [[alternative HTML version deleted]]
_______________________________________________ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology