rspdnorm {riemtan} | R Documentation |
Generate Random Samples from a Riemannian Normal Distribution
Description
Simulates random samples from a Riemannian normal distribution on symmetric positive definite matrices.
Usage
rspdnorm(n, refpt, disp, met)
Arguments
n |
Number of samples to generate. |
refpt |
Reference point on the manifold, represented as a symmetric positive definite matrix. Must be an object of class |
disp |
Dispersion matrix defining the spread of the distribution. Must be an object of class |
met |
A metric object of class |
Value
An object of class CSample
containing the generated samples.
Examples
if (requireNamespace("Matrix", quietly = TRUE)) {
library(Matrix)
data(airm)
refpt <- diag(2) |>
Matrix::nearPD() |>
_$mat |>
Matrix::pack()
disp <- diag(3) |>
Matrix::nearPD() |>
_$mat |>
Matrix::pack()
rspdnorm(10, refpt, disp, airm)
}
[Package riemtan version 0.1.0 Index]