pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
259 stars 211 forks source link

Improve Kronecker example #653

Closed AlexAndorra closed 1 month ago

AlexAndorra commented 3 months ago

Various updates and improvements on the Kronecker variance GP example:


📚 Documentation preview 📚: https://pymc-examples--653.org.readthedocs.build/en/653/

review-notebook-app[bot] commented 3 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

AlexAndorra commented 1 month ago

@bwengals can we merge this one please?

review-notebook-app[bot] commented 1 month ago

View / edit / reply to this conversation on ReviewNB

bwengals commented on 2024-05-27T05:04:43Z ----------------------------------------------------------------

The truncated normal makes sense to me for the lengthscales, but it seems a bit strange for eta and sigma, because it won't let either the GP or the noise go to zero. I think it'd make more sense to use HalfNormals or something like that for those parameters. Does it still sample with those priors?


AlexAndorra commented on 2024-05-27T18:25:51Z ----------------------------------------------------------------

Yep, it still samples with pm.HalfNormal("sigma", 0.5) and pm.HalfNormal("eta", 0.5)

But eta and sigma can't be equal to zero anyways, can they? What I'm trying to do is avoid the near-zero region. Does that make sense?

bwengals commented on 2024-05-27T22:32:07Z ----------------------------------------------------------------

I think its analogous to doing a linear regression, and putting a Normal(0, sigma) prior on the beta coefficients, and a half-normal or something on the likelihood sigma, right? Or Im missing something.

Like it'd be strange to do y ~ N(beta0 + beta1 * x, sigma) with truncated normal priors on beta0, beta1 and sigma? Unless you had a very particular reason

AlexAndorra commented on 2024-05-28T13:40:24Z ----------------------------------------------------------------

Yep, agreed. I've definitely done the second case -- it's very useful when you have prior information about the parameters. Here though it's hard to argue for or against, as it's a simulated case.

Anyways, that's not a blocker and runs fine now, so we can go ahead