normal-distribution-methods | R Documentation |
SWoodburyMatrix
objectsDraw samples and compute density functions for the multivariate normal
distribution with an SWoodburyMatrix
object as its covariance matrix.
dwnorm(x, mean, covariance, log = FALSE)
rwnorm(n, mean, covariance)
x |
A numeric vector or matrix. |
mean |
Optional mean vector; defaults to zero mean. |
covariance |
|
log |
Logical indicating whether to return log of density. |
n |
Number of samples to return. If |
dwnorm
: Compute the density of the
distribution
rwnorm
: Draw samples from the distribution
WoodburyMatrix
library(Matrix)
# Trivial example with diagonal covariance matrices
W <- WoodburyMatrix(Diagonal(10), Diagonal(10))
x <- rwnorm(10, covariance = W)
print(dwnorm(x, covariance = W, log = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.