credible intervals

I am trying to find the prior for 95% credible intervals which follow Ga(10,1). Can i please check my code is correct please?

qgamma(0.025, 10, 1)
qgamma(0.975, 10, 1) 

I do not understand what you mean by "the prior for 95% credible intervals". I do think you can determine the 95% credible interval from the values returned by your two functions. Take a look at the plot below You might also confirm your understanding of the "q" functions by inspecting the values returned by the qnorm() function since you may be more familiar with the standard normal distribution

qgamma(0.025, 10, 1)
#> [1] 4.795389
qgamma(0.975, 10, 1)
#> [1] 17.0848
plot(seq(0, 25, 0.1), dgamma(seq(0,25,0.1), 10,1), type = "l")
lines(c(4.795, 17.0848), c(0,0), col = "red", lwd = 2)

Created on 2020-02-11 by the reprex package (v0.2.1)

1 Like

Thanks for your reply! I am trying to apply Bayesian statistic to text messages which follow a gamma distribution and need to know the prior 95% credible intervals.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.