similar to: Maximum Likelihood Estimation Poisson distribution mle {stats4}

Displaying 20 results from an estimated 3000 matches similar to: "Maximum Likelihood Estimation Poisson distribution mle {stats4}"

2019 Apr 24
1
Bug in "stats4" package - "confint" method
Dear R developers, I noticed a bug in the stats4 package, specifically in the confint method applied to ?mle? objects. In particular, when some ?fixed? parameters define the log likelihood, these parameters are stored within the mle object but they are not used by the ?confint" method, which retrieves their value from the global environment (whenever they still exist). Sample code: >
2007 Aug 13
1
[Fwd: behavior of L-BFGS-B with trivial function triggers bug in stats4::mle]
I sent this in first on 30 July. Now that UseR! is over I'm trying again (slightly extended version from last time). With R 2.5.1 or R 2.6.0 (2007-08-04 r42421) "L-BFGS-B" behaves differently from all of the other optim() methods, which return the value of the function when they are given a trivial function (i.e., one with no variable arguments) to optimize. This is not a bug in
2004 Sep 13
2
Problem with mle in stats4 (R 1.9.1)
Hi! This is a repost of an earlier message (with a clearer example demonstrating the problem I ran into). If you run the mle example in stats4 library(stats4) 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)) (fit <- mle(ll)) plot(profile(fit),
2007 Jul 29
1
behavior of L-BFGS-B with trivial function triggers bug in stats4::mle
With the exception of "L-BFGS-B", all of the other optim() methods return the value of the function when they are given a trivial function (i.e., one with no variable arguments) to optimize. I don't think this is a "bug" in L-BFGS-B (more like a response to an undefined condition), but it leads to a bug in stats4::mle -- a spurious error saying that a better fit has been
2005 Jan 10
1
mle() and with()
I'm trying to figure out the best way of fitting the same negative log-likelihood function to more than one set of data, using mle() from the stats4 package. Here's what I would have thought would work: -------------- library(stats4) ## simulate values r = rnorm(1000,mean=2) ## very basic neg. log likelihood function mll <- function(mu,logsigma) {
2008 May 23
1
maximizing the gamma likelihood
for learning purposes and also to help someone, i used roger peng's document to get the mle's of the gamma where the gamma is defined as f(y_i) = (1/gammafunction(shape)) * (scale^shape) * (y_i^(shape-1)) * exp(-scale*y_i) ( i'm defining the scale as lambda rather than 1/lambda. various books define it differently ). i found the likelihood to be n*shape*log(scale) +
2010 Jul 08
2
Using nlm or optim
Hello, I am trying to use nlm to estimate the parameters that minimize the following function: Predict<-function(M,c,z){ + v = c*M^z + return(v) + } M is a variable and c and z are parameters to be estimated. I then write the negative loglikelihood function assuming normal errors: nll<-function(M,V,c,z,s){ n<-length(Mean) logl<- -.5*n*log(2*pi) -.5*n*log(s) -
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
2007 Apr 09
1
R:Maximum likelihood estimation using BHHH and BFGS
Dear R users, I am new to R. I would like to find *maximum likelihood estimators for psi and alpha* based on the following *log likelihood function*, c is consumption data comprising 148 entries: fn<-function(c,psi,alpha) { s1<-sum(for(i in 1:n){(c[i]-(psi^(-1/alpha)*(lag(c[i],-1))))^2* (lag(c[i],-1)^((-2)*(alpha+1)) )}); s2<- sum(for(m in 1:n){log(lag(c[m],-1)^(((2)*alpha)+2))});
2009 Oct 06
2
mle from stats4
I am using mle as a wrapper from optim( ). How would I extract the convergence code, to know that optim( ) converged properly? Thanks, Stephen Collins, MPP | Analyst Global Strategy | Aon Benfield [[alternative HTML version deleted]]
2006 Oct 24
2
Installing stats4 package
Hi, I wantto use 'mle' function in R on linux. As I see its been integrated into the stats4 package. Am I correct ? If yes, Can anyone suggest how to install the stats4 package to be able to run 'mle' function in R on linux ? Otherwise how to sort out this problem ? Thanks Himanshu [[alternative HTML version deleted]]
2008 Sep 04
1
pass data to log-likelihood function
Hi there, When I do bootstrap on a maximum likelihood estimation, I try the following code, however, I get error: Error in minuslogl(alpha = 0, beta = 0) : object "x" not found It seems that mle() only get data from workspace, other than the boot.fun(). My question is how to pass the data to mle() in my case. I really appreciated to any suggestions. Best wishes, Jinsong
2007 Jan 10
2
problems with optim, "for"-loops and machine precision
Dear R experts, I have been encountering problems with the "optim" routine using "for" loops. I am determining the optimal parameters of several nested models by minimizing the negative Log-Likelihood (NLL) of a dataset. The aim is to find the model which best describes the data. To this end, I am simulating artificial data sets based on the model with the least number
2009 Oct 07
1
2 questions about mle() /optim() function in stats4
Dear All, There are two things about mle() that I wasn't so sure. 1) can mle() handle vector based parameter? say ll<-function(theta=rep(1,20)){..............} I tried such function, it worked for "optim" but not for "mle". 2) is there a general suggestion for the maximum number of parameters allowed to use in mle() or optim()? Thank you. Regards, MJO
2014 Jul 06
2
Depot for S3 to S4 generics (as in stats4)?
Dear developers, the implementation of S4 generics for existing S3 ones in the base package is concerned to be a threat to quick startup times [1]. But since S4 is promoted, and S3/S4 interoperability a pain when package developing [2], are there efforts to improve the situation? E.g. an S3 free system, etc. A good thing [2] is the package 'stats4', including some setGeneric calls (e.g.
2008 Mar 11
1
messages from mle function
Dears useRs, I am using the mle function but this gives me the follow erros that I don't understand. Perhaps there is someone that can help me. thank you for you atention. Bernardo. > erizo <- read.csv("Datos_Stokes_1.csv", header = TRUE) > head(erizo) EDAD TALLA 1 0 7.7 2 1 14.5 3 1 16.9 4 1 13.2 5 1 24.4 6 1 22.5 > TAN <-
2017 Nov 07
2
Using MLE on a somewhat unusual likelihood function
So I am trying to use the mle command (from stats4 package) to estimate a number of parameters using data but it keeps throwing up this error message: Error in solve.default(oout$hessian) : Lapack routine dgesv: system is exactly singular: U[1,1] = 0 This error sometimes indicates that the list of starting values is too far from optimum but this is unlikely since I picked values close to where
2006 Aug 09
1
scaling constant in optim("L-BFGS-B")
Hi all, I am trying to find estimates for 7 parameters of a model which should fit real data. I have a function for the negative log likelihood (NLL) of the data. With optim(method="L-BFGS-B",lower=0) I am now minimizing the NLL to find the best fitting parameters. My problem is that the algorithm does not converge for certain data sets. I have read that one should scale the fn
2006 Oct 24
0
Variables ordering problem in mle() (PR#9313)
Full_Name: S?bastien Villemot Version: 2.4.0 OS: Debian testing Submission from: (NULL) (62.212.121.128) Hi, In the mle() function of the stats4 package, there is a bug in the ordering of the variables given in the 'start' argument. By just changing the order of the variables listed in the 'start' list (the initialization values), it is possible to obtain different estimation
2006 Aug 26
1
problems with loop
Dear all, I am trying to evaluate the optimisation behaviour of a function. Originally I have optimised a model with real data and got a set of parameters. Now I am creating simulated data sets based on these estimates. With these simulations I am estimating the parameters again to see how variable the estimation is. To this end I have written a loop which should generate a new simulated data