[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Likelihood function of uniform distribution

From   Bob Hammond <>
Subject   st: Likelihood function of uniform distribution
Date   Tue, 01 Apr 2008 12:57:50 -0500

This message is from a friend who is having trouble sending a message to the list. Sorry if his message comes through later as a duplicate.


In order to run a Maximum Likelihood Estimation, I need to define the likelihood function for a uniform distribution. But I am not sure how to define a uniform probability distribution function in Stata. For example, I don’t know how to define the following function or the associated likelihood function in Stata:

f(x)=1 if 0<x<1
=0 otherwise.

I have tried the following commands to define the log-likelihood function of a uniform distribution; however, I think it is NOT an appropriate way to do it since theta is not penalized when it falls outside the interval [0,1]:

program myunif
args lnf theta
quietly replace `lnf' =ln(`theta') if $ML_y1==1
quietly replace `lnf' =ln(1-`theta') if $ML_y1==0

Also, how do you define the following triangular probability distribution function?

f(x)= 4x if 0<x<0.5
=4-4x if 0.5<x<1
=0 otherwise.

I appreciate any help or comment in advance.




Mostafa Beshkar
PhD Candidate
Dept of Economics, Vanderbilt University
Phone: 1(615)522-1775
Fax: 1(615)343-8495
SSRN page:
Bob Hammond
Department of Economics
Vanderbilt University
* For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index