-
Notifications
You must be signed in to change notification settings - Fork 73
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
Problem with missing data #79
Comments
Hi, sorry for the slow answer, I was taking holidays.
|
A minimal code would be:
Now, if I run the Bootstrap for an instance of the class (toy_model), and some simulated data:
Then, everything gets populated by nans. Momentarily, I fixed it replacing |
Ok, I tried to fill in the blanks, in order to turn your pieces of code into an actual MRE, this is what I got, it seems to work for me?
|
I was careless with my MRE. Now that I try to reproduce it, I realize that in my case |
ok, this is an actual bug then, FlatNormal.logpdf should not return Nan when a data point is Nan. |
Thank you! It is running well, I tested the code
It estimates well the original states for |
According to this tutorial, missing data can be modelled as a FlatNormal, then I did so for my first observations. The algorithm I run is Bootstrap, and then SMC.
When I run the algorithm, all the weights are nan for every time and the result is meaningless. To fix the problem I return the distribution
Dirac(loc=np.zeros_like(x))
for the first observations. The algorithm runs well and the results are nice, but I think this is not the expected behaviour with FlatNormal.===========
I have other question. I fit my experimental data to my model using cmdstanpy, and I plan to use particles to filter online data in production. The output of stan are samples of parameters, so I think I should run the particle filtering with different samples of the parameters fitted in stan. Does it make sense? is there a way to run the same model with different parameters in particles? I can use a for loop, but they are slow in Python. I am not a Bayesian, but a user, so naive questions.
Thank you for this amazing package!
The text was updated successfully, but these errors were encountered: