_images/logo.png

Functional Principal Component Analysis#

Vertical and Horizontal Functional Principal Component Analysis using SRSF

moduleauthor:: J. Derek Tucker <jdtuck@sandia.gov>

class fPCA.fdahpca(fdawarp)[source]#

This class provides horizontal fPCA using the SRVF framework

Usage: obj = fdahpca(warp_data)

Parameters:
  • warp_data – fdawarp class with alignment data

  • gam_pca – warping functions principal directions

  • psi_pca – srvf principal directions

  • latent – latent values

  • U – eigenvectors

  • coef – coefficients

  • vec – shooting vectors

  • mu – Karcher Mean

  • tau – principal directions

Author : J. D. Tucker (JDT) <jdtuck AT sandia.gov> Date : 15-Mar-2018

calc_fpca(no=3, var_exp=None, stds=array([-1, 0, 1]))[source]#

This function calculates horizontal functional principal component analysis on aligned data

Parameters:
  • no (int) – number of components to extract (default = 3)

  • var_exp – compute no based on value percent variance explained (example: 0.95)

  • stds – number of standard deviations along geodesic to compute (default = -1,0,1)

Return type:

fdahpca object of numpy ndarray

Return q_pca:

srsf principal directions

Return f_pca:

functional principal directions

Return latent:

latent values

Return coef:

coefficients

Return U:

eigenvectors

plot()[source]#

plot plot elastic horizontal fPCA results

Usage: obj.plot()

project(f)[source]#

project new data onto fPCA basis

Usage: obj.project(f)

Parameters:

f – numpy array (MxN) of N functions on M time

class fPCA.fdajpca(fdawarp)[source]#

This class provides joint fPCA using the SRVF framework

Usage: obj = fdajpca(warp_data)

Parameters:
  • warp_data – fdawarp class with alignment data

  • q_pca – srvf principal directions

  • f_pca – f principal directions

  • latent – latent values

  • coef – principal coefficients

  • id – point used for f(0)

  • mqn – mean srvf

  • U – eigenvectors

  • mu_psi – mean psi

  • mu_g – mean g

  • C – scaling value

  • stds – geodesic directions

Author : J. D. Tucker (JDT) <jdtuck AT sandia.gov> Date : 18-Mar-2018

calc_fpca(no=3, var_exp=None, stds=array([-1., 0., 1.]), id=None, parallel=False, cores=-1)[source]#

This function calculates joint functional principal component analysis on aligned data

Parameters:
  • no (int) – number of components to extract (default = 3)

  • var_exp – compute no based on value percent variance explained (example: 0.95)

  • id (int) – point to use for f(0) (default = midpoint)

  • stds – number of standard deviations along gedoesic to compute (default = -1,0,1)

  • parallel (bool) – run in parallel (default = F)

  • cores (int) – number of cores for parallel (default = -1 (all))

Return type:

fdajpca object of numpy ndarray

Return q_pca:

srsf principal directions

Return f_pca:

functional principal directions

Return latent:

latent values

Return coef:

coefficients

Return U:

eigenvectors

plot()[source]#

plot plot elastic joint fPCA result

Usage: obj.plot()

project(f)[source]#

project new data onto fPCA basis

Usage: obj.project(f)

Parameters:

f – numpy array (MxN) of N functions on M time

class fPCA.fdajpcah(fdawarp)[source]#

This class provides joint fPCA using the SRVF framework using MFPCA

Usage: obj = fdajpcah(warp_data)

Parameters:
  • warp_data – fdawarp class with alignment data

  • q_pca – srvf principal directions

  • f_pca – f principal directions

  • latent – latent values

  • coef – principal coefficients

  • id – point used for f(0)

  • mqn – mean srvf

  • U_q – eigenvectors for q

  • U_h – eigenvectors for gam

  • C – scaling value

  • stds – geodesic directions

Author : J. D. Tucker (JDT) <jdtuck AT sandia.gov> Date : 06-April-2024

calc_fpca(var_exp=0.99, stds=array([-1., 0., 1.]), id=None, parallel=False, cores=-1)[source]#

This function calculates joint functional principal component analysis on aligned data

Parameters:
  • var_exp – compute no based on value percent variance explained (default: 0.99)

  • id (int) – point to use for f(0) (default = midpoint)

  • stds – number of standard deviations along gedoesic to compute (default = -1,0,1)

  • parallel (bool) – run in parallel (default = F)

  • cores (int) – number of cores for parallel (default = -1 (all))

  • U_q – eigenvectors for q

  • U_h – eigenvectors for gam

Return type:

fdajpcah object of numpy ndarray

Return q_pca:

srsf principal directions

Return f_pca:

functional principal directions

Return latent:

latent values

Return coef:

coefficients

plot()[source]#

plot plot elastic joint fPCA result

Usage: obj.plot()

project(f)[source]#

project new data onto fPCA basis

Usage: obj.project(f)

Parameters:

f – numpy array (MxN) of N functions on M time

class fPCA.fdavpca(fdawarp)[source]#

This class provides vertical fPCA using the SRVF framework

Usage: obj = fdavpca(warp_data)

Parameters:
  • warp_data – fdawarp class with alignment data

  • q_pca – srvf principal directions

  • f_pca – f principal directions

  • latent – latent values

  • coef – principal coefficients

  • id – point used for f(0)

  • mqn – mean srvf

  • U – eigenvectors

  • stds – geodesic directions

  • new_coef – principal coefficients of new data

Author : J. D. Tucker (JDT) <jdtuck AT sandia.gov> Date : 15-Mar-2018

calc_fpca(no=3, var_exp=None, id=None, stds=array([-1, 0, 1]))[source]#

This function calculates vertical functional principal component analysis on aligned data

Parameters:
  • no (int) – number of components to extract (default = 3)

  • var_exp – compute no based on value percent variance explained (example: 0.95)

  • id (int) – point to use for f(0) (default = midpoint)

  • stds – number of standard deviations along geodesic to compute (default = -1,0,1)

Return type:

fdavpca object containing

Return q_pca:

srsf principal directions

Return f_pca:

functional principal directions

Return latent:

latent values

Return coef:

coefficients

Return U:

eigenvectors

plot()[source]#

plot plot elastic vertical fPCA result Usage: obj.plot()

project(f)[source]#

project new data onto fPCA basis

Usage: obj.project(f)

Parameters:

f – numpy array (MxN) of N functions on M time