Compute (truncated) orthonormal eigenfunctions and scores for (partially missing) data on a common (potentially non-equidistant) grid.
Usage
fpc_wsvd(data, arg, pve = 0.995)
# S3 method for class 'matrix'
fpc_wsvd(data, arg, pve = 0.995)
# S3 method for class 'data.frame'
fpc_wsvd(data, arg, pve = 0.995)Value
a list with entries
muestimated mean function (numeric vector)efunctionsestimated FPCs (numeric matrix, columns represent FPCs)scoresestimated FPC scores (one row per observed curve)npchow many FPCs were returned for the givenpve(integer)scoring_functiona function that returns FPC scores for new data and given eigenfunctions, seetf:::.fpc_wsvd_scoresfor an example.
Details
Performs a weighted SVD with trapezoidal quadrature weights s.t. returned
vectors represent (evaluations of)
orthonormal eigenfunctions \(\phi_j(t)\), not eigenvectors
\(\phi_j = (\phi_j(t_1), \dots, \phi_j(t_n))\), specifically:
\(\int_T \phi_j(t)^2 dt \approx \sum_i \Delta_i \phi_j(t_i)^2 = 1\)
given quadrature weights \(\Delta_i\), not
\(\phi_j'\phi_j = \sum_i \phi_j(t_i)^2 = 1\);
\(\int_T \phi_j(t) \phi_k(t) dt = 0\) not
\(\phi_j'\phi_k = \sum_i \phi_j(t_i)\phi_k(t_i) = 0\).
For incomplete data, this uses a soft-impute iterative-SVD scheme
(see references). Note that this will not work well for data on a common grid
if more than a few percent of data points are missing, and it breaks down
completely for truly irregular data with no/few common timepoints, even if
observed very densely. For such data, either re-evaluate on a common grid
first or use more advanced FPCA approaches like refund::fpca_sc(),
see last example for tfb_fpc()
References
the soft-impute SVD algorithm for incomplete data is described in Mazumder, Rahul, Hastie, Trevor, Tibshirani, Robert (2010). “Spectral Regularization Algorithms for Learning Large Incomplete Matrices.” The Journal of Machine Learning Research, 11, 2287–2322.
See also
Other tfb-class:
tfb(),
tfb_fpc(),
tfb_spline()
Other tfb_fpc-class:
tfb_fpc(),
tfb_mfpc()