View source: R/computePosterior.R
computePosterior | R Documentation |
Computes the posterior mean and variance of the normal location problem with
fixed variance to 1, i.e. x | \gamma \sim N(\gamma, 1)
.
The priors for \gamma
are either weibull
,
subbotin
or laplace
. Their properties
are briefly discussed in \insertCitemagnus2016wals;textualWALS.
Default method of computePosterior uses numerical integration. This is used
for the weibull
and subbotin
priors.
For the laplace
prior closed form expressions exist for the integrals.
In the original MATLAB code, the Gauss-Kronrod quadrature was used for
numerical integration. Here we use the default integrate
which
combines Gauss-Kronrod with Wynn's Epsilon algorithm for extrapolation.
computePosterior(object, ...)
## S3 method for class 'familyPrior'
computePosterior(object, x, ...)
## S3 method for class 'familyPrior_laplace'
computePosterior(object, x, ...)
object |
Object of class |
... |
Further arguments passed to methods. |
x |
vector. Observed values, i.e. in WALS these are the regression
coefficients of the transformed regressor Z2 standardized by the standard
deviation: |
See section "Numerical integration in Bayesian estimation step" in the appendix of \insertCitehuynhwals;textualWALS for details.
computePosterior.familyPrior_laplace()
is the specialized method for the
S3 class "familyPrior_laplace"
and computes the posterior
first and second moments of the normal location problem with a Laplace prior
using the analytical formula (without numerical integration).
For more details, see \insertCitedeluca2020laplace;textualWALS and the
original code of Magnus and De Luca.
Original MATLAB code on Jan Magnus' website. https://www.janmagnus.nl/items/WALS.pdf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.