powered by
Determines the number of functional principal components (FPCs) required to meet a target Proportion of Variance Explained (PVE).
determine_npc(Y_mat, argvals, target_pve = 0.95, max_npc = 6L)
A list containing:
The selected number of components.
The fpca.sc object from the refund package.
fpca.sc
refund
A tibble with PVE and cumulative PVE for each component.
A numeric matrix (N x M) where N is subjects, M is time points.
A numeric vector of length M listing the observation points.
The target cumulative PVE to reach (default: 0.95).
The maximum number of components to retain (default: 6L).
# \donttest{ sim <- simulate_fmi_data(N_A = 20, N_B = 20, T_points = 30) npc_info <- determine_npc(sim$Y_mat, sim$argvals) print(npc_info$npc) # }
Run the code above in your browser using DataLab