Simulates random samples from a Riemannian normal distribution on symmetric positive definite matrices.
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
dppMatrixfrom the Matrix package.- disp
Dispersion matrix defining the spread of the distribution. Must be an object of class
dppMatrixfrom the Matrix package.- met
A metric object of class
rmetric.
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)
}
#> <CSample>
#> Public:
#> batch_size: active binding
#> center: function ()
#> change_ref_pt: function (new_ref_pt, progress = FALSE)
#> clone: function (deep = FALSE)
#> compute_conns: function (progress = FALSE)
#> compute_dists: function ()
#> compute_fmean: function (tol = 0.001, max_iter = 100, lr = 0.2, batch_size = NULL,
#> compute_sample_cov: function ()
#> compute_tangents: function (ref_pt = default_ref_pt(private$p), progress = FALSE)
#> compute_unvecs: function (progress = FALSE)
#> compute_variation: function ()
#> compute_vecs: function (progress = FALSE)
#> connectomes: active binding
#> distances: active binding
#> frechet_mean: active binding
#> initialize: function (conns = NULL, tan_imgs = NULL, vec_imgs = NULL, centered = NULL,
#> is_centered: active binding
#> load_connectomes_batched: function (indices = NULL, batch_size = 50, progress = FALSE)
#> matrix_size: active binding
#> mfd_dim: active binding
#> ref_point: active binding
#> riem_metric: active binding
#> sample_cov: active binding
#> sample_size: active binding
#> tangent_images: active binding
#> variation: active binding
#> vector_images: active binding
#> Private:
#> ._batch_size: NULL
#> backend: NULL
#> centered: FALSE
#> conns: NULL
#> d: 3
#> dists: NULL
#> f_mean: NULL
#> metric_obj: rmetric
#> n: 10
#> p: 2
#> s_cov: NULL
#> tangent_handler: TangentImageHandler, R6
#> var: NULL
#> vec_imgs: -0.665088248545505 1.11395241896922 -0.245896411679153 - ...