Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nu > 0 #24

Open
kaselby opened this issue Feb 17, 2018 · 3 comments
Open

nu > 0 #24

kaselby opened this issue Feb 17, 2018 · 3 comments

Comments

@kaselby
Copy link
Contributor

kaselby commented Feb 17, 2018

Is there a reason nu is required to be strictly greater than 0 in the inner constructor? I don't see any reason that it needs to be, and when I was using my own code I often set nu=0 for testing and it didn't have any problems.

@kaselby
Copy link
Contributor Author

kaselby commented Feb 17, 2018

(I should clarify this is referring to the NormalGamma distribution)

@mschauer
Copy link
Member

Hm, with nu = 0, this is not a proper distribution and one cannot sample anymore from it, compare

mu = rand(Normal(d.mu, sqrt(1./(tau2*d.nu))))
The originating package Distribution.jl in general only supports proper distributions. As priors, improper distributions still make sense. What to do?

@sourish-cmi
Copy link

If you choose nu=0 the marginal prior distribution for location parameter for the Normal Gamma model would be Cauchy distribution. This is a proper distribution for which mean and variance do not exist. However, because prior is a proper distribution, the posterior distribution turns out to be just fine. That is why even if you use nu=0 the simulation works fine. It is not an accident. You can look into Andrew Gelman's book. He gave a beautiful explanation about this (Chapter 2).

Ref: Bayesian Data Analysis (By Andrew Gelman and etal.) Second Ed.

https://www.amazon.in/Bayesian-Analysis-Chapman-Statistical-Science/dp/1439840954/ref=sr_1_1?crid=20GZF006GVZ5E&keywords=bayesian+data+analysis+gelman&qid=1642527457&sprefix=bayesian+data+analysis+ge%2Caps%2C345&sr=8-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants