similar to: 2 questions about mle() /optim() function in stats4

Displaying 20 results from an estimated 1000 matches similar to: "2 questions about mle() /optim() function in stats4"

2012 Jul 30
1
confusion over S3/S4 importing
Can anyone help me figure out the right way to import a method that is defined as S3 in one package and S4 in another? Specifically: profile() is defined as an S3 method in the stats package: function (fitted, ...) UseMethod("profile") <bytecode: 0xa4cd6e8> <environment: namespace:stats> In stats4 it is defined as an S4 method: stats4:::profile standardGeneric for
2011 Feb 07
2
question mle again
A few day ago, I was looking for an answer to my question but didn't get one. Anybody who can help now? Hello, I tried to use mle to fit a distribution(zero-inflated negbin for count data). My call is very simple: mle(ll) ll() takes the three parameters, I'd like to be estimated (size, mu and prob). But within the ll() function I have to judge if the current parameter-set gives a nice
2009 Oct 13
2
time grid for "survfit" Survival function outputs
Dear All, Maybe it is a silly question. But I wasn't able to find it from manual or R site search. I was wondering what is the corresponding time axis for survival function outputs in "survfit". I think it is "survfit(.......)$time", but not 100% sure. If it is, is it possible we could make survival function outputs on the pre-specified time grid with fixed increment and
2011 Feb 11
2
fitdistr question
Hello, I tried to fit a poisson distribution but looking at the function fitdistr() it does not optimize lambda but simply estimates the mean of the data and returns it as lambda. I'm a bit confused because I was expecting an optimization of this parameter to gain a good fit... If I would use mle() of stats4 package or mle2() of bbmle package, I would have to write the function by myself
2009 Nov 04
1
compute maximum likelihood estimator for a multinomial function
Hi there I am trying to learn how to compute mle in R for a multinomial negative log likelihood function. I am using for this the book by B. Bolker "Ecological models and data in R", chapter 6: "Likelihood an all that". But he has no example for multinomial functions. What I did is the following: I first defined a function for the negative log likelihood:
2012 Nov 25
5
bbmle "Warning: optimization did not converge"
I am using the Ben bolker's R package "bbmle" to estimate the parameters of a binomial mixture distribution via Maximum Likelihood Method. For some data sets, I got the following warning messages: *Warning: optimization did not converge (code 1: ) There were 50 or more warnings (use warnings() to see the first 50)* Also, warnings() results the following: *In 0:(n - x) : numerical
2010 Jul 31
2
Is profile.mle flexible enough?
Hi the list, I am experiencing several issues with profile.mle (and consequently with confint.mle) (stat4 version 2.9.2), and I have to spend a lot of time to find workarounds to what looks like interface bugs. I would be glad to get feedback from experienced users to know if I am really asking too much or if there is room for improvement. * Problem #1 with fixed parameters. I can't
2019 Feb 19
1
mle (stat4) crashing due to singular Hessian in covariance matrix calculation
Hi, R developers. when running mle inside a loop I found a nasty behavior. From time to time, my model had a degenerate minimum and the loop just crashed. I tracked it down to "vcov <- if (length(coef)) solve(oout$hessian)" line, being the hessian singular. Note that the minimum reached was good, it just did not make sense to calculate the covariance matrix as the inverse of a
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,
2008 Jul 21
1
Control parameter of the optim( ): parscale
Hi everybody, I am using the L-BFGS-B method of the mle2() function to estimate the values of 6 parameters. mle2 uses the methods implemented in optim. As I got it from the descriptions available online, one can use the parscale parameter to tell R somehow what the values of the estimated parameters should be . . . Could somebody please help me understand what one has to do actually with the
2012 Feb 01
3
Probit regression with limited parameter space
Dear R helpers, I need to estimate a probit model with box constraints placed on several of the model parameters. I have the following two questions: 1) How are the standard errors calclulated in glm (family=binomial(link="probit")? I ran a typical probit model using the glm probit link and the nlminb function with my own coding of the loglikehood, separately. As nlminb does not
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))
2011 Feb 06
1
Confidence interval based on MLE
Hi there, I have fitted a sample (with size 20) to a normal and/or logistic distribution using fitdistr() in MASS or fitdist() in fitdistrplus package. It's easy to get the parameter estimates. Now, I hope to report the confidence interval for those parameter estimates. However, I don't find a function that could give the confidence interval in R. I hope to write a function, however,
2012 Oct 19
2
MLE of negative binomial distribution parameters
I need to estimate the parameters for negative binomial distribution (pdf) using maximun likelihood, I also need to estimate the parameter for the Poisson by ML, which can be done by hand, but later I need to conduct a likelihood ratio test between these two distributions and I don't know how to start! I'm not an expert programmer in R. Please help -- View this message in context:
2003 Sep 17
3
Use the OpenSSH 3.6 uidswap.c for building 3.7 under IRIX
[resending with uidswap.c instead of uidwrap.c] Once I got past the missing inet_ntoa.h weirdness, I ran into an sshd that died a lot. It appears that IRIX doesn't like some of the extra checks added between 1.23 and 1.24 of uidswap.c. Not sure if that constitutes an IRIX bug or not, but helpfully this helps someone. -- Mail: mjo at dojo.mi.org WWW: http://dojo.mi.org/~mjo/ Phone: +1
2008 Sep 10
1
using function instead of formula in plm
Hi all, I am trying to use plm to estimate coefficients in a model consisting of a system of equations. So far I used mle2 from the package "bbmle", but now I need to test for autocorrelation and mle2 does not provide for the necessary tests. mle2 needs a function as input that might as well consist of many different equations. plm however requires an object of class formula that needs
2008 Jun 19
1
Optim() violates constraints
Hi, I am using the mle2 method of the package 'bbmle'. The method is calling as far as I understood it the optim method "L-BFGS-B" (this is the method I use). The latter one allows the user to impose box constraints on the variables, i.e. to give lower and upper bounds. It is important that the initial values satisfy the constraints. In my problem, it is the case. I do not know
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
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 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: