Skip to content
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

efficiency: M step for poisson likelihood for LDS #23

Open
murphyk opened this issue Feb 2, 2022 · 1 comment
Open

efficiency: M step for poisson likelihood for LDS #23

murphyk opened this issue Feb 2, 2022 · 1 comment

Comments

@murphyk
Copy link

murphyk commented Feb 2, 2022

In https://github.com/lindermanlab/ssm-jax-refactor/blob/main/ssm/lds/emissions.py#L263, you take the Gaussian expected sufficient statistics E[z_t y_t], and then sample from them, before fitting the Poisson model on this sampled data (IIUC). Is the sampling step necessary? Can you use weighted MLE?

@slinderman
Copy link
Contributor

slinderman commented Feb 2, 2022

The challenge is that we'd ideally like to maximize E[\log p(z, y; \theta)] but for the Poisson GLM likelihood that may include expectations that are not analytically calculable. Specifically, for a mean function f, we have:

E[\log p(y_t | z_t)] = -E[f(w^\top z_t)] + y_t E[\log f(w^\top z_t)] 

If f(x) = e^x then we can compute both in closed form, but not for the general case. We just defaulted to a Monte Carlo approximation instead, but we could consider alternatives. E.g. we could take a first or second-order Taylor approximation of f and \log f to get Gaussian integrals. That would be pretty straightforward with JAX and could be more efficient and/or lead to nicer convergence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants