Displaying 1 result from an estimated 1 matches for "expomx".
Did you mean:
expo
2009 Jul 19
1
trouble using optim for maximalisation of 2-parameter function
...stimation, but i wrote the likelihood function myself
because of data issues ]
When I try to optimize a function for only one parameter there is no
problem:
llik.expo<-function(x,lam){(length(x)*log(lam))-(length(x)*log(1-exp(-1*lam*
*cons*)))-lam*sum(x)}
cons<-
data<-c(.............)
expomx<-optimize(llik.expo,c(0,100),maximum=TRUE,tol=0.0001,x=data)
expomx
To optimize to two parameters you can't use "optimize", so I tried the
following to test my input:
>
llik.nor<-function(x,theta){mu<-theta[1];sig<-theta[2];-length(x)*log(sqrt(2*pi))-length(x)*log(s...