Dear all,
I am trying to estimate a GB2 income distribution on binned data using Maximum Likelihood. I follow Chotikapanich et al. (2018) and want to estimate the following Log-likelihood:
\[ L(\Phi) \propto \sum^{N}_{i = 1} c_i \log[F(x_{i} | \Phi) - F(x_{i-1} | \Phi)] \]
The corresponding cdf is:
\[ F(y | a, b, p, q) = \frac{1}{B(p,q} \int_0^{w} t^{p-1}(1 - t)^{q - 1} dt \]
with
\[ w = (y/b)^a/[1 + (y/b)^a] \]
and
\[ B(p,q) = \int_0^1 t^{p - 1} (1 - t)^{q-1} dt \]
My data contains an upper limit ("upper") and a lower limit ("lower") for each income class, as well as the number of observations ("weight") in that class (equivalent to c_i in above formula). I have the following code:
The error I receive is "{b} invalid name" after the ml maximize command. Why do I get this error specifically for b? My goal is to estimate the four parameters a, b, p, q.
Moreover, I´m unsure if I specified the program correctly, since all available examples seem to have explanatory variables and I just want to estimate the distribution.
Any help is appreciated, thanks.
I am trying to estimate a GB2 income distribution on binned data using Maximum Likelihood. I follow Chotikapanich et al. (2018) and want to estimate the following Log-likelihood:
\[ L(\Phi) \propto \sum^{N}_{i = 1} c_i \log[F(x_{i} | \Phi) - F(x_{i-1} | \Phi)] \]
The corresponding cdf is:
\[ F(y | a, b, p, q) = \frac{1}{B(p,q} \int_0^{w} t^{p-1}(1 - t)^{q - 1} dt \]
with
\[ w = (y/b)^a/[1 + (y/b)^a] \]
and
\[ B(p,q) = \int_0^1 t^{p - 1} (1 - t)^{q-1} dt \]
My data contains an upper limit ("upper") and a lower limit ("lower") for each income class, as well as the number of observations ("weight") in that class (equivalent to c_i in above formula). I have the following code:
Code:
program gb2est_lf version 16 args lnfj quietly replace `lnfj' = `lnfj' * /// (ibeta({p},{q},((upper/{b})^{a})/(1+(upper/{b})^{a}))) // - (ibeta({p},{q},((lower/{b})^{a})/(1+(lower/{b})^{a}))) end ml model lf gb2est_lf (weight) ml maximize
Moreover, I´m unsure if I specified the program correctly, since all available examples seem to have explanatory variables and I just want to estimate the distribution.
Any help is appreciated, thanks.
Comment