Skip to contents

Evaluates how well the estimated group anchor template (`object$T_anchor_final` from a `hatsa_projector` object) matches the true spectral basis at the anchor locations.

Usage

compute_anchor_template_recovery(
  hatsa_object,
  U_true,
  anchor_indices_true,
  ...
)

Arguments

hatsa_object

A fitted `hatsa_projector` object.

U_true

The ground-truth spectral basis (matrix, Vp x k) for all parcels.

anchor_indices_true

A numeric vector of indices specifying which rows of `U_true` correspond to the anchor parcels.

...

Additional arguments passed to `vegan::procrustes`.

Value

A list containing:

correlation

Pearson correlation between the vectorized aligned estimated anchor template and the vectorized true anchor template.

frobenius_norm_diff

Frobenius norm of the difference between the aligned estimated anchor template and the true anchor template.

procrustes_result

The result of the `vegan::procrustes` call.

T_anchor_aligned

The Procrustes-aligned estimated anchor template.

Examples

# See core-hatsa-toy-example.Rmd for usage.