Description Usage Arguments Details Value Examples
Defining a wrapper object class wm_model
that can represent
Wishart, Normalised Wishart, Inverse Wishart, and Normalised Inverse Wishart
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | wm_model(type, V = NULL, df = NULL, V_chol = NULL, lower_chol = FALSE)
wm_latent(model, W = NULL, W_chol = NULL, lower_chol = NULL, ...)
wm_chol(model, latent, lower_chol = NULL, ...)
wm_matrix(model, latent, ...)
wm_matrix_jacobian(model, latent, symmetric = TRUE, h = 1e-04, ...)
wm_chol_jacobian(
model,
latent,
symmetric = TRUE,
h = 1e-04,
lower_chol = NULL,
...
)
wm_moments_linear(
model,
mean_latent = rep(0, model$N_latent),
cov_latent = sparse_identity(model$N_latent),
order = c(2, 1),
h = 1e-04,
...
)
wm_density(
model,
latent = NULL,
W = NULL,
W_chol = NULL,
lower_chol = NULL,
log = FALSE
)
|
type |
Either |
V |
The matrix parameter for the distribution |
df |
The degrees-of-freedom parameter for the distribution |
V_chol |
The Cholesky factor of |
lower_chol |
logical; For |
model |
A |
W |
A symmetric matrix valid for the value space of the |
W_chol |
The Cholesky factor of a matrix valid for the value space of
the |
... |
Further parameters passed on to other methods |
latent |
A numeric vector of length |
symmetric |
logical; If |
h |
positive delta for finite differences |
mean_latent |
Expectation vector for the latent variables |
cov_latent |
Covariance matrix for the latent variables |
order |
A vector of two integers defining the Taylor expansion orders
used for linearised moment calculations for expectation and variance,
respectively. Can be either 1 or 2. Default: |
log |
If |
For wm_moments_linear
, the further ...
parameters are passed
on to wm_matrix_jacobian
.
The wm_density()
method requires the CholWishart::lmvgamma
function from the CholWishart
package.
wm_model()
returns a wm_model
object that encapsulates the
parameters of one of the four Wishart model types, as defined by type
.
wm_latent()
returns the latent variables for the representation
of a (W/NW/IW/NIW) matrix, given either the matrix itself in W
, or its
Cholesky factor in W_chol
.
wm_chol()
returns the Cholesky factor of a (W/NW/IW/NIW) matrix.
wm_matrix()
returns a (W/NW/IW/NIW) matrix.
wm_matrix_jacobian()
returns the Jacobian for the
(column-)vectorised (see cvec()
) matrix with respect to the latent
variables.
wm_chol_jacobian()
returns the Jacobian for the
column-vectorised (see cvec()
) Cholesky matrix with respect to the
latent variables, with type determined by the lower_chol
setting.
wm_moments_linear()
returns linearised approximations of propagated
mean and standard deviation of the Wishart matrix given mean and covariance
of the latent variables.
wm_density()
returns the density or log-density (if log == TRUE
)
for W
, or the W
matrix constructed from a Cholesky factor W_chol
1 2 3 4 5 6 | ## Not run:
if (interactive()) {
# EXAMPLE1
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.