Open FelixNoessler opened 1 month ago
Hey @FelixNoessler,
It's been a while since I looked at this code, but I think the reason the first try didn't work and the second did is that loglike
looks for the unconstrainted values of the parameters in order to compute the loglikelihood. These unconstrained values should be populated when fitting a model.
Basically, when we implemented this, I think we didn't envision a use case where a user would want the loglikelihood without fitting a model. But yes, based on what you did, loglike
will take those set values and run the Kalman iterations in order to compute the loglikelihood using the specified parameters.
Hope this helps!
Hello,
is it possible to calculate the marginal log likelihood given the observations and the model parameters? I want to do thinks similar to this tutorial from PINTS with statsmodesl in python: https://github.com/pints-team/pints/blob/main/examples/interfaces/statsmodels-state-space.ipynb
A bit simplified, they do:
I tried it with StateSpaceModels.jl, but I get just NaN from the
loglike
function:Then, I manually set the unconstrained parameter and it worked:
Is this the right marginal likelihood that I can use to run a MCMC algorithm to infer the variance (and some model) parameters?
Best, Felix