Solution: Maximum likelihood and hypothesis testing for parametric model (Exam 2021)

Eksempel

a) The intensity process for individual number \(i\) becomes

\[ \lambda_i(t;\theta) = Y_i(t) \alpha_i(t) = I(\widetilde{T}_i \geq t) \alpha_i(t) = I(\widetilde{T}_i\geq t) \nu \exp\{ \beta_1 x_{i1} + \beta_2 x_{i2}\}.\]

Thereby the aggregated intensity process becomes

\begin{align*}
\lambda_\bullet (t;\theta) &= \sum_{i=1}^n \lambda_i(t;\theta) \\
&= \sum_{i=1}^n I(\widetilde{T}_i\geq t) \nu \exp\{ \beta_1 x_{i1} + \beta_2 x_{i2}\}. \\
&= \nu \sum_{i=1}^n I(\widetilde{T}_i\geq t) \exp\{ \beta_1 x_{i1} + \beta_2 x_{i2}\}.
\end{align*}

Using that we necessarily must have \(I(\widetilde{T}_i \geq t)=1\) whenever \(\Delta N_i(t)=1\) we thereby get from the general formula for the likelihood function of a counting process that

\begin{align*}
L(\theta) &= \prod_{i=1}^n \left( \nu \exp\{ \beta_1 x_{i1} + \beta_2 x_{i2}\}\right)^{D_i} \exp\left\{ - \int_0^\tau \nu \sum_{i=1}^n I(\widetilde{T}_i\geq t) \exp\{ \beta_1 x_{i1} + \beta_2 x_{i2}\} dt\right\}\\
&= \nu^{D_\bullet} \exp\left\{ \sum_{i=1}^n D_i (\beta_1 x_{i1} + \beta_2 x_{i2})\right\} \exp\left\{ - \nu \sum_{i=1}^ n \exp\{ \beta_1 x_{i1} + \beta_2 x_{i2}\} \int_0^\tau I(\widetilde{T}_i\geq t) dt \right\}\\
&= \nu^{D_\bullet} \exp\left\{ \beta_1 \sum_{i=1}^n D_ix_{i1} + \beta_2 \sum_{i=1}^n D_i x_{i2}\right\} \exp\left\{ -\nu \sum_{i=1}^ne^{\beta_1x_{i1}+\beta_2x_{i2}}\widetilde{T}_i\right\}\\
&= \nu^{D_\bullet} \exp\left\{\beta_1 \sum_{i:x_{i1}=1} D_i + \beta_2 \sum_{i=1}^n D_i x_{i2} -\nu \left( \sum_{i:x_{i1}=0} e^{\beta_2 x_{i2}}\widetilde{T}_i + \sum_{i:x_{i1}=1}e^{\beta_1+\beta_2x_{i2}}\widetilde{T}_i\right)\right\}\\
&= \nu^{D_\bullet} \exp\left\{\beta_1 D_\bullet^{(1)} + \beta_2 \sum_{i=1}^n D_i x_{i2} -\nu \left( \sum_{i:x_{i1}=0} e^{\beta_2 x_{i2}}\widetilde{T}_i + e^{\beta_1}\sum_{i:x_{i1}=1}e^{\beta_2x_{i2}}\widetilde{T}_i\right)\right\},
\end{align*}

where we in the second last row used that \(X_{i1}\in\{0,1\}\). The log likelihood function thereby becomes

\[
\ell (\theta) = D_\bullet \ln \nu + \beta_1 D_\bullet^{(1)} + \beta_2 \sum_{i=1}^n D_i x_{i2} - \nu \left( \sum_{i:x_{i1}=0} e^{\beta_2 x_{i2}} \widetilde{T}_i + e^{\beta_1}\sum_{i:x_{i1}=1}e^{\beta_2x_{i2}}\widetilde{T}_i\right)
\]

which is what we should show.

b) The partial derivatives of \(\ell (\theta)\) with respect to \(\nu\) and \(\beta_1\), repectively, become

\begin{align*}
\frac{\partial \ell }{\partial \nu} & = D_\bullet \cdot \frac{1}{\nu} - \left( \sum_{i:x_{i1}=0} e^{\beta_2 x_{i2}}\widetilde{T}_i + e^{\beta_1}\sum_{i:x_{i1}=1}e^{\beta_2x_{i2}}\widetilde{T}_i\right),\\
\frac{\partial \ell }{\partial \beta_1} &= D_\bullet^{(1)} -\nu e^{\beta_1} \sum_{i:x_{i1}=1}e^{\beta_2x_{i2}}.
\end{align*}

Defining the notations

\begin{align*}
S^{(0)}(\beta_2) &= \sum_{i:x_{i1}=0} e^{\beta_2 x_{i2}} \widetilde{T}_i,\\
S^{(1)}(\beta_2) &= \sum_{i:x_{i1}=1}e^{\beta_2x_{i2}} \widetilde{T}_i,
\end{align*}

and solving \(\frac{\partial \ell }{\partial \nu}=0\) with respect to \(\nu\) we get

\[ \nu = \frac{D_\bullet}{S^{(0)}(\beta_2) + e^{\beta_1}S^{(1)}(\beta_2)}. \]

Then setting \(\frac{\partial \ell }{\partial \beta_1}=0\) and inserting the expression we just found for \(\nu\) we get

\begin{align*}
D_\bullet^{(1)} &= \frac{D_\bullet e^{\beta_1} S^{(1)}(\beta_2)}{S^{(0)}(\beta_2) + e^{\beta_1} S^{(1)}(\beta_2)}\\
D_\bullet^{(1)} S^{(0)}(\beta_2) + e^{\beta_1} D_\bullet^{(1)} S^{(1)}(\beta_2) &= e^{\beta_1} D_\bullet S^{(1)}(\beta_2)\\
e^{\beta_1} &= \frac{D_\bullet^{(1)}S^{(0)}(\beta_2)}{D_\bullet S^{(1)}(\beta_2) - D_\bullet^{(1)} S^{(1)}(\beta_2)}\\
\beta_1 &= \ln \left[ \frac{D_\bullet^{(1)}S^{(0)}(\beta_2)}{D_\bullet S^{(1)}(\beta_2) - D_\bullet^{(1)} S^{(1)}(\beta_2)}\right].
\end{align*}

We have thereby explicit expressions for the MLEs for \(\nu\) and \(\beta_1\) as a function of the MLE for \(\beta_2\),

\begin{align*}
\widehat{\beta}_1 &= \ln \left[ \frac{D_\bullet^{(1)}S^{(0)}(\widehat{\beta}_2)}{D_\bullet S^{(1)}(\widehat{\beta}_2) - D_\bullet^{(1)}S^{(1)}(\widehat{\beta}_2)}\right]\\
\widehat{\nu} &= \frac{D_\bullet}{S^{(0)}(\widehat{\beta}_2) + e^{\widehat{\beta}_1}S^{(1)}(\widehat{\beta}_2)},
\end{align*}

and we get the profile likelihood for \(\beta_2\) by inserting the expressions we have found for \(\nu\) and \(\beta_1\) as a function of \(\beta_2\) in the formula we have for \(\ell(\theta)\).

c) We know that we approximately have that \(\widehat{\theta}\sim N(0,\mathbb{I}(\widehat{\theta}))\). Under \(H_0\) we thereby get that \(\widehat{\beta_1}\) is approximately normal with zero mean and variance equal to

\begin{align*}
- \left.\frac{\partial^2 \ell}{\beta_1^2}\right|_{\theta=\widehat{\theta}} & = \widehat{\nu} e^{\widehat{\beta}_1} S^{(1)}(\widehat{\beta}_2).
\end{align*}

As a test statistic we can thereby use

\[
Z = \frac{\widehat{\beta}_1}{\sqrt{\widehat{\nu} e^{\widehat{\beta}_1} S^{(1)}(\widehat{\beta}_2)}}
\]

which is approximately standard normal when \(H_0\) is true. We therefore should reject \(H_0\) at signifiance level \(\alpha\) if \(|Z| > z_{\frac{\alpha}{2}}\).