Description Usage Arguments Author(s) References See Also Examples
View source: R/triplot.normal.knownvariance.R
The function draws a normal prior distribution, the data and the posterior distribution in one plot. It serves as a tool to explore the influence of different prior on a hypotehtical set of normally distributed data
1 2 |
theta.data |
mean of the data |
variance.known |
known variance |
n |
sample size |
prior.theta |
mean of the prior distribution |
prior.variance |
variance of the prior distribution |
legend |
logical, if TRUE (default) a legend is drawn |
ylim |
ylim of the plot |
legend.bty |
box type of legend |
Fraenzi Korner-Nievergelt
Gelman, A., J. B. Carlin, H. S. Stern and D. B. Rubin (2004). Bayesian Data Analysis. New York, Chapman & Hall/CRC.
1 2 | triplot.normal.knownvariance(theta.data=10, n=20, variance.known=5,
prior.theta=0, prior.variance=100)
|
Loading required package: MASS
$posterior.mean
[1] 10.09056
$posterior.variance
[1] 0.2493766
$x
[1] 11.675145 12.282391 5.546180 9.833044 8.890659 12.334810 10.554547
[8] 8.587080 12.158208 9.184877 10.735868 12.354362 8.972543 8.560952
[15] 6.368376 9.012413 10.348796 9.813664 9.403156 15.698559
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.