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.

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

2015-09-11 Thread Ronald Kölpin
Hi everyone, I have a problem with maximum-likelihood-estimation in the following situation: Assume a functional relation y = f(x) (the specific form of f should be irrelevant). For my observations I assume (for simplicity) white noise, such that hat(y_i) = f(x_i) + epsilon_i, with the epsilon_i

[R] Maximum likelihood Estimation

2014-10-10 Thread Parvin Dehghani
maximum likelihood estimation pari hesabi 6:04 AM To: r-help@r-project.org 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

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

[R] maximum likelihood estimation

2014-10-09 Thread pari hesabi
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 function. But if a new pdf has a more complicated form like

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

[R] maximum likelihood estimation

2014-10-07 Thread pari hesabi
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<- integrate (integrand3,0,2)print(cc)} D<-function(n){integrand4<-functi

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

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

2014-07-21 Thread Ronald Kölpin
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 have a pair of observations (a, r) which I assume (both) to be log-nor

[R] Maximum likelihood estimation of ARMA(1,1)-GARCH(1,1)

2013-04-08 Thread Andy Yeh
Hello Following some standard textbooks on ARMA(1,1)-GARCH(1,1) (e.g. Ruey Tsay's Analysis of Financial Time Series), I try to write an R program to estimate the key parameters of an ARMA(1,1)-GARCH(1,1) model for Intel's stock returns. For some random reason, I cannot decipher what is wrong with

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

[R] maximum likelihood estimation in R

2012-11-10 Thread mmosalman
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. What's the problem? This is the code and the result: As

[R] Maximum Likelihood estimation of KB distribution

2012-07-17 Thread chamilka
Hi, The following distribution is known as Kumaraswamy binomial Distribution. http://r.789695.n4.nabble.com/file/n4636782/kb.png For a given data I need to estimate the paramters (alpha and beta) of this distribution(Known as Kumaraswamy binomial Distribution, A Binomial Like Distribution). For t

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

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

2012-07-05 Thread chamilka
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 mle html help file * http://stat.ethz.ch/R-manual/R-dev

[R] Maximum likelihood estimation in R

2010-07-19 Thread Maomao Luo
Dear R-helper, I am trying to do maximum likelihood estimation in R. I use the "optim" function. Since I have no prior information on the true values of the parameters, I just randomly select different sets of starting values to feed into the program. Each time, I get the following error

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<

[R] Maximum Likelihood Estimation in R

2010-04-21 Thread Henkep
Dear R-Help, I also send the following post by e-mail to you, however I try to post it here aswell. My name is Henrik and I am currently trying to solve a Maximum Likelihood optimization problem in R. Below you can find the output from R, when I use the "BFGS" method: The problem is that the p

[R] Maximum Likelihood Estimation

2009-11-04 Thread Prof. John C Nash
data, I'll be willing to try it out. JN > Message: 84 > Date: Tue, 3 Nov 2009 19:49:17 +0000 > From: Andre Barbosa Oliveira > Subject: [R] Maximum Likelihood Estimation > To: > Message-ID: > Content-Type: text/plain > > > Hi, > > I would like estim

[R] Maximum Likelihood Estimation

2009-11-03 Thread Andre Barbosa Oliveira
Hi, I would like estimate a model for function of production's Coob-Douglas using maximum likelihood. The model is log(Y)= beta[1]+beta[2]*log(L)+beta[3]*log(K). I tried estimate this model using the tools nlm ( ) and optim ( ) using the log-likelihood function below: > mloglik <- fu

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

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

2009-09-24 Thread Luis Ridao Cruz
R-help, I'm trying to estimate some parameters using the Maximum Likehood method. The model describes fish growth using a sigmoidal-type of curve: fn_w <- function(params) { Winf <- params[1] k <- params[2] t0 <- params[3] b <- params[4]

[R] Maximum likelihood estimation of a truncated regression model

2008-09-16 Thread Srinivasan Parthasarathy
Hi, I have a quick question regarding estimation of a truncation regression model (truncated above at 1) using MLE in R. I will be most grateful to you if you can help me out. The model is linear and the relationship is "dhat = bhat0+Z*bhat+e", where dhat is the dependent variable >0 and upper tr

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

[R] Maximum likelihood estimation

2008-09-04 Thread toh
Hi R-experts, I'm new to R in mle. I tried to do the following but just couldn't get it right. Hope someone can point out the mistakes. thanks a lot. 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,268,271,27

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

[R] Maximum likelihood estimation

2008-08-12 Thread Jurica Brajković
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. Code that I use in R is: p<-matrix(data

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

[R] Maximum Likelihood Estimation

2008-06-18 Thread Todd Brauer
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 Maximum Likelihood Estimation package; ho

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

[R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Bluder Olivia
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" distribution? Thanks, Olivia [[a