ElasticFDA.align_fPCAMethod

Aligns a collection of functions while extracting principal components. The functions are aligned to the principal components

align_fPCA(f, timet; num_comp=3, smooth=false, sparam=10, MaxItr=50)
:param f: array of shape (M,N) of N functions with M samples
:param timet: vector of size M describing the sample points
:param num_comp: Number of components (default = 3)
:param smooth: Smooth the data using a box filter (default = false)
:param sparam: Number of times to run smoothing filter (default 10)
:param MaxItr: Maximum number of iterations

Returns Dict containing
:return fn: aligned functions - array of shape (M,N) of N functions with M
            samples
:return qn: aligned srvfs - similar structure to fn
:return q0: original srvf - similar structure to fn
:return mqn: srvf mean or median - vector of length M
:return gam: warping functions - similar structure to fn
:return q_pca: srsf principal directions
:return f_pca: functional principal directions
:return latent: latent values
:return coef: coefficients
:return U: eigenvectors
:return orig_var: Original Variance of Functions
:return amp_var: Amplitude Variance
:return phase_var: Phase Variance
ElasticFDA.bsFunction

Compute B-Spline basis bs(x, df, norder, nderiv=0) :param x: time samples :param df: degree of freedom :param norder: order of splines :param nderiv: derivative number

ElasticFDA.calc_shape_distMethod

Calculate elastic shape distance between two curves beta1 and beta2

calc_shape_dist(beta1, beta2)
:param beta1: array (n,T)
:param beta2: array (n,T)
:param method: optimization method to find warping, default is
               Dynamic Programming ("DP"). Other options are
               Coordinate Descent ("DP2"), Riemannian BFGS
               ("RBFGS")
:param wscale: with scale (false)
ElasticFDA.curve_geodesicFunction

Form geodesic between two curves

curve_geodesic(beta1::Array{Float64,2}, beta2::Array{Float64,2}, k::Integer=5)
:param beta1: array (n,T)
:param beta2: array (n,T)
:param k: number of curves along geodesic
:param wscale: with scale (false)

Returns
:return geod: curves along geodesic (n,T,k)
:return geod_q: srvf's along geodesic
ElasticFDA.curve_karcher_covMethod

Calculate Karcher Covariance of a set of curves

curve_karcher_cov(betamean, beta; mode='O')
:param betamean: array (n,T) of mean curve
:param beta: array (n,T,N) for N number of curves
:param mode: Open ('O') or Closed ('C') curves

:return K: covariance matrix
ElasticFDA.curve_karcher_meanMethod

Calculates Karcher mean of a collection of curves using the elastic square-root velocity (srvf) framework.

curve_karcher_mean(beta; mode='O', maxit=20)
:param beta: array (n,T,N) for N number of curves
:param mode: Open ('O') or Closed ('C') curves
:param maxit: maximum number of iterations
:param wscale: with scale (false)

:return mu: mean srvf
:return betamean: mean curve
:return v: shooting vectors
:return q: array of srvfs
ElasticFDA.curve_pair_alignMethod

Pairwise align two curves

curve_pair_align(beta1::Array{Float64,2}, beta2::Array{Float64,2})
:param beta1: array (n,T)
:param beta2: array (n,T)

Returns
:return beta2n: aligned curve 2 to 1
:return q2n: aligned srvf 2 to 1
:return gam: warping function
:return q1: srvf of curve 1
ElasticFDA.curve_principal_directionsMethod

Calculate principal directions of a set of curves

curve_principal_directions(betamean, mu, K; mode='O', no=3, N=5)
:param betamean: array (n,T) of mean curve
:param mu: array (n,T) of mean srvf
:param K: array (T,T) covariance matrix
:param mode: Open ('O') or Closed ('C') curve
:param no: number of components
:param N: number of samples on each side of mean

:return pd: array describing principal directions
ElasticFDA.curve_srvf_alignMethod

Aligns a collection of curves using the elastic square-root velocity (srvf) framework.

curve_srvf_align(beta; mode='O', maxit=20)

