Description Usage Arguments Value Examples
View source: R/conjugatepriors.R
Iterative Gaussian Conjugate Prior It iterates over the data and calls the function unigausscp for each point, setting the new prior as the posterior from the last data point.
1 | unigausscpiterative(data, priormean, priorvar, datavar = NULL, n)
|
data |
data for analysis |
priormean |
- intial prior mean |
priorvar |
initial prior variance, if inverse gamma is desired this is the initial V0 parameter of the |
datavar |
a vector of the variance for each data point |
n |
a vector of sample sizes |
A list with the following elements: finalpostmean: a scalar of the final mean of the posterior, finalpostvar: the final posterior variance, finalpostsd: the final posterior standard deviation, dataweights: a vector of the weight of the data in the posterior, postmeans: a vector of the posterior means for each data point, postvar: a vector of the posterior variance for each data point, postsds: a vector of the posterior standard deviations for each data point, posta: a vector of the posterior values of a if invgamma = T, and postb: a vector of the posterior values of b in invgamma = T.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.