KANIPRATHI / bayesian-inference

Automatically exported from code.google.com/p/bayesian-inference
0 stars 0 forks source link

Series returned from Model.run() do not correspond to event times #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run runspy_test (with spy in the same folder)

What is the expected output? What do you see instead?
The two graphs and the two lists should be the same. Time 0 is the same for 
both list and is equal to the initial population.

The population of series changes before the event happens: series[1:] is 
already different from series[0] even when the first event happens later.

What version of the product are you using? On what operating system?
v0.4.12

Please provide any additional information below.

Original issue reported on code.google.com by rany...@gmail.com on 26 Aug 2010 at 11:09

Attachments:

GoogleCodeExporter commented 8 years ago
Operating System: Ubuntu 9.10

Original comment by rany...@gmail.com on 26 Aug 2010 at 12:32

GoogleCodeExporter commented 8 years ago
I'll check it today.

Original comment by fccoelho on 26 Aug 2010 at 1:46

GoogleCodeExporter commented 8 years ago
Did you check it?

Original comment by rany...@gmail.com on 3 Nov 2010 at 2:26

GoogleCodeExporter commented 8 years ago
Delphine,

this model is way too complex to check for such a basic error. There are too 
many layers which could be introducing bugs. I'll try to reproduce this on a 
very simple example, or better yet, I'll write some tests to check times of 
events match changes in series.

Original comment by fccoelho on 3 Nov 2010 at 3:26

GoogleCodeExporter commented 8 years ago
This code created from the deterministic example shows the problem (I changed 
the transmission rate, 100 times lower, so that the first event was later than 
1). 
The population at time 1 should not have changed if the first event is later 
than 1.

Original comment by rany...@gmail.com on 3 Nov 2010 at 6:04

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks,

I have been working all day today to write tests that nail this problem. It's a 
bit complicated. But it seems fixable. If you want to take a look at the tests, 
look in the repository in this file:

http://code.google.com/p/bayesian-inference/source/browse/trunk/BIP/tests/test_S
DE_gillespie.py

To run this test you need to have nose installed (easy_install -U nose) and 
BIP's latest version (clone the repository). Then just do "nosetests 
test_SDE_gillespie.py"

Original comment by fccoelho on 3 Nov 2010 at 7:07

GoogleCodeExporter commented 8 years ago
it has been fixed both in the repository and in version 0.5.4 in PyPI.

Delphine, please verify.

Original comment by fccoelho on 4 Nov 2010 at 11:39

GoogleCodeExporter commented 8 years ago
Managed to upgrade and got no error. Everything matches! Thanks

Original comment by rany...@gmail.com on 4 Nov 2010 at 11:51