Function used in the FPCA step for registering functional data,
called by register_fpca
when family = "gaussian"
.
Parameters estimated based on probabilistic PCA framework originally
introduced by Tipping and Bishop in 1999.
The number of functional principal components (FPCs) can either be specified
directly (argument npc
) or chosen based on the explained share of
variance (npc_varExplained
). In the latter case, the explained share of
variance and accordingly the number of FPCs is estimated before the main
estimation step by once running the FPCA with npc = 20
(and
correspondingly Kt = 20
). Doing so, we approximate the overall
variance in the data Y
with the variance represented by the FPC basis
with 20 FPCs.
fpca_gauss(
Y,
npc = NULL,
npc_varExplained = NULL,
Kt = 8,
maxiter = 20,
t_min = NULL,
t_max = NULL,
print.iter = FALSE,
row_obj = NULL,
seed = 1988,
periodic = FALSE,
error_thresh = 1e-04,
subsample = TRUE,
verbose = 1,
...
)
An object of class fpca
containing:
Information that FPCA was performed with the 'variationEM' approach, in contrast to registr::gfpca_twoStep.
Time vector over which the mean mu
and the functional principal
components efunctions
were evaluated.
Cutpoints for B-spline basis used to rebuild alpha
.
\(D \times npc\) matrix of estimated FPC basis functions.
Estimated variance of the FPC scores.
Approximation of the overall variance in Y
, based
on an initial run of the FPCA with npc = 20
. Is NULL
if
npc_varExplained
was not specified.
number of FPCs.
\(I \times npc\) matrix of estimated FPC scores.
Estimated population-level mean.
Estimated population-level mean. Same value as alpha
but included for compatibility
with refund.shiny
package.
B-spline basis coefficients used to construct subject-specific means.
For use in registr()
function.
FPC approximation of subject-specific means.
The observed data.
gaussian
, for compatibility with refund.shiny
package.
Estimated error variance
Dataframe. Should have variables id, value, index.
The number of functional principal components (FPCs)
has to be specified either directly as npc
or based on their explained
share of variance. In the latter case, npc_varExplained
has to be set
to a share between 0 and 1.
Number of B-spline basis functions used to estimate mean functions
and functional principal components. Default is 8. If npc_varExplained
is used, Kt
is set to 20.
Maximum number of iterations to perform for EM algorithm. Default is 50.
Minimum value to be evaluated on the time domain.
Maximum value to be evaluated on the time domain.
Prints current error and iteration
If NULL, the function cleans the data and calculates row indices.
Keep this NULL if you are using standalone register
function.
Set seed for reproducibility. Defaults to 1988.
If TRUE, uses periodic b-spline basis functions. Default is FALSE.
Error threshold to end iterations. Defaults to 0.0001.
if the number of rows of the data is greater than 10 million rows, the `id` values are subsampled to get the mean coefficients.
Can be set to integers between 0 and 4 to control the level of detail of the printed diagnostic messages. Higher numbers lead to more detailed messages. Defaults to 1.
Additional arguments passed to or from other functions
Julia Wrobel julia.wrobel@cuanschutz.edu, Jeff Goldsmith ajg2202@cumc.columbia.edu, Alexander Bauer alexander.bauer@stat.uni-muenchen.de
Tipping, M. E. and Bishop, C (1999). Probabilistic Principal Component Analysis. Journal of the Royal Statistical Society Series B,, 592--598.
data(growth_incomplete)
# estimate 2 FPCs
fpca_obj = fpca_gauss(Y = growth_incomplete, npc = 2)
plot(fpca_obj)
# estimate npc adaptively, to explain 90% of the overall variation
# \donttest{
fpca_obj2 = fpca_gauss(Y = growth_incomplete, npc_varExplained = 0.9)
plot(fpca_obj, plot_FPCs = 1:2)
# }
Run the code above in your browser using DataLab