search for: parnam

Displaying 6 results from an estimated 6 matches for "parnam".

Did you mean: param
2012 Aug 08
1
dimnames in array
...= qwts %*% t(lambda) weights = array(1,dim(data11a)) likmore = make.id() likmore$weights = weights lik = make.SSElik() lik$more = likmore lik$bvals = eval.basis(times,bbasis) procmore = make.fhn() procmore$weights = qwts procmore$qpts = qpts procmore$names = varnames procmore$parnames = parnames proc = make.SSEproc() proc$more = procmore proc$bvals = list(bvals = eval.basis(procmore$qpts,bbasis,0), dbvals = eval.basis(procmore$qpts,bbasis,1)) res11a = inneropt(coefs, times=times, data=data11a, lik=lik, proc=proc, pars=spars, in.meth='nlminb', control.in=cont...
2012 May 15
0
Indexing in summaryBy
...estimates for estimator 2) Thus, X is an id that is constant for a given parameter combination across simulation runs. I need to calculate the root mean squared error. For each estimate I extract the corresponding parameter value from the column name of the estimates: rmse <- function(est){ parname <- deparse(substitute(est)) par1 <- unlist(strsplit(parname, c("\\.")))[1] par2 <- eval(parse(text=par1)) sqrt(sum((par2- est)^2) /length(est)) } This works well for subsets (i.e. given parameter combinations), but not inside the summaryBy function because I cannot index pro...
2010 Feb 12
1
using mle2 for multinomial model optimization
...,->100=N-x1-x2-x3 nvec<-c(rep("x",l-1),"N") #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 t...
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))
2012 Feb 23
0
error in optim: initial value in 'vmmin' is not finite
...2 63 Pelayos 3 3 64 Pelayos 4 3 65 Pelayos 5 3 > Pr<-function(p1,p,n1,n2) + {P1=1-(1-p1) + POD=1-(1-p) + Pr=P1*POD + -sum(dbinom(length(Cov$Nt),size=Cov$sizead, prob=POD, log=TRUE)*dbinom(length(Cov$Nt), size=Cov$sizec, prob=P1,log=TRUE)) + } > parnames(Pr)=c("p1","p") > m1<-mle2(Pr, start=list(p1=0.2, p=0.5), > data=list(Pr=Cov$Pr,n1=Cov$sizec,n2=Cov$sizead)) > Error in optim(par = c(0.2, 0.5), fn = function (p) : initial value in 'vmmin' is not finite Thanks in advance, regards, Pablo -- View thi...
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: