similar to: Function accepted by optim but not mle2 (?)

Displaying 20 results from an estimated 500 matches similar to: "Function accepted by optim but not mle2 (?)"

2010 Feb 12
1
using mle2 for multinomial model optimization
Hi there I'm trying to find the mle fo a multinomial model ->*L(N,h,S?x)*. There is only *N* I want to estimate, which is used in the number of successes for the last cell probability. These successes are given by: p^(N-x1-x2-...xi) All the other parameters (i.e. h and S) I know from somewhere else. Here is what I've tried to do so far for a imaginary data set:
2012 Apr 16
0
Gompertz-Makeham hazard models---test for significant difference
Hi, all. I'm working with published paleodemographic data (counts of skeletons that have been assigned into an age-range category, based upon observed morphological characteristics). For example, the following is the age distribution from a prehistoric cemetery in Egypt: naga <-
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:
2010 Mar 26
1
how to read this special form of data
Dear R listers, I have a data file looks like the following: Testing marker: s_1 --------------------------------------------- Allele df(0) -LnLk(0) df(T) -LnLk(T) ChiSq p 3 7995 29320.30 7994 29311.85 16.90 4e-05 (2229/8000 probands) Testing marker: s_2 --------------------------------------------- Allele df(0)
2002 Aug 22
3
Symbolic differentiation ("D","deriv", etc.) (PR#1928)
Full_Name: Lyle W. Konigsberg Version: 1.5.1 OS: Windows Submission from: (NULL) (160.36.64.99) I apparently found an error in how "deriv" puts a derivative to the screen (though the internal representation is correct). Here's what I was doing for a class example: > lnlk<-expression(15*log(p)+11*log(1-p)) > p<-15/26 > D(D(lnlk,"p"),"p") -15 *
2005 Aug 03
1
passing variable to formula environment
List gurus, I'm trying to code a Gompertz growth curve function as part of a larger project and have run across a problem due to my ignorance of environments. Some sample data and the function are as follows: growth <- data.frame(age = c(1.92, 3, 5.83, 3.17, 15.5, 1.17, 5.58, 13.33, 14.29, 5.83, 13.79, 6.33, 13.75, 16.83, 13, 11.67, 0.25, 1.73, 9.46, 5.67), length = c(157, 165, 179,
2009 Feb 01
2
Extracting Coefficients and Such from mle2 Output
The mle2 function (bbmle library) gives an example something like the following in its help page. How do I access the coefficients, standard errors, etc in the summary of "a"? > x <- 0:10 > y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8) > LL <- function(ymax=15, xhalf=6) + -sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE)) > a <- mle2(LL,
2012 Nov 15
2
survreg & gompertz
Hi all, Sorry if this has been answered already, but I couldn't find it in the archives or general internet. Is it possible to implement the gompertz distribution as survreg.distribution to use with survreg of the survival library? I haven't found anything and recent attempts from my side weren't succefull so far. I know that other packages like 'eha' and
2010 Feb 05
1
Using coxph with Gompertz-distributed survival data.
Dear list: I am attempting to use what I thought would be a pretty straightforward practical application of Cox regression. I figure users of the survival package must have come across this problem before, so I would like to ask you how you dealt with it. I have set up an illustrative example and included it at the end of this post. I took a sample of 100 data points from each of two populations
2011 Oct 17
1
simultaneously maximizing two independent log likelihood functions using mle2
Hello, I have a log likelihood function that I was able to optimize using mle2. I have two years of the data used to fit the function and I would like to fit both years simultaneously to test if the model parameter estimates differ between years, using likelihood ratio tests and AIC. Can anyone give advice on how to do this? My likelihood functions are long so I'll use the tadpole
2012 Jul 01
1
significant difference between Gompertz hazard parameters?
Hello, all. I have co-opted a number of functions that can be used to plot the hazard/survival functions and associated density distribution for a Gompertz mortality model, given known parameters. The Gompertz hazard model has been shown to fit relatively well to the human adult lifespan. For example, if I wanted to plot the hazard (i.e., mortality) functions: pop1 <- function (t) {
2010 Mar 24
0
optimize a joint lieklihood with mle2
Hi I'm trying to maximize a joint likelihood of 2 likelihoods (Likelihood 1 and Likelihood 2) in mle2, where the parameters I estimate in Likelihood 2 go into the likelihood 1. In Likelihood 1 I estimate the vector logN with length 37, and for the Likelihood 2 I measure a vector s of length 8. The values of s in Lieklihood 2 are used in the Likelihood 1. I have 2 questions: ##1 I manage
2008 Nov 19
1
mle2 simple question - sigma?
I'm trying to get started with maximum likelihood estimation with a simple regression equivalent out of Bolker (Ecological Models and Data in R, p302). With this code: #Basic example regression library(bbmle) RegData<-data.frame(c(0.3,0.9,0.6),c(1.7,1.1,1.5)) names(RegData)<-c("x", "y") linregfun = function(a,b,sigma) { Y.pred = a+b*x
2010 Feb 01
1
Help with multiple poisson regression with MLE2
Hi, I'm trying to make multiple poisson regressions with the MLE2 command. I have used the following expression, but I receive an error message: poisfit <- mle2(y ~ dpois(exp(b0 + b1*x1 + b2*x2)), start=list(b0=1, b1=1, b2=1), data=data1) Error in optim(par = c(1, 1, 1), fn = function (p) : non-finite initial value 'vmmin' I have changed initial values using coefficient values
2012 Apr 18
1
error estimating parameters with mle2
Hi all, When I try to estimate the functional response of the Rogers type I equation (for the mle2 you need the package bbmle): > RogersIbinom <- function(N0,attackR2_B,u_B) {attackR2_B+u_B*N0} > RogersI_B <- mle2(FR~dbinom(size=N0,prob=RogersIbinom(N0,attackR2_B,u_B)/N0),start=list(attackR2_B=4.5,u_B=0.16),method="Nelder-Mead",data=data5) I get following error message
2011 Aug 29
1
Bayesian functions for mle2 object
Hi everybody, I'm interested in evaluating the effect of a continuous variable on the mean and/or the variance of my response variable. I have built functions expliciting these and used the 'mle2' function to estimate the coefficients, as follows: func.1 <- function(m=62.9, c0=8.84, c1=-1.6) { s <- c0+c1*(x) -sum(dnorm(y, mean=m, sd=s,log=T)) } m1 <- mle2(func.1,
2012 Apr 19
1
non-numeric argument in mle2
Hi all, I have some problems with the mle2 function > RogersIIbinom <- function(N0,attackR3_B,Th3_B) {N0-lambertW(attackR3_B*Th3_B*N0*exp(-attackR3_B*(24-Th3_B*N0)))/(attackR3_B*Th3_B)} > RogersII_B <- mle2(FR~dbinom(size=N0,prob=RogersIIbinom(N0,attackR3_B,Th3_B)/N0),start=list(attackR3_B=1.5,Th3_B=0.04),method="Nelder-Mead",data=dat) Error in dbinom(x, size, prob, log)
2008 Jul 23
1
mle2(): logarithm of negative pdfs
Hi, In order to use the mle2-function, one has to define the likelihood function itself. As we know, the likelihood function is a sum of the logarithm of probability density functions (pdf). I have implemented myself the pdfs that I am using. My problem is, that the pdfs values are negative and I cann't take the logarithm of them in the log-likelihood function. So how can one take the
2012 Oct 05
2
problem with convergence in mle2/optim function
Hello R Help, I am trying solve an MLE convergence problem: I would like to estimate four parameters, p1, p2, mu1, mu2, which relate to the probabilities, P1, P2, P3, of a multinomial (trinomial) distribution. I am using the mle2() function and feeding it a time series dataset composed of four columns: time point, number of successes in category 1, number of successes in category 2, and
2008 Nov 12
3
Fitting data to a sigmoidal curve
Hi- I'm a biologist trying to figure out the growth rate of salamanders in different ponds. I collected individuals from various populations at different dates, and using the size and date collected, I want to figure out the growth curve of each population. My question is: How do I fit my data to a Gompertz function in R? Thank you so much! Sarah -- View this message in context: