pyro-ppl / numpyro

Probabilistic programming with NumPy powered by JAX for autograd and JIT compilation to GPU/TPU/CPU.
https://num.pyro.ai
Apache License 2.0
2.15k stars 235 forks source link

issues when numpyro.enable_validation(is_validate=True) #1438

Closed hyperfra closed 2 years ago

hyperfra commented 2 years ago

Hi I identified a strange behavior: I estimate a VectorAutoRegression model and when I use numpyro.enable_validation(is_validate=True), (which I had in the code for some versions of the model with a MultivariateTruncated) , the resuts of any simple version of the model (with MultivariateNormal residuals say) were off. Taking out numpyro.enable_validation(is_validate=True) the results look fine. Should I be worried?

best

fehiepsi commented 2 years ago

I think there might be some problems. When enabling the validation, we mask out-of-support samples by zero density. Not sure if it is related. Could you make reproducible code?

hyperfra commented 2 years ago

Ok here is an example, if you comment line 11 it returns sensible results. Otherwise it fails. The data are downloaded via pandasdmx. If you prefer I can send you a csv.

martinjankowiak commented 2 years ago

@hyperfra downloading zip files from unknown third parties isn't exactly a great idea. can you please instead provide e.g. a gist and create fake data within the script?

hyperfra commented 2 years ago

sorry, you are quite right. now the link works https://gist.github.com/hyperfra/9e8df68414b0172c852a16db82659bc6

fehiepsi commented 2 years ago

Thanks @hyperfra! It seems that there is something wrong with the validation logic of LKJCholesky distribution.

hyperfra commented 2 years ago

ok :-)