Closed beanumber closed 2 weeks ago
@xuehens do you know what might be going on here?
I don't know what could be happening here, because the formula is just:
ll <- -(N * log(sigma_hatsq) + N + N * log(2 * pi)) / 2
so the only variable is $\hat{\sigma}^2$, and we already know that is correct to three digits. The value of $\hat{\sigma}^2$ that would produce a log-likelihood of -288.80 is 0.28872, whereas we're getting 0.28971 and the paper reports 0.290.
Interestingly, using $N = 361$ instead of 362 gives the correct value. Is that because you lose an observation by lagging the errors??!
I think we're within the realm of rounding errors here...
The computation of the log-likelihood for the trend shift model with AR(1) errors is off by a small amount. However, as in #72 , the calculation is exact for white noise errors. The value of $\sigma^2$ is also correct (to three digits). Even though the difference is small, I'd like to close the gap.
Created on 2024-04-03 with reprex v2.1.0