Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Maarten Buis <maartenlbuis@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Re: about MLE of exponential distribution |

Date |
Wed, 7 Mar 2012 17:45:15 +0100 |

On Wed, Mar 7, 2012 at 4:40 PM, mahadeb poudel wrote me privately: > I am using a six probability distribution function namely Normal, Beta, > Gamma, Weibull, Lognormal, and Exponetial for the yield risk analysis of > rice in my PhD dissertation research. I want to estimate the parameters of > each distribution by using Maximum likelihood method. For this, I am using > log likelihood estimation method. So, far I can estimate the parameters > of Normal, Gamma, Weibull, and Lognormal, however I can not estimate the > parameters of Beta and Exponential distribution. The exponential > distribution I have applied is > > program define expon > 1.version 11.0 > 2. args lnf lamda > 3. quietly replace `lnf'= ln(`lamda ')-(`lamda')*($ML_Y1) > 4. end > > ml model lf expon (theta:nepn=time timesq) > ml search > ml maximize > > I always get: invalid syntax r(198) > > I am suffering by this problem. Therefore, Could you please help me to solve > the problem? Questions like these should not be sent privately, but instead to the statalist. Reasons for that are discussed here: <http://www.stata.com/support/faqs/res/statalist.html#private> I would not try to program that yourself, as it has already been done. For the normal/Gaussian distribution you can just use -regress- or -glm-, for the beta, gamma, Weibull, and lognormal you can download the -betafit-, -gammafit- -weibullfit-, -lognfit- packages from SSC, see: -help ssc-. With the appropriate constraints you can use -gammafit- to estimate an exponential distribution. In that case you don't want to use the -alphavar()- option and constrain the constant of the alpha equation to 1, and typically you parametrize an exponential distribution in terms of a rate, which you can get by specifying the -alt- option: constraint 1 [alpha]_b[_cons] = 1 gammafit varname, alt constr(1) -- Maarten -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**st: RE: Re: about MLE of exponential distribution***From:*Nick Cox <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: Looping over variables in more than one group** - Next by Date:
**st: RE: Re: about MLE of exponential distribution** - Previous by thread:
**st: Using -nlcom- with a user-written procedure** - Next by thread:
**st: RE: Re: about MLE of exponential distribution** - Index(es):