Displaying 4 results from an estimated 4 matches for "vecpar".
2010 Feb 12
1
using mle2 for multinomial model optimization
...t;) #names for the initial vector
nrs<-c(1:(l-1),1) #nrs for the initial vector
svec = log(c) #transformation of the data to avoid
constraints (x>0)
names(svec) <- paste(nvec,nrs,sep="")
parnames(mfun) <- names(svec)
m1 = mle2(mfun,start=svec,
vecpar=TRUE,fixed=svec[1:(l-1)]) #only estimate
"N-x1-x2-x3",everything else is fixed
coef(m1)
############################################################################
The function "mfun" is working, however the mle2 won't work. How can I
fix this?
Thanks so much for y...
2012 Jan 12
2
Function accepted by optim but not mle2 (?)
Dear Sir/ Madam,
I'm having trouble de-bugging the following - which works perfectly
well with optim or optimx - but not with mle2.
I'd be really grateful if someone could show me what is wrong. Many
thanks in advance. JSC:
gompertz<- function (x,t=data)
{
a3<-x[1]
b3<-x[2]
shift<-data[1]
h.t<-a3*exp(b3*(t-shift))
2010 Mar 24
0
optimize a joint lieklihood with mle2
...d is called mfun(logN, s, h=h,
cohort=cohort). I want to maximize the vectors logN and s. I define the
starting values for logN as svec1 and for s as svec2
then I write for the optimization:
m1 = mle2(mfun,start=list(svec1=logN,svec2=s),
method="L-BFGS-B",lower=lower,upper=10,
vecpar=TRUE,
data=list(h=h,cohort=cohort))
but I get the error:
Error in mle2(mfun, start = list(svec1 = logN, svec2 = s), method =
"L-BFGS-B", :
some named arguments in 'start' are not arguments to the specified
log-likelihood function
How can I correctly write the fucntion f...
2011 Apr 12
1
2-parameter MLE problems
Hi all,
Sorry for the re-post, I sent my previous e-mail before it was complete. I
am trying to model seroprevalence using the differential equation: dP/dt =
beta*seronegative*.001*(seropositive)-0.35*(0.999)*(seropositive)-r*seropositive.
I would like to estimate my two parameters, beta and r, using maximum
likelihood methods. I have included my code below: