Last active
April 28, 2018 06:15
-
-
Save aburkard/b0f26d3995d22916cbeedb4043d34872 to your computer and use it in GitHub Desktop.
Sampling Inverse-Chi-squared distribution in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v <- 7 | |
scale <- 5 | |
set.seed(5) | |
plot(density(rinvgamma(100000, shape=v/2, scale=v/2*scale))) | |
set.seed(5) | |
plot(density(v*scale/rchisq(100000, df=v))) | |
require(geoR) | |
set.seed(5) | |
plot(density(rinvchisq(100000, df=v, scale=scale))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment