Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

From |
Maarten Buis <[email protected]> |

To |
[email protected] |

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 <[email protected]>

- 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):