:param beta: array (n,T,N) for N number of curves
:param mode: Open ('O') or Closed ('C') curves
:param maxit: maximum number of iterations

:return betan: aligned curves
:return qn: aligned srvfs
:return betamean: mean curve
:return q_mu: mean srvf
ElasticFDA.curve_to_qFunction

Convert curve to square-root velocity function (srvf)

curve_to_q(beta)
:param beta: array describing curve (n,T)
ElasticFDA.elastic_distanceFunction

Calculate elastic distance between two functions

elastic_distance(f1::Vector, f2::Vector, timet::Vector,
                 method::AbstractString="SIMUL")
:param f1: vector of function 1 samples
:param f2: vector of function 2 samples
:param timet: vector of time samples
:param method: optimization method to find warping, default is
               Dynamic Programming ("DP"). Other options are
               Coordinate Descent ("DP2"), Riemannian BFGS
               ("RBFGS"), Simultaneous Alignment ("SIMUL")

:return da: amplitude distance
:return dp: phase distance
ElasticFDA.elastic_logisticMethod

Calculate elastic logistic regression from function data f, for response y

elastic_logistic(f, y, timet; B=None, df=20, max_itr=20, smooth=false)
:param f: array (M,N) of N functions
:param y: vector (N) of responses
:param timet: vector (N) describing time samples
:param B: matrix describing basis functions (M,N) (default=None generates a
          B-spline basis
:param df: degree of freedom of basis
:param max_itr: maximum number of iterations
:param smooth: smooth data

Returns Dict describing regression
:return alpha: intercept
:return beta: regression function
:return fn: aligned functions
:return qn: aligned srsfs
:return gamma: warping functions
:return q: original srsfs
:retrun B: basis functions
:return type: type of regressions
:return b: coefficients
:return LL: logistic loss
ElasticFDA.elastic_predictionMethod

Prediction from elastic regression model

elastic_prediction(f, timet, model; y=None, smooth=false)
:param f: functions to predict
:param timet: vector describing time samples
:param model: calculated model (regression, musicologist, mlogistic)
:param y: true response (default = None)
:param smooth: smooth data (default = false)

Returns
:return y_pred: predicted value
:return y_labels: labels of predicted value
:return Perf: Performance metric if truth is supplied
ElasticFDA.elastic_regressionMethod

Calculate elastic regression from function data f, for response y

elastic_regression(f, y, timet; B=None, lambda=0, df=20, max_itr=20,
                   smooth=false)
:param f: array (M,N) of N functions
:param y: vector (N) of responses
:param timet: vector (N) describing time samples
:param B: matrix describing basis functions (M,N) (default=None generates a
          B-spline basis
:param lambda: regularization parameter
:param df: degree of freedom of basis
:param max_itr: maximum number of iterations
:param smooth: smooth data

Returns Dict describing regression
:return alpha: intercept
:return beta: regression function
:return fn: aligned functions
:return qn: aligned srsfs
:return gamma: warping functions
:return q: original srsfs
:retrun B: basis functions
:return type: type of regressions
:return b: coefficients
:return SSE: sum of squared error
ElasticFDA.f_to_srsfFunction

Convert function to square-root slope function (srsf)

f_to_srsf(f::Array, timet=0, smooth=false)
:param f: array of shape (M,N) describing N functions of M samples
:param timet: vector describing time samples (default = 0) will generate
              linearly spaced time vector of length M
:param smooth: smooth data (default = false)
ElasticFDA.gauss_modelMethod

Computes random samples of functions from aligned data using Gaussian model

gauss_model(warp_data; n=1, sort_samples=false)
:param warp_data: fdawarp type from srsf_align of aligned data
:param n: number of samples
:param sort_samples: sort samples

Returns warp_data containing
:return fs: random aligned functions
:return gams: random warping functions
:return ft: random functions
ElasticFDA.gradientFunction

1-D Gradient

gradient(a::Array, dx::Float64=1)
:param f: Vector
:param dx: stepsize

:return g: gradient
ElasticFDA.group_warping_bayesMethod

Group alignment of functions using Bayesian method

group_warping_bayes(f; iter=20000, times=5, powera=1)
:param f: array (M,N) of N functions
:param iter: number of MCMC iterations
:param times: time slicing
:param powera: MCMC parameter

Returns Dict containing
:return f_q: registered srvfs
:return gam_q: warping function
:return f_a: registered functions
:return gam: warping functions
ElasticFDA.horiz_fPCAMethod

Calculates horizontal functional principal component analysis on aligned data

horiz_fPCA(warp_data; no=1)
:param warp_data: fdawarp type from srsf_align of aligned data
:param no: number of components to extract (default = 1)

Returns hfpca containing
:return gam_pca: warping principal directions
:return psi_pca: srsf functional principal directions
:return latent: latent values
:return U: eigenvectors
:return coef: scores
:return vec: shooting vectors
:return gam_mu: mean warping function
ElasticFDA.inverse_expMethod

Calculate shooting vector between two srvfs q1 and q2

inverse_exp(q1, q2, beta2)
:param q1: array (n,T)
:param q2: array (n,T)
:param beta2: array (n,T)

:return v: shooting vector
ElasticFDA.inverse_exp_coordMethod

Calculate shooting vector and distance between two curves beta1 and beta2

inverse_exp_coord(beta1, beta2)
:param beta1: array (n,T)
:param beta2: array (n,T)
:param method: optimization method to find warping, default is
               Dynamic Programming ("DP"). Other options are
               Coordinate Descent ("DP2"), Riemannian BFGS
               ("RBFGS")
:param wscale: keep scale (false)

:return v: shooting vector
:return dist: shape distance
ElasticFDA.optimum_reparamFunction

Calculate optimum parameterization (warping of q2 to q1)

optimum_reparam(q1, timet, q2, lam=0.0, method="SIMUL", w=0.01, f1o=0.0,
                f2o=0.0)
:param q1: array (M,N) or vector (M) describing srsf set 1
:param timet: vector describing time samples of length M
:param q2: array (M,N) or vector (M) describing srsf of set 2
:param lam: control amount of warping (default=0.0)
:param method: optimization method to find warping, default is
               Dynamic Programming ("DP"). Other options are
               Coordinate Descent ("DP2"), Riemannian BFGS
               ("RBFGS"), Simultaneous Alignment ("SIMUL")
:param w: Controls RBFGS (default = 0.01)
:param f1o: initial value of f1, vector or scalar depending on q1, defaults
            to zero
:param f2o: initial value of f2, vector or scalar depending on q1, defaults
            to zero

optimum_reparam(q1, time1, q2, time2, lam=0.0, method="DP", w=0.01, f1o=0.0,
                f2o=0.0)
same as above, but different timing for q1 and q2

optimum_reparam(beta1, beta2, lam, method="DP", w=0.01, rotated=true,
                isclosed=false)
:param beta1: array (n,T) describing curve 1
:param beta2: array (n,T) describing curve 2
:param lam: control amount of warping (default=0.0)
:param method: optimization method to find warping, default is
               Dynamic Programming ("DP"). Other options are
               Coordinate Descent ("DP2"), Riemanain BFGS
               ("RBFGS")
:param w: Controls RBFGS (default = 0.01)
:param rotated: calculate rotation (default = true)
:param isclosed: closed curve (default = false)

:return gam: warping function
:return R: rotation matrix
:return tau: seed value
ElasticFDA.pair_warping_bayesMethod

Compute pair warping between two functions using Bayesian method

pair_warping_bayes(f1, f2; iter=15000, times=5, powera=1)
:param f1, f2: vectors describing functions
:param iter: number of iterations
:param times: MCMC parameter
:param powera: MCMC parameter

Returns Dict containing
:return f1:
:return f2_q: srsf registration
:return gam_q: warping function
:return f2a: registered f2
:return gam: warping function
:return dist_collect: distance
:return best_match: best match
ElasticFDA.pair_warping_expomapMethod

Compute pair warping between two functions using Bayesian method

pair_warping_expomap(f1, f2, timet; iter=20000, burnin=min(5000,iter/2),
                     alpha0=0.1, beta0=0.1, pbetas=[0.5,0.05,0.005,0.0001],
                     probs=[0.1,0.1,0.7,0.1],propvar=1.0,
                     init_coef=zeros(20),npoints=200,extrainfo=false)

:param f1, f2: vectors describing functions
:param timet: vector describing timing
:param iter: number of MCMC iterations
:param burnin: number of MCMC burnin iterations
:param alpha0, beta0: IG parameters for prior of sigma1
:param pbetas: mixture ratios for pCN
:param probs: mixcture probabilities for zpCN
:param propvar: variance of proposal distribution
:param init_coef: initial g coefficients
:param npoits: number of sample points to use during alignment
:param extrainfo: T/F whether additional information is returned (accept, logl, gamma_mat, gamma_stats, xdist, ydist)

Returns mcmc struct containing
:return f2_warped: warped f2
:return gamma: warping function
:return g_coef: g_coeficients
:return sigma1: variance samples
:return accept: accept samples
:return logl: log-likelihood
:return gamma_mat: posterior warping function samples
:return gamma_stats: posterior warping function samples 95% credible intervals
:return xdist: phase distance of posterior warping functions
:return ydist: amplitude distance of posterior warping functions
ElasticFDA.project_tangentMethod

Project srvf onto tangent space

project_tangent(w, q, basis)
:param w: shooting vector
:param q: array (n,T)
:param basis: basis out of find_basis_normal
ElasticFDA.resamplecurveFunction

Resample curve

resamplecurve(x, N=100)
:param x: array describing curve (n,T)
:param N: Number of samples to re-sample curve, N usually is > T
ElasticFDA.rgamMethod

Generate random warping functions

rgam(N, sigma, num)
:param N: number of time points
:param sigma: standard deviation across samples
:param num: number of random warpings
ElasticFDA.sample_shapesMethod

Sample shapes from model

sample_shapes(mu, K; mode='O', no=3, numSamp=10)
:param mu: array (n,T) mean srvf
:param K: array (T,T) covariance matrix
:param mode: Open ('O') or Closed ('C') curves
:param no: number of principal components
:param numSamp: number of samples

:return samples: array (n,T,numSamp) of sample curves
ElasticFDA.smooth_dataFunction

Smooth functional data using box filter

smooth_data(f::Array{Float64,1}, sparam=10)
:param sparam: Number of times to run filter (default = 10)
ElasticFDA.smooth_data!Function
smooth_data!(f::Array{Float64,1}, sparam=10)
:param sparam: Number of times to run filter (default = 10)
ElasticFDA.smooth_data!Function

Smooth functional data using box filter in place

smooth_data!(f::Array{Float64,2}, sparam=10)
ElasticFDA.srsf_alignMethod

Aligns a collection of functions using the elastic square-root slope (srsf) framework.

srsf_align(f, timet; method="mean", smooth=false, sparam=10, lam=0.0,
           optim="DP", MaxItr=20)
:param f: array of shape (M,N) of N functions with M samples
:param timet: vector of size M describing the sample points
:param method: (string) calculate Karcher Mean or Median
(options = "mean" or "median") (default="mean")
:param smooth: Smooth the data using a box filter (default = false)
:param sparam: Number of times to run smoothing filter (default 10)
:param lam: controls the elasticity (default = 0)
:param optim: optimization method to find warping, default is
              Simultaneous Alignment ("SIMUL"). Other options are
              Dynamic Programming ("DP2"), Riemannian BFGS
              ("RBFGS")
:param MaxItr: Maximum number of iterations

Returns fdawarp type containing
:return fn: aligned functions - array of shape (M,N) of N
            functions with M samples
:return qn: aligned srsfs - similar structure to fn
:return q0: original srsfs - similar structure to fn
:return fmean: function mean or median - vector of length N
:return mqn: srvf mean or median - vector of length N
:return gam: warping functions - similar structure to fn
:return orig_var: Original Variance of Functions
:return amp_var: Amplitude Variance
:return phase_var: Phase Variance
ElasticFDA.srsf_to_fFunction

Convert square-root slope function (srsf) to f

srsf_to_f(q::Array, time, f0=0.0)
:param q: array of shape (M,N) describing N srsf of M samples
:param time: vector describing time samples of length M
:param f0: initial value of f
ElasticFDA.trapzFunction

Trapezoidal Integration

trapz(x, y, dim=1)
:param x: vector of time samples
:param y: array of response samples
:param dim: dimension along which to integrate
ElasticFDA.vert_fPCAMethod

Calculates vertical functional principal component analysis on aligned data

vert_fPCA(warp_data, qn; no=1)
:param warp_data: fdawarp type from srsf_align of aligned data
:param no: number of components to extract (default = 1)

Returns vfpca type containing
:return q_pca: srsf principal directions
:return f_pca: functional principal directions
:return latent: latent values
:return coef: scores
:return U: eigenvectors
:return id: point used for f(0)
ElasticFDA.warp_f_gammaMethod

Warp function by gamma

warp_f_gamma(time::Vector, f::Vector, gam::Vector)
:param time: describes time samples
:param f: describes function
:param gam: describes warping function
ElasticFDA.warp_q_gammaMethod

Warp srsf by gamma

warp_q_gamma(time::Vector, q::Vector, gam::Vector)
:param time: describes time samples
:param q: describes srsf
:param gam: describes warping function
ElasticFDA.DP_meanFunction

Calculate mean function using Bayesian Dynamic Programming DP_mean(f, times=5) :param f: array (M,N) of N functions :param times: MCMC parameter number of times to split

Returns Dict containing
:return distmfamily: distance matrix
:return match_matrix: match_matrix
:return position: position
:return mu_5: mean function
:return rtmatrix: rtmatrix
:return sumdist: sum distance
:return qt_fitted: qt fitted matrix
:return esimator: estimator
:return estimator2: estimator2
:return regcurve: registered curves
ElasticFDA.EnormMethod

Calculate normal Energy on an Array

Enorm(x::Array{Float64,1})
ElasticFDA.approxMethod

Linear interpolation

approx(xd, yd, xi)
:param xd: x samples
:param yd: response samples
:param xi: new x samples
ElasticFDA.calc_jMethod

Calculate Jacobian of basis

calc_j(basis)
:param basis: array of (2) from find_basis_normal
ElasticFDA.cumtrapzFunction

Cumulative Trapezoidal Integration

cumtrapz(x, y, dim=1)
:param x: vector describing time samples
:param y: array describing response
:param dim: dimension to integrate over
ElasticFDA.cumtrapzmidMethod

Cumulative Trapezoidal Integration using midpoint

cumtrapzmid(x, y, c)
:param x: time samples
:param y: resposne samples
:param c: midpoint
:param mid: midpoint location
ElasticFDA.dp_bayesMethod

Calculate Dynamic Programming using Bayesian approach dp_bayes(q1, q1L, q2L, times, cut) :param q1: vector (N) :param q1L: vector (q1L) :param q2L: vector (q2L) :param times: MCMC parameter number of simulations :param cut: MCMC parameter number of cuts

:return MatchIn2: warping function
:return NDist: minimal distance
:return q2LL: re-parameterized q2L
ElasticFDA.elastic_mlogisticMethod

Calculate elastic m-logistic regression from function data f, for response y

elastic_mlogistic(f, y, timet; B=None, df=20, max_itr=20, smooth=false)
:param f: array (M,N) of N functions
:param y: vector (N) of responses
:param timet: vector (N) describing time samples
:param B: matrix describing basis functions (M,N) (default=None generates a
          B-spline basis
:param df: degree of freedom of basis
:param max_itr: maximum number of iterations
:param smooth: smooth data

Returns Dict describing regression
:return alpha: intercept
:return beta: regression function
:return fn: aligned functions
:return qn: aligned srsfs
:return gamma: warping functions
:return q: original srsfs
:retrun B: basis functions
:return type: type of regressions
:return b: coefficients
:return n_classes: number of classes
:return LL: logistic loss
ElasticFDA.extrema_1sMethod

Find location of change of sign of srsf that is arclength parameterized

extrema_1s(t::Vector, q::Vector)
ElasticFDA.find_best_rotationMethod

Find best rotation between two srvfs

find_best_roation(q1,q2)
:param q1: array (n, T)
:param q2: array (n, T)
ElasticFDA.find_rotation_and_seed_qMethod

Find best rotation and seed value between two srvfs, q1 and q2

find_rotation_and_seed_q(q1,q2)
:param q1: array (n,T)
:param q2: array (n,T)

:return q2new: rotated srvf
:return O_hat: rotation matrix
:return tau: seed value
ElasticFDA.find_rotation_seed_coordMethod

Finds best rotation and seed value between two curves beta1, beta2

find_rotation_seed_coord(beta1,beta2)
:param beta1: array (n,T)
:param beta2: array (n,T)

:return beta2new: rotated curve
:return O_hat1: rotation matrix
:return tau: seed value
ElasticFDA.gradient2Function

2-D Gradient

gradient2(a::Array, dx::Float64=1, dy::Float=1)
:param a: matrix
:param dx: stepsize
:param dy: stepsize

:return dxdu: derivatives along x
:return dydv: derivatives along y
ElasticFDA.gradient_splineFunction

Calculate gradient of function using B-splines

gradient_spline(timet::Vector, f, smooth=false)
:param: timet: Vector describing time samples
:param: f: Vector or Array (M,N) describing functions of M samples
:param: smooth: smooth data (default = false)
ElasticFDA.gram_schmidtMethod

Gram-Schmidt Orthogonalization of basis

gram_schmidt(basis)
:param basis: basis out of find_basis_normal
ElasticFDA.innerprod_q2Method

Find inner product between two srvfs, q1 and q2

innerprod_q2(q1, q2)
:param q1: array (n,T)
:param q2: array (n,T)
ElasticFDA.interp1_flatMethod

Linear interpolation when response contains flat regions

interp1_flat(x, y, xx)
:param x: time samples
:param y: response samples
:param xx: new time samples
ElasticFDA.invert_gammaMethod

Invert warping function

invert_gamma(gam)
:param gam: vector describing warping function
ElasticFDA.karcher_calcMethod

karcher mean calculation function karcher_calc(beta, q, betamean, mu; mode='O') :param beta: array (n,T) :param q: array (n,T) :param betamean: array (n,T) :param mu: array (n,T) :param mode: Open ('O') or Closed ('C') curves :param wscale: with scale ('false')

:return v: shooting vector
:return d: elastic distance
ElasticFDA.logistic_warpMethod

Calculate warping for logistic regression

logistic_warp(beta, timet, q, y)
:param beta: regression function
:param timet: time samples
:param q: srsf
:param y: response

Returns
:return gamma: new gamma
ElasticFDA.logit_gradient!Method

Calculate gradient of logistic optimization in place

logit_gradient!(b, grad, X, y)
:param b: coefficients
:param grad: gradient
:param X: matrix
:param y: response
ElasticFDA.logit_hessianMethod

Calculate Hessian of logistic optimization

logit_hessian(s, b, X, y)
:param s:
:param b: coefficients
:param X: matrix
:param y: response
ElasticFDA.logit_lossMethod

Calculate logistic loss function

logit_loss(b, X, y)
:param b: coefficients
:param X: matrix
:param y: response

Returns
:return out: loss function
ElasticFDA.logit_optmMethod

Calculate logistic optimization function

logit_optm(x::Vector, grad::Vector, Phi, y)
:param x: samples
:param grad: gradient
:param Phi: coefficient matrix
:param y: response
ElasticFDA.match_extMethod

Find matching between two extremas

match_ext(t1, ext1, d1, t2, ext2, d2)
ElasticFDA.meshgridMethod

Creates Rectangular Grid in 2-D space

meshgrid(a::LinRange,b::LinRange)
ElasticFDA.mlogit_gradient!Method

Calculate m-logistic elastic regression loss function gradient in place

mlogit_gradient!(b, grad, X, Y)
:param b: coefficients
:param grad: gradient
:param X: matrix
:param Y: response matrix
ElasticFDA.mlogit_lossMethod

Calculate loss for m-logistic regression

mlogit_loss(b, X, Y)
:param b: coefficients
:param X: matrix
:param Y: response matrix
ElasticFDA.mlogit_optmMethod

Calculate warping for m-logistic elastic regression

mlogit_optim(x, grad, Phi, Y)
:param x: sample
:param grad: gradient
:param Phi: matrix
:param Y: response matrix
ElasticFDA.mlogit_warp_gradMethod

Calculate m-logistic warping using gradient method

mlogit_warp_grad(alpha, beta, timet, q, y; max_itr=8000, tol=1e-10,
                 delt=0.008, display=0)
:param alpha: intercept
:param beta: regression function
:param timet: vector describing time samples
:param q: srsf
:param y: response
:param max_itr: maximum number of iterations
:param tol: stopping tolerance
:param delt: gradient step size
:param display: display optimization iterations
ElasticFDA.mvnrandMethod

Multivariate Normal random number generation

mvnrand(mu, C, n)
:param mu: mean vector
:param C: covariance matrix
:param n: number of samples
ElasticFDA.parallel_translateFunction

Parallel translate srvf along tangent space

parallel_translate(w, q1, q2, basis, mode='O')
:param w: shooting vector
:param q1: array (n,T)
:param q2: array (n,T)
:param basis: basis out of find_basis_normal
:param mode: Open ('O') or Closed ('C') curves
ElasticFDA.phiMethod

Logistic function

phi(t)

Returns
:return out: phi(t)
ElasticFDA.pre_proc_curveFunction

Pre-processes curve by centering and projecting to tangent space

pre_proc_curve(beta, T=100)
:param beta: array (n,T)
:param T: number of re-sample points

:return betanew: re-sampled and centered curve
:return qnew: projected srvf
:return A: rotation matrix
ElasticFDA.psiMethod

Calculate psi

psi(x,a,q)
:param x: array (n, T) of curve
:param a: vector (n) of centroid
:param q: array (n, T) of srvf
ElasticFDA.random_gammaMethod

Generates random warping functions based on gam

random_gamma(gam, num)
:param gam: array (M,N) describing warping functions
:param num: number of functions to generate
ElasticFDA.regression_warpMethod

Optimization function to calculate warping for elastic regression

regression_warp(beta, timet, q, y, alpha)
:param beta: regression function
:param timet: vector describing time samples
:param q: vector describing srsf
:param y: response value
:param alpha: intercept

Returns
:return gamma_new: new gamma
ElasticFDA.shift_fMethod

Shift curve f by tau

shift_f(f, tau)
:param f: array (n,T)
:param tau: scalar
ElasticFDA.simul_alignMethod

Simultaneous alignment between two functions

simul_align(f1::Vector, f2::Vector)
ElasticFDA.simul_gamMethod

Calculate warping from q2 to q2 from simultaneous warping

simul_gam(u, g1,g2,t,s1,s2,tt)
ElasticFDA.sqrt_meanMethod

Calculate sqrt mean of warping functions

sqrt_mean(gam)
:param gam: array (M,N) describing warping functions
ElasticFDA.sqrt_mean_inverseMethod

Calculate sqrt mean inverse of warping function

sqrt_mean_inverse(gam)
:param gam: array (M,N) describing warping functions
ElasticFDA.zero_crossingMethod

Calculate zero crossing of optimal warping function

zero_crossing(Y,q,bt,timet,y_max,y_min,gmax,gmin)