rwish: Generate random sample from Wishart (faster).

Description Usage Arguments Value Wishart parametrization References See Also

View source: R/RcppExports.R

Description

Same code as rWishart function in package stats.

Usage

1
rwish(v, S, is_chol = FALSE, return_chol = FALSE)

Arguments

v

dof

S

the scale matrix (pxp)

is_chol

if TRUE, S is the upper Cholesky factor of S

return_chol

if TRUE, the upper Cholesky factor is returned

Value

a single random variate from W(v, S)

Wishart parametrization

Uses \insertCitePress2012Applied,Anderson2003introductionbayessource parametrization.

X ~ W(v, S)

with S is a pxp matrix, v >= p (the degrees of freedom).

Then:

E[X] = v * S

References

\insertAllCited

See Also

Other C++ functions: chol2inv(), diwishart_inverse(), dmvnorm(), inv_Cholesky_from_Cholesky(), inv_sympd_tol(), inv_triangular(), isCholeskyOn(), ldet_from_Cholesky(), logCummeanExp(), logCumsumExp(), logSumExpMean(), logSumExp(), marginalLikelihood_internal(), rmvnorm()

Other statistical functions: diwishart_inverse_R(), diwishart_inverse(), diwishart(), dmvnorm(), dwishart(), riwish_Press(), rmvnorm()

Other Wishart functions: diwishart_inverse_R(), diwishart_inverse(), diwishart(), dwishart(), get_minimum_nw_IW(), riwish_Press()


lgaborini/bayessource documentation built on Nov. 9, 2021, 2:10 p.m.