Skip to contents

Transform observations to metric-preserving coordinates at a fixed reference. Prediction applies the training reference and coordinate axes to new data. Reconstruction maps coordinates back into the trained geometry.

Usage

riem.tangent(
  riemobj,
  geometry = NULL,
  reference = NULL,
  weight = NULL,
  maxiter = 200L,
  eps = 1e-08
)

# S3 method for class 'riem_tangent'
predict(object, newdata, ...)

# S3 method for class 'riem_tangent'
riem.reconstruct(object, scores = object$embed, ...)

Arguments

riemobj

Wrapped manifold observations.

geometry

A name or saved specification with tangent support in riem.capabilities.

reference

A compatible, single-observation riemdata object. By default the reference is the fitted training mean.

weight

Optional nonnegative weights for estimating the reference mean.

maxiter, eps

Iteration budget and tolerance for the reference mean.

object

An object returned by riem.tangent.

newdata

Compatible wrapped observations to encode.

...

Additional arguments, currently unused.

scores

A finite matrix with a row per observation and one column per trained axis. Named columns must be in training order. A vector denotes one observation, or multiple observations in a one-dimensional chart.

Value

A riem_tangent fit with training coordinates in embed, a reference in center, the fitted geometry and its coordinate specification. Prediction returns a numeric matrix. Reconstruction returns wrapped observations and rejects coordinates outside the supported chart.

Details

Coordinates preserve the tangent norm at the reference. Pairwise Euclidean distances between coordinates need not equal distances between observations on a curved manifold. Landmark coordinates use an ambient matrix representation subject to centering, tangency and horizontality.

Examples

x <- wrap.spd(list(diag(c(1, 2)), diag(c(4, 3))))
chart <- riem.tangent(x, geometry = "log_euclidean")
z <- predict(chart, wrap.spd(list(diag(c(2, 5)))))
riem.reconstruct(chart, z)
#> 1 spd observations; representation 2 x 2 
#> Geometry: log_euclidean on spd 
#> Representation: 2 x 2 ; intrinsic dimension: 3 
#> Validation: core_contract