Learning Poisson State Space Model parameters for large number of samples

I added an example of multiple observed states to that gist by following your code. Everything has to do with the structure of the A, Q, and Z matrices. This is why I asked about what kinds of dynamics you are looking to model. I did the example as a collection of 10 independent local level processes. Generally, though, you could have dependencies between the variables. You almost certainly should not be estimating a dense A matrix, it needs to have some sort of structure.

The C matrix is also not usually estimated, it’s most often just an indicator matrix to select observed states. The logic is that anything you want to include in the C matrix could instead be incorporated into the A matrix.

I’d be happy to help if I can with all of that but I’d need to know more about the specific problem.