Description Usage Arguments Value Author(s) Examples

Gives a simulated sample from the joint posterior distribution of the mean and variance for a normal sampling prior with a noninformative or informative prior. The prior assumes mu and sigma2 are independent with mu assigned a normal prior with mean mu0 and variance tau2, and sigma2 is assigned a inverse gamma prior with parameters a and b.

1 | ```
normpostsim(data,prior=NULL,m=1000)
``` |

`data` |
vector of observations |

`prior` |
list with components mu, a vector with the prior mean and variance, and sigma2, a vector of the inverse gamma parameters |

`m` |
number of simulations desired |

`mu` |
vector of simulated draws of normal mean |

`sigma2` |
vector of simulated draws of normal variance |

Jim Albert

1 2 | ```
data(darwin)
s=normpostsim(darwin$difference)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.