dwishart_cpp | R Documentation |
The function dwishart()
computes the density of a Wishart distribution.
The function rwishart()
samples from a Wishart distribution.
The functions with suffix _cpp
perform no input checks, hence are faster.
dwishart_cpp(x, df, scale, log = FALSE, inv = FALSE)
rwishart_cpp(df, scale, inv = FALSE)
dwishart(x, df, scale, log = FALSE, inv = FALSE)
rwishart(df, scale, inv = FALSE)
x |
[ |
df |
[ |
scale |
[ |
log |
[ |
inv |
[ |
For dwishart()
: The density value.
For rwishart()
: A matrix
, the random draw.
Other simulation helpers:
correlated_regressors()
,
ddirichlet_cpp()
,
dmvnorm_cpp()
,
dtnorm_cpp()
,
simulate_markov_chain()
x <- diag(2)
df <- 4
scale <- diag(2)
# compute density
dwishart(x = x, df = df, scale = scale)
dwishart(x = x, df = df, scale = scale, log = TRUE)
dwishart(x = x, df = df, scale = scale, inv = TRUE)
# sample
rwishart(df = df, scale = scale)
rwishart(df = df, scale = scale, inv = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.