Description Usage Arguments Details Value See Also
Conditioning on a set of order statistics under a Guassian location and scale model. The full model is:
μ\sim N(η, τ^2), σ^2 \sim IG(α, β), y_i~N(μ, σ^2)
Conditioning is on a middle set of order statistics (Y_{(k+1)}, … Y_{(n-k)}). That is, the likelihood used in the Bayesian update is the likelihood of these order statistics. When k=0, the model is the full normal theory model written above.
1 2 3 4 5 6 7 8 9 10 11 12 | fitOrderStat(
y,
k,
mu_lims,
length_mu,
sigma2_lims,
length_sigma2,
eta,
tau,
alpha,
beta
)
|
y |
vector of data |
k |
numeric: choice of k determining the set of order statistics on which to condition. |
mu_lims, sigma2_lims |
vectors of length 2 specifying the lower and upper limits for the numerical integration. Should span region of non-negligble posterior probability, otherwise the posterior will be incorrect |
length_mu, length_sigma2 |
Number of grid points for each parameter used in the numerical integration |
eta, tau |
mean and standard deviation of the normal prior distribution on μ |
alpha, beta |
prior shape and scale of inverse gamma prior on σ^2 |
Fit is done a grid of μ and σ^2 using Riemann sum numerical integration to find the marginal distribution of the data. This is rather naive but is relatively quick - it only works well if the choice of grid on which the Riemann sum is done is chosen carefully. The grid is specified by mu_lims
, sigma2_lims
, length_mu
, and length_sigma2
. The grid should cover the region of non-negligble posterior mass. The number of grid points (length_mu
/length_sigma2
) etast be large enough for good precision. However, larger values increase computation time.
A list of length 4: the joint posterior, the two marginals, and the posterior means
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.