vignettes/Equations.Rmd
Equations.Rmd
Yt=β0+β1t+ϵt\begin{align} \tag{1} Y_t = \beta_0 + \beta_1 t + \epsilon_t \end{align}
L(θ_;y_)=∏t=2np(Yt=yt|Yt−1=yt−1)p(Y1=y1)\begin{align} \tag{2} \mathrm{L}\left( \underline{\theta}; \underline{y} \right )= \prod^n_{t=2} p\left(Y_t = y_t | Y_{t-1}=y_{t-1}\right) p\left(Y_1=y_1 \right) \end{align}
logL(θ_;y_)=−n2log2π−nlogσ+12log(1−ϕ2)−12σ2((1−ϕ2)(y1−β0−β1)2+∑t=2n(yt−ϕyt−1−β0(1−ϕ2)−tβ1+ϕ(t−1)β1)2)\begin{align} \tag{3} logL\left( \underline{\theta}; \underline{y} \right ) = & -\frac{n}{2}log2\pi - nlog\sigma + \frac{1}{2}log(1-\phi^2) \\ &-\frac{1}{2\sigma^2}\left( (1-\phi^2)(y_1-\beta_0-\beta_1)^2 + \sum^n_{t=2}(y_t - \phi y_{t-1}-\beta_0(1-\phi^2) -t\beta_1 + \phi(t-1)\beta_1)^2 \right) \end{align}
σ̂2=1n((1−ϕ2)(y1−β0−β1)2+∑t=2n(yt−ϕyt−1−β0(1−ϕ2)−tβ1+ϕ(t−1)β1)2)\begin{align} \tag{4} \hat\sigma^2 = \frac{1}{n}\left( (1-\phi^2)(y_1-\beta_0-\beta_1)^2 + \sum^n_{t=2}(y_t - \phi y_{t-1}-\beta_0(1-\phi^2) - t\beta_1 + \phi(t-1)\beta_1)^2 \right) \end{align}
logL(β_,ϕ;y_)=const.+12log(1−ϕ2)−n2log((1−ϕ2)(y1−β0−β1)2+∑t=2n(yt−ϕyt−1−β0(1−ϕ2)−tβ1+ϕ(t−1)β1)2)=const.+12log(1−ϕ2)−n2log((1−ϕ2)(y1−X1β_)2+∑t=2n(yt−ϕyt−1−Xtβ_+ϕXt−1β_)2)\begin{align} \tag{5} logL\left( \underline{\beta}, \phi; \underline{y} \right ) &= const. + \frac{1}{2}log(1-\phi^2) \\ &-\frac{n}{2}log\left( (1-\phi^2)(y_1-\beta_0-\beta_1)^2 + \sum^n_{t=2}(y_t - \phi y_{t-1}-\beta_0(1-\phi^2)-t\beta_1 + \phi(t-1)\beta_1)^2 \right) \\ &= const. + \frac{1}{2}log(1-\phi^2) \\ &-\frac{n}{2}log\left( (1-\phi^2)(y_1-X_1\underline{\beta})^2 + \sum^n_{t=2}(y_t - \phi y_{t-1}-X_t\underline{\beta} + \phi X_{t-1}\underline{\beta})^2 \right) \end{align}
logL(β_,ϕ_,σ;y_)=−n2log(2π)−n2log(σ2)+12log|Vp−1|−12σ2(yp_−μp_)TVp−1(yp_−μp_)−12σ2∑t=p+1n(yt−c−ϕ1yt−1−...−ϕpyt−p)2\begin{align} \tag{6} logL\left( \underline{\beta}, \underline{\phi},\sigma; \underline{y} \right ) &= -\frac{n}{2}log(2\pi) -\frac{n}{2}log(\sigma^2) +\frac{1}{2}log \left|V_p^{-1} \right| \\ &-\frac{1 }{2 \sigma^2} (\underline{y_p}-\underline{\mu_p})^T V_p^{-1}(\underline{y_p}-\underline{\mu_p}) \\ &- \frac{1}{2\sigma^2}\sum^n_{t=p+1} (y_t - c - \phi_1y_{t-1} - ... - \phi_p y_{t-p})^2 \end{align}
where
|Vp−1|\left|V_p^{-1} \right| is determinant of inverted matrix VpV_p,
σ2Vp\sigma^2V_p = variance-covariance matrix of order p,
μp_=Xpβ_\underline{\mu_p} = X_p\underline{\beta}, and
XpX_p is the pthp_{th} row of the design matrix corresponding to time t = p
cc = function of fitted terms Xtβ_X_t\underline{\beta}