This function can be used in the family
argument of create_sampler
or generate_data
to specify a Gaussian sampling distribution.
f_gaussian(
link = "identity",
var.prior = pr_invchisq(df = 0, scale = 1),
var.vec = ~1,
prec.mat = NULL,
var.model = NULL,
logJacobian = NULL
)
A family object.
the name of a link function. Currently the only allowed link functions
for the Gaussian distribution is "identity"
.
prior for the variance parameter of a Gaussian sampling distribution.
This can be specified by a call to one of the prior specification functions
pr_invchisq
, pr_exp
, pr_gig
or pr_fixed
for
inverse chi-squared, exponential, generalised inverse gaussian or degenerate prior distribution,
respectively. The default is an improper prior pr_invchisq(df=0, scale=1)
. A half-t prior on the
standard deviation can be specified using pr_invchisq
with a chi-squared distributed scale
parameter.
a formula to specify unequal variances, i.e. heteroscedasticity. The default corresponds to equal variances.
a possibly non-diagonal positive-definite symmetric matrix
interpreted as the precision matrix, i.e. inverse of the covariance matrix.
If this argument is specified var.vec
is ignored.
a formula specifying the terms of a variance model in the case of a Gaussian likelihood.
Several types of terms are supported: a regression term for the log-variance
specified with vreg(...)
, and a term vfac(...)
for multiplicative modelled factors
at a certain level specified by a factor variable. By using unit-level inverse-chi-squared factors the marginal
sampling distribution becomes a Student-t distribution, and by using unit-level exponential factors it becomes
a Laplace or double exponential distribution. In addition, reg
and gen
can be used to specify regression or random effect terms. In that case the prior distribution
of the coefficients is not exactly normal, but instead Multivariate Log inverse Gamma (MLiG),
see also pr_MLiG
.
if the data are transformed the logarithm of the Jacobian can be supplied so that it
is incorporated in all log-likelihood computations. This can be useful for comparing information criteria
for different transformations. It should be supplied as a vector of the same size as the response variable,
and is currently only supported if family="gaussian"
.
For example, when a log-transformation is used on response vector y
, the vector -log(y)
should be supplied.