CSample | R Documentation |
This class represents a sample of connectomes, with various properties and methods to handle their tangent and vectorized images.
connectomes
Connectomes data
tangent_images
Tangent images data
vector_images
Vector images data
sample_size
Sample size
matrix_size
Matrix size
mfd_dim
Manifold dimension
is_centered
Centering status
frechet_mean
Frechet mean
riem_metric
Riemannian Metric used
variation
Variation of the sample
sample_cov
Sample covariance
ref_point
Reference point for tangent or vectorized images
new()
Initialize a CSample object
CSample$new( conns = NULL, tan_imgs = NULL, vec_imgs = NULL, centered = NULL, ref_pt = NULL, metric_obj )
conns
A list of connectomes (default is NULL).
tan_imgs
A list of tangent images (default is NULL).
vec_imgs
A matrix whose rows are vectorized images (default is NULL).
centered
Boolean indicating whether tangent or vectorized images are centered (default is NULL).
ref_pt
A connectome (default is identity)
metric_obj
Object of class rmetric
representing the Riemannian metric used.
A new CSample
object.
compute_tangents()
This function computes the tangent images from the connectomes.
CSample$compute_tangents(ref_pt = default_ref_pt(private$p))
ref_pt
A reference point, which must be a dppMatrix
object (default is default_ref_pt
).
Error if ref_pt
is not a dppMatrix
object or if conns
is not specified.
None
compute_conns()
This function computes the connectomes from the tangent images.
CSample$compute_conns()
Error if tangent images are not specified.
None
compute_vecs()
This function computes the vectorized tangent images from the tangent images.
CSample$compute_vecs()
Error if tangent images are not specified.
None
compute_unvecs()
This function computes the tangent images from the vector images.
CSample$compute_unvecs()
Error if vec_imgs
is not specified.
None
compute_fmean()
This function computes the Frechet mean of the sample.
CSample$compute_fmean(tol = 0.05, max_iter = 20, lr = 0.2)
tol
Tolerance for the convergence of the mean (default is 0.05).
max_iter
Maximum number of iterations for the computation (default is 20).
lr
Learning rate for the optimization algorithm (default is 0.2).
None
change_ref_pt()
This function changes the reference point for the tangent images.
CSample$change_ref_pt(new_ref_pt)
new_ref_pt
A new reference point, which must be a dppMatrix
object.
Error if tangent images have not been computed or if new_ref_pt
is not a dppMatrix
object.
None
center()
Center the sample
CSample$center()
This function centers the sample by computing the Frechet mean if it is not already computed, and then changing the reference point to the computed Frechet mean. Error if tangent images are not specified. Error if the sample is already centered.
None. This function is called for its side effects.
compute_variation()
Compute Variation
CSample$compute_variation()
This function computes the variation of the sample. It first checks if the vector images are null, and if so, it computes the vectors, computing first the tangent images if necessary. If the sample is not centered, it centers the sample and recomputes the vectors. Finally, it calculates the variation as the mean of the sum of squares of the vector images. Error if vec_imgs
is not specified.
None. This function is called for its side effects.
compute_sample_cov()
Compute Sample Covariance
CSample$compute_sample_cov()
This function computes the sample covariance matrix for the vector images. It first checks if the vector images are null, and if so, it computes the vectors, computing first the tangent images if necessary.
None. This function is called for its side effects.
clone()
The objects of this class are cloneable with this method.
CSample$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.