Resolves #169. Made some more plots to assess the model fit. I found that:
The prior on mu (the centered log P2RA coefficient) was too narrow (std=2), so that it was constraining the posterior even for viruses where we had plenty of data (e.g., Sars-CoV-2).
If I made it too wide (std=10), the sampler had trouble mixing. The posterior distributions of parameters had weird spikes indicating that the sampler got stuck somewhere.
Some of the times the sampler got stuck, the two variance hyperparameters (sigma and tau) were at or near zero, which is not realistic.
I made the following changes to the model:
I widened the prior on mu (std=4).
I changed the priors on sigma and tau from Exp(1) to Gamma(2, 1), which avoids zero and has a mode at 1.
The sampler still gets stuck occasionally when mu gets very low (-10), but this only happens when we have very few (zero?) viral read counts, in which case our posteriors aren't super useful except to give an upper bound on the P2RA coefficient.
I also refactored the Model class to simplify plotting and make it easier to adjust the hyperparameters.
Resolves #169. Made some more plots to assess the model fit. I found that:
mu
(the centered log P2RA coefficient) was too narrow (std=2), so that it was constraining the posterior even for viruses where we had plenty of data (e.g., Sars-CoV-2).sigma
andtau
) were at or near zero, which is not realistic.I made the following changes to the model:
mu
(std=4).sigma
andtau
fromExp(1)
toGamma(2, 1)
, which avoids zero and has a mode at 1.The sampler still gets stuck occasionally when
mu
gets very low (-10), but this only happens when we have very few (zero?) viral read counts, in which case our posteriors aren't super useful except to give an upper bound on the P2RA coefficient.I also refactored the
Model
class to simplify plotting and make it easier to adjust the hyperparameters.