The HPNLMOD Procedure

Built-In Log-Likelihood Functions

For models in which the distribution of model errors is specified, the HPNLMOD procedure estimates parameters by maximizing the value of a log-likelihood function for the specified distribution. The log-likelihood functions used by PROC HPNLMOD for the supported error distributions are as follows:

$Y \sim \mr{normal}(m,v)$
\begin{align*}  l(m,v;y) & = -\frac12 \left( \log \{ 2\pi \}  + \frac{(y-m)^2}{v} + \log \{ v\} \right) \\ \mr{E}[Y] & = m \\ \mr{Var}[Y] & = v \\ v & > 0 \end{align*}
$Y \sim \mr{binary}(p)$
\begin{align*}  l_1(p;y) & = \left\{  \begin{array}{ll} y \, \,  \log \{ p\}  &  y > 0 \cr 0 \phantom{(1-y)\, \,  \log \{ 1-p\} } &  \mr{otherwise} \end{array} \right. \\ l_2(p;y) & = \left\{  \begin{array}{ll} (1-y)\, \,  \log \{ 1-p\}  \phantom{0} &  y < 1 \cr 0 &  \mr{otherwise} \end{array} \right. \\ l(p;y) & = l_1(p;y) + l_2(p;y) \\ \mr{E}[Y] & = p \\ \mr{Var}[Y] & = p\, (1-p) \\ 0 & < p < 1 \end{align*}
$Y \sim \mr{binomial}(n,p)$
\begin{align*}  l_ c & = \log \{ \Gamma (n+1)\}  - \log \{ \Gamma (y+1)\}  - \log \{ \Gamma (n-y+1)\}  \\ l_1(n,p;y) & = \left\{  \begin{array}{ll} y \, \,  \log \{ p\}  &  y > 0 \cr 0 \phantom{(n-y)\, \,  \log \{ 1-p\} } &  \mr{otherwise} \end{array} \right. \\ l_2(n,p;y) & = \left\{  \begin{array}{ll} (n-y)\, \,  \log \{ 1-p\}  \phantom{0} &  n-y > 0 \cr 0 &  \mr{otherwise} \end{array} \right. \\ l(n,p;y) & = l_ c + l_1(n,p;y) + l_2(n,p;y) \\ \mr{E}[Y] & = n\, p \\ \mr{Var}[Y] & = n\, p\, (1-p) \\ 0 & < p < 1 \end{align*}
$Y \sim \mr{gamma}(a,b)$
\begin{align*}  l(a,b;y) & = -a\log \{ b\}  - \log \{ \Gamma (a)\}  + (a-1)\log \{ y\}  - y/b \\ \mr{E}[Y] & = ab \\ \mr{Var}[Y] & = ab^2 \\ a & > 0 \\ b & > 0 \end{align*}

This parameterization of the gamma distribution differs from the parameterization that the GLIMMIX and GENMOD procedures use. The scale parameter in PROC HPNLMOD is expressed as the inverse of the scale parameter that PROC GLIMMIX and PROC GENMOD use. The PROC HPNLMOD parameter represents the scale of the magnitude of the residuals. The scale parameter in PROC GLIMMIX can be estimated by using the following statements:

proc glimmix;
   model y = x / dist=gamma s;
run;

The following statements show how to use PROC HPNLMOD to estimate the equivalent scale parameter:

proc hpnlmod;
   parms b0=1 b1=0 scale=14;
   linp = b0 + b1*x;
   mu   = exp(linp);
   b    = mu*scale;
   model y ~ gamma(1/scale,b);
run;
$Y \sim \mr{negbin}(n,p)$
\begin{align*}  l(n,p;y) & = \log \{ \Gamma (n+y)\}  - \log \{ \Gamma (n)\}  - \log \{ \Gamma (y+1)\}  \\ & \mbox{ } +n \log \{ p\}  + y \log \{ 1-p\}  \\ \mr{E}[Y] & = n\left(\frac{1-p}{p}\right)\\ \mr{Var}[Y] & = n\left(\frac{1-p}{p^2}\right)\\ n & \ge 0 \\ 0 & < p < 1 \end{align*}

The parameter n can be real-numbered; it does not have to be integer-valued.

$Y \sim \mr{Poisson}(m)$
\begin{align*}  l(m;y) & = y \log \{ m\}  - m - \log \{ \Gamma (y + 1)\} \\ \mr{E}[Y] & = m \\ \mr{Var}[Y] & = m \\ m & > 0 \end{align*}