-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Positive log likelihood for Poisson and Binomial distribution #63
Comments
It seems that the Gaussian approximation fails silently with exact diffuse initialization (using
Let's simplify your model a bit by removing the constant states and reducing number of observations:
Still failing. Checking at the Gaussian approximation shows "convergence" to some extreme case:
So essentially the Gaussian approximation suggests zero signal-to-noise ratio. Without exact initialization things look quite different:
So the diffuse initialization causes the Gaussian approximation to fail here. Even this simplified model is borderline nonidentifiable though given that the linear predictor Zalpha_t is a linear combination of multiple AR(1) processes, and second and third states are both almost random walks, and the observations are just ones and zeros, so essentially there isn't much information to be gained from the series compared to the very flexible three-state model without any knowledge of their initial values (i.e. diffuse initialization). |
Thank you!
|
Yeah you probably need to check if the values of approxSSM(model)$H are very large. My initial though was to just check So, I would probably make a custom objective function for
And yes you typically need to start with multiple initial values and pick the best, as the likelihood surface often contains multiple local optimums. |
I now added an additional parameter for |
That works for me!! Thank you |
Dear Dr. Helske,
You said that 'the
logLik
function returns log-likelihood contains all the constant terms.', which means for discrete distributions like Poisson or Binomial, it should be less than 0.Here, my response variable is
dat$y
which is binary. I tried to use Poisson or Binomial distribution to model it. But in the following example, I will get positive log-likelihoods.Try the Poisson distribution:
Try the Binomial distribution:
Not sure why this happens. Thank you for your help!!
Regards
Peter
The text was updated successfully, but these errors were encountered: