Re: [R] maximum-likelihood-estimation with mle()

2015-09-12 Thread Ben Bolker
peter dalgaard gmail.com> writes: > > You are being over-optimistic with your starting values, and/or > with constrains on the parameter space. > Your fit is diverging in sigma for some reason known > only to nonlinear-optimizer gurus... > > For me, it works either to put in an explicit > c

Re: [R] maximum-likelihood-estimation with mle()

2015-09-11 Thread peter dalgaard
You are being over-optimistic with your starting values, and/or with constrains on the parameter space. Your fit is diverging in sigma for some reason known only to nonlinear-optimizer gurus... For me, it works either to put in an explicit constraint or to reparametrize with log(sigma). E.g.

Re: [R] maximum likelihood estimation

2014-10-10 Thread Arne Henningsen
On 10 October 2014 08:04, pari hesabi wrote: > Hello,As an example for Exponential distribution the MLE is got by this > structure:t <- rexp(100, 2)loglik <- function(theta){ log(theta) - theta*t}a > <- maxLik(loglik, start=1)print(a)Exponential distribution has a simple > loglikelihood functio

Re: [R] maximum likelihood estimation

2014-10-09 Thread Arne Henningsen
Dear Pari On 7 October 2014 10:55, pari hesabi wrote: > HelloI am trying to estimate the parameter of a function by the Maximum > Likelihood Estimation method.If the function is the difference between two > integrals: C<-function(n){integrand3<-function(x) {((2-x)^n)*(exp(ax-2))}cc<- > integr

Re: [R] Maximum likelihood estimation (stats4::mle)

2014-07-22 Thread Ronald Kölpin
Thanks, that was exactly it -- switching the values did the trick (and was actually correct in terms of theory.) And of course, you are right -- i changed the starting values to mean(x) - mean(y) for mu and sqrt(var(x-y)) for sigma. I also see your point about the theoretical justification for the

Re: [R] Maximum likelihood estimation (stats4::mle)

2014-07-22 Thread peter dalgaard
On 22 Jul 2014, at 06:04 , David Winsemius wrote: > > On Jul 21, 2014, at 12:10 PM, Ronald Kölpin wrote: > >> Dear R-Community, >> >> I'm trying to estimate the parameters of a probability distribution >> function by maximum likelihood estimation (using the stats4 function >> mle()) but can't

Re: [R] Maximum likelihood estimation (stats4::mle)

2014-07-21 Thread David Winsemius
On Jul 21, 2014, at 12:10 PM, Ronald Kölpin wrote: > Dear R-Community, > > I'm trying to estimate the parameters of a probability distribution > function by maximum likelihood estimation (using the stats4 function > mle()) but can't seem to get it working. > > For each unit of observation I hav

Re: [R] maximum likelihood estimation in R

2012-11-12 Thread Ben Bolker
David Winsemius comcast.net> writes: > > > On Nov 10, 2012, at 9:22 PM, mmosalman wrote: > > > I want to find ML estimates of a model using mle2 in bbmle package. When I > > insert new parameters (for new covariates) in model the log-likelihood value > > does not change and the estimated value

Re: [R] maximum likelihood estimation in R

2012-11-10 Thread David Winsemius
On Nov 10, 2012, at 9:22 PM, mmosalman wrote: > I want to find ML estimates of a model using mle2 in bbmle package. When I > insert new parameters (for new covariates) in model the log-likelihood value > does not change and the estimated value is exactly the initial value that I > determined. Wha

Re: [R] Maximum Likelihood Estimation Poisson distribution mle {stats4}

2012-07-05 Thread chamilka
Thank you very much Professor .Peter Dalgaard for your kind explanations.. This made my work easy.. I am struggling with this for more than 2 days and now I got the correct reply. Thank again. -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-Poisson-d

Re: [R] Maximum Likelihood Estimation Poisson distribution mle {stats4}

2012-07-05 Thread chamilka
Thank you S Ellison-2 for your reply. I will understand it with Prof.Peter Dalgaard's answer.. -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-Poisson-distribution-mle-stats4-tp4635464p4635484.html Sent from the R help mailing list archive at Nabble.c

Re: [R] Maximum Likelihood Estimation Poisson distribution mle {stats4}

2012-07-05 Thread peter dalgaard
On Jul 5, 2012, at 10:48 , chamilka wrote: > Hi everyone! > I am using the mle {stats4} to estimate the parameters of distributions by > MLE method. I have a problem with the examples they provided with the > mle{stats4} html files. Please check the example and my question below! > *Here is the m

Re: [R] Maximum Likelihood Estimation Poisson distribution mle {stats4}

2012-07-05 Thread S Ellison
> -Original Message- > > sample.mean<- sum(x*y)/sum(y) > > sample.mean > [1] 3.5433 > > *This is the contradiction!! * > Here I am getting the estimate as 3.5433(which is reasonable > as most of the values are clustered around 3), but mle code > gives the estimate 11.545(which may not be

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
Thank you! Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-in-R-tp2018822p2022832.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
Abhishek: Thank you! Thomas: that worked out well, thank you again! I also tried to use lm, and as expected in this case, I almost got the same estimates of the parameters as in the MLE-case. Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-L

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
that worked out well, thank you again! I also tried to use lm, and as expected in this case, I almost got the same estimates of the parameters as in the MLE-case. Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-in-R-tp201882

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Thomas Stewart
Henrik- A coding solutions may be ... + (1/(2*stdev*stdev))*sum( ( y-(rev/12)- c(0,y[-n]) *exp(-lap/12) )^2 ) where n is the number of observations in y. Personally, I would use lm. Your model can be written as a linear function. Let x=c(0,y[-n]). Then run lm(y~x). The parameter estimat

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Henkep
Thank you Thomas. (a) an embarrassing mistake by me. Of course it should be squared. Thank you for pointing that out. (b) Do you possibly have any suggestions on how to solve this issue? I presume that there is no reason in trying to create a lagged "vector" manually? Best Regards Henrik --

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Abhishek Pratap
Hey Henrik I dont do MLE myself but this recent blog might be helpful. http://www.johnmyleswhite.com/notebook/2010/04/21/doing-maximum-likelihood-estimation-by-hand-in-r/ -A On Wed, Apr 21, 2010 at 10:02 AM, Thomas Stewart wrote: > Two possible problems: > > (a) If you're working with a normal

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Thomas Stewart
Two possible problems: (a) If you're working with a normal likelihood---and it seems that you are---the exponent should be squared. As in: ... + (1/(2*stdev*stdev))*sum( ( y-(rev/12)-lag(y)*exp(-lap/12) )^2 ) (b) lag may not be working like you think it should. Consider this silly example: y<

Re: [R] Maximum likelihood estimation of parameters make no biological sense

2009-09-24 Thread dave fournier
Hi, Your results are do to using an unstable parameterization of the Von Bertalanffy growth curve, combined with the unreliable optimization methods supplied with R. I coded up your model in AD Model Builder which supplies exact derivatives through AD. I used your starting values and ran the mo

Re: [R] Maximum likelihood estimation

2008-09-05 Thread Ravi Varadhan
.edu/agingandhealth/People/Faculty/Varadhan.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of toh Sent: Thursday, September 04, 2008 9:15 PM To: r-help@r-project.org Subject:

Re: [R] Maximum likelihood estimation

2008-09-04 Thread toh
Yes I'm trying to optimize the parameters a, b, p and lambda where a > 0, b > 0 and 0 < p < 1. I attached the error message that I got when I run mle. > t <- c(1:90) > y <- > c(5,10,15,20,26,34,36,43,47,49,80,84,108,157,171,183,191,200,204,211,217,226,230, + 234,236,240,243,252,254,259,263,264,

Re: [R] Maximum likelihood estimation

2008-09-04 Thread Prof Brian Ripley
From ?optim fn: A function to be minimized (or maximized), with first argument the vector of parameters over which minimization is to take place. It should return a scalar result. I think you intended to optimize over c(a,b,p, lambda), so you need to specify them as

Re: [R] Maximum likelihood estimation

2008-08-15 Thread Peter Dalgaard
Jurica Brajković wrote: > Hello, > > I am struggling for some time now to estimate AR(1) process for commodity > price time series. I did it in STATA but cannot get a result in R. > > The equation I want to estimate is: p(t)=a+b*p(t-1)+error > Using STATA I get 0.92 for a, and 0.73 for b. > > C

Re: [R] Maximum Likelihood Estimation

2008-06-18 Thread Ben Bolker
Todd Brauer yahoo.com> writes: > > Using R, I would like to calculate algorithms to estimate coefficients á and â within the gamma function: > f(costij)=((costij)^á)*exp(â*costij).  I have its logarithmic diminishing line data > (Logarithmic Diminishing Line Data Table) and have installed R¢s Ma

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-15 Thread Thomas Lumley
Try survreg(), in the survival package. -thomas On Fri, 13 Jun 2008, Bluder Olivia wrote: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function "nlm", but isn't there a separate method for doing

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Vincent Goulet
Le ven. 13 juin à 13:55, Ben Bolker a écrit : Bluder Olivia k-ai.at> writes: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function "nlm", but isn't there a separate method for doing this for e.g. t

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Ben Bolker
Bluder Olivia k-ai.at> writes: > > Hello, > > I'm trying to calculate the Maximum likelihood estimators for a dataset > which contains censored data. > > I started by using the function "nlm", but isn't there a separate method > for doing this for e.g. the "weibull" and the "log-normal" distri