Edderic / mics-whales

Estimating Birth Rates of Humpback Whales in the Gulf of St. Lawrence
1 stars 0 forks source link

Found a pyABC bug #7

Open Edderic opened 5 years ago

Edderic commented 5 years ago

Hi @rsullivan-lord,

Here's an update. While trying to work on this project last weekend, I found a bug in pyABC. Basically, discrete priors like starting Years Since Previous Birth (i.e. yspb for 1980) weren't being handled correctly by code in pyABC, leading to pyABC getting stuck and not finishing inference. But that's okay because we can use continuous values (i.e. yspb is 6.7 years) instead which solves the issue. Another idea from one of the maintainers of pyABC is for us to instead create some extra code to handle that case.

Anyway, I'm now able to run inference and pyABC is now working correctly. Now I'm focusing on working on priors and distance functions to enable the simulator to produce code that is close enough to the observed data for a specific individual. For the first individual, H002, the whale was mostly observed. Using the simple distance function of subtracting the simulated and observed data pairwise, taking the absolute value and then summing leads to the inference where whale is very likely to show up (which is good), but has very low chance of giving birth (which is incorrect). I think this has something to do with the distance function -- births only happen once in a while, so using the distance function above still leads to a small epsilon by just guessing that the whale is alive and likely to be seen and not giving birth. I'm playing around with the idea of weighting differences in observed births more so that the model can learn that H002 does give birth from time to time!

rsullivan-lord commented 5 years ago

Ok sounds good. I talked with Christian briefly yesterday and gave him an update, told him I thought we were about 80% through analysis but not quite sure and would get him a draft as soon as we have numbers to work with. He suggested when we feel good about the model to outline it and have one of our very stats-savy whale colleagues critique it for us.

rsullivan-lord commented 5 years ago

And he's happy to chat with both of us when we've got stuff together but he's very busy at the moment. He and Josie will come out west to visit the end of April/beginning of May so maybe that'll be the best time to FaceTime together