Learn R Programming

A R package for functional data analysis using the square root velocity framework which performs pair-wise and group-wise alignment as well as modeling using functional component analysis

Installation

v2.4.0 is on CRAN and can be installed as

install.packages("fdasrvf")`

For a more up to date, but may not be stable version from git repository.

  1. Download zip or tar.gz of package or clone repository
  2. Install into R (> 4.3.0)
library(devtools)
install_github("jdtuck/fdasrvf_R")

Example

The package contains simu dataset that is handy to experiment with the available functions for functions in $\mathbb{R}^1$.

We first visualize this dataset:

For that we first turn on class of functions present in the f for visualization:

library(fdasrvf)

f_plot(simu_data$time, simu_data$f)

We can see that each curve is a functionally closed 2D curve. And we distinguish different patterns of miss-alignment, like X values shrinking, small displacement, and many others.

We will now proceed with curve alignment for the curves of this class 1:

obj <- time_warping(simu_data$f, simu_data$time)
#> ℹ Using lambda = 0
#> ℹ Initializing...
#> ℹ Computing Karcher mean of 21 functions in SRSF space...
#> ℹ Entering iteration 1...

Let’s plot the result

plot(obj)

References

Tucker, J. D. 2014, Functional Component Analysis and Regression using Elastic Methods. Ph.D. Thesis, Florida State University.

Robinson, D. T. 2012, Function Data Analysis and Partial Shape Matching in the Square Root Velocity Framework. Ph.D. Thesis, Florida State University.

Huang, W. 2014, Optimization Algorithms on Riemannian Manifolds with Applications. Ph.D. Thesis, Florida State University.

Srivastava, A., Wu, W., Kurtek, S., Klassen, E. and Marron, J. S. (2011). Registration of Functional Data Using Fisher-Rao Metric. arXiv:1103.3817v2.

Tucker, J. D., Wu, W. and Srivastava, A. (2013). Generative models for functional data using phase and amplitude separation. Computational Statistics and Data Analysis 61, 50-66.

J. D. Tucker, W. Wu, and A. Srivastava, “Phase-Amplitude Separation of Proteomics Data Using Extended Fisher-Rao Metric,” Electronic Journal of Statistics, Vol 8, no. 2. pp 1724-1733, 2014.

J. D. Tucker, W. Wu, and A. Srivastava, “Analysis of signals under compositional noise With applications to SONAR data,” IEEE Journal of Oceanic Engineering, Vol 29, no. 2. pp 318-330, Apr 2014.

Srivastava, A., Klassen, E., Joshi, S., Jermyn, I., (2011). Shape analysis of elastic curves in euclidean spaces. Pattern Analysis and Machine Intelligence, IEEE Transactions on 33 (7), 1415-1428.

S. Kurtek, A. Srivastava, and W. Wu. Signal estimation under random time-warpings and nonlinear signal alignment. In Proceedings of Neural Information Processing Systems (NIPS), 2011.

Kurtek, S., Srivastava, A., Klassen, E., and Ding, Z. (2012), “Statistical Modeling of Curves Using Shapes and Related Features,” Journal of the American Statistical Association, 107, 1152–1165.

Wen Huang, Kyle A. Gallivan, Anuj Srivastava, Pierre-Antoine Absil. “Riemannian Optimization for Elastic Shape Analysis”, Short version, The 21st International Symposium on Mathematical Theory of Networks and Systems (MTNS 2014).

Cheng, W., Dryden, I. L., and Huang, X. (2016). Bayesian registration of functions and curves. Bayesian Analysis, 11(2), 447-475.

W. Xie, S. Kurtek, K. Bharath, and Y. Sun, A geometric approach to visualization of variability in functional data, Journal of American Statistical Association 112 (2017), pp. 979-993.

Lu, Y., R. Herbei, and S. Kurtek, 2017: Bayesian registration of functions with a Gaussian process prior. Journal of Computational and Graphical Statistics, 26, no. 4, 894–904.

Lee, S. and S. Jung, 2017: Combined analysis of amplitude and phase variations in functional data. arXiv:1603.01775, 1–21.

J. D. Tucker, J. R. Lewis, and A. Srivastava, “Elastic Functional Principal Component Regression,” Statistical Analysis and Data Mining, vol. 12, no. 2, pp. 101-115, 2019.

J. D. Tucker, J. R. Lewis, C. King, and S. Kurtek, “A Geometric Approach for Computing Tolerance Bounds for Elastic Functional Data,” Journal of Applied Statistics, 10.1080/02664763.2019.1645818, 2019.

T. Harris, J. D. Tucker, B. Li, and L. Shand, “Elastic depths for detecting shape anomalies in functional data,” Technometrics, 10.1080/00401706.2020.1811156, 2020.

Q. Xie, S. Kurtek, E. Klassen, G. E. Christensen and A. Srivastava. Metric-based pairwise and multiple image registration. IEEE European Conference on Computer Vision (ECCV), September, 2014

X. Zhang, S. Kurtek, O. Chkrebtii, and J. D. Tucker, “Elastic kkk-means clustering of functional data for posterior exploration, with an application to inference on acute respiratory infection dynamics”, arXiv:2011.12397 [stat.ME], 2020 arxiv

J. D. Tucker and D. Yarger, “Elastic Functional Changepoint Detection of Climate Impacts from Localized Sources”, Envirometrics, 10.1002/env.2826, 2023.

Copy Link

Version

Install

install.packages('fdasrvf')

Monthly Downloads

638

Version

2.4.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

J Derek Tucker

Last Published

June 27th, 2025

Functions in fdasrvf (2.4.0)

curve_depth

Calculates elastic depth for a set of curves
discrete2curve

Converts a curve from matrix to functional data object
curve2srvf

Converts a curve to its SRVF representation
curve_boxplot

Curve Boxplot
curve_to_q

Curve to SRVF Space
elastic.depth

Calculates elastic depth
elastic.mlogistic

Elastic Multinomial Logistic Regression
get_l2_inner_product

Computes the \(L^2\) inner product between two SRVFs
elastic.prediction

Elastic Prediction from Regression Models
gam_to_psi

map warping function to Hilbert Sphere
get_l2_norm

Computes the \(L^2\) norm of an SRVF
f_plot

Plot functional data
elastic_change_fpca

Elastic Changepoint Detection
elastic_ph_change_ff

Elastic Phase Changepoint Detection
gam_to_v

map warping function to tangent space at identity
curve_pair_align

Pairwise align two curves
elastic.pcr.regression

Elastic Linear Principal Component Regression
f_to_srvf

Transformation to SRVF Space
elastic.regression

Elastic Linear Regression
gauss_model

Gaussian model of functional data
im

Example Image Data set
curve_dist

Distance Matrix Computation
elastic_amp_change_ff

Elastic Amplitude Changepoint Detection
elastic.logistic

Elastic Logistic Regression
elastic.lpcr.regression

Elastic logistic Principal Component Regression
fdasrvf

Elastic Functional Data Analysis
function_group_warp_bayes

Bayesian Group Warping
h_to_gam

map shooting vector to warping function at identity
get_curve_centroid

Computes the centroid of a curve
get_warping_distance

Computes the distance between two warping functions
get_shape_distance

Computes the distance between two shapes
horizFPCA

Horizontal Functional Principal Component Analysis
get_hilbert_sphere_distance

Computes the geodesic distance between two SRVFs on the Hilbert sphere
get_distance_matrix

Computes the distance matrix between a set of shapes.
inv_exp_map

map square root of warping function to tangent space
elastic.mlpcr.regression

Elastic Multinomial logistic Principal Component Regression
joint_gauss_model

Gaussian model of functional data using joint Model
gradient

Gradient using finite differences
jointFPCAh

Joint Vertical and Horizontal Functional Principal Component Analysis
multivariate_pca

Curve PCA
gam_to_h

map warping function to tangent space at identity
growth_vel

Berkeley Growth Velocity Dataset
elastic.distance

Calculates two elastic distance
plot_curve

Plot Curve
optimum.reparam

Align two functions
pcaTB

Tolerance Bound Calculation using Elastic Functional PCA
invertGamma

Invert Warping Function
multivariate_karcher_mean

Karcher Mean of Multivariate Functional Data
jointFPCA

Joint Vertical and Horizontal Functional Principal Component Analysis
function_mean_bayes

Bayesian Karcher Mean Calculation
pair_align_functions_bayes

Align two functions
resamplecurve

Resample Curve
predict.curve_pca

Elastic Prediction for curve PCA
time_warping

Alignment of univariate functional data
reparam_image

Find optimum reparameterization between two images
pair_align_functions_expomap

Align two functions using geometric properties of warping functions
outlier.detection

Outlier Detection
pair_align_functions

Align two functions
multiple_align_multivariate

Group-wise multivariate function alignment to specified mean
predict.hfpca

Elastic Prediction for functional PCA
multivariate_karcher_cov

Curve Karcher Covariance
get_l2_distance

Computes the \(L^2\) distance between two SRVFs
toy_data

Distributed Gaussian Peak Dataset
get_identity_warping

Computes the identity warping function
toy_warp

Aligned Distributed Gaussian Peak Dataset
predict.jfpcah

Elastic Prediction for functional PCA
predict.lpcr

Elastic Prediction for functional logistic PCR Model
simu_data

Simulated two Gaussian Dataset
predict.pcr

Elastic Prediction for functional PCR Model
predict.jfpca

Elastic Prediction for functional PCA
predict.mlpcr

Elastic Prediction for functional multinomial logistic PCR Model
simu_warp_median

Aligned Simulated two Gaussian Dataset using Median
predict.vfpca

Elastic Prediction for functional PCA
warp_srvf

Applies a warping function to a given SRVF
phbox_data

Phase Boxplot Data
psi_to_gam

map Hilbert sphere to warping function
simu_warp

Aligned Simulated two Gaussian Dataset
to_hilbert_sphere

Projects an SRVF onto the Hilbert sphere
rotation_pca

Rotation Principal Component Analysis
srvf2curve

Converts from SRVF to curve representation
multiple_align_functions

Group-wise function alignment to specified mean
kmeans_align

K-Means Clustering and Alignment
warp_curve

Applies a warping function to a given curve
srvf_to_f

Transformation from SRSF Space
v_to_curve

map shooting vector to curve at mean
vertFPCA

Vertical Functional Principal Component Analysis
rgam

Random Warping
warp_f_gamma

Warp Function
v_to_gam

map shooting vector to warping function at identity
warp_q_gamma

Warp SRSF
smooth.data

Smooth Functions
shape_CI

Shape Confidence Interval Calculation using Bootstrap Sampling
q_to_curve

Convert to curve space
reparam_curve

Align two curves
pair_align_image

Pairwise align two images This function aligns to images using the q-map framework
sample_shapes

Sample shapes from model
bootTB

Tolerance Bound Calculation using Bootstrap Sampling
boxplot.fdawarp

Functional Boxplot
LongRunCovMatrix

Long Run Covariance Matrix Estimation for Multivariate Time Series
discrete2warping

Converts a warping function from vector to functional data object
calc_shape_dist

Elastic Shape Distance
beta

MPEG7 Curve Dataset
align_fPCA

Group-wise function alignment and PCA Extractions
SqrtMedian

SRVF transform of warping functions
curve_geodesic

Form geodesic between two curves
SqrtMeanInverse

SRVF transform of warping functions
ampbox_data

Amplitude Boxplot Data
SqrtMean

SRVF transform of warping functions
curvebox_data

Curve Boxplot Data