Learn R Programming

registr (version 1.0.0)

register_fpca: Register curves using constrained optimization and GFPCA

Description

Function combines constrained optimization and FPCA to estimate warping functions for exponential family curves. The FPCA step is performed through the function bfpca if family = "binomial" or the function fpca_gauss if family = "gaussian". Warping functions are calculated by the function registr.

Usage

register_fpca(
  Y,
  Kt = 8,
  Kh = 4,
  family = "binomial",
  max_iterations = 10,
  npc = 1,
  ...
)

Value

An object of class registration containing:

fpca_obj

List of items from FPCA step.

Y

The observed data plus variables t_star and t_hat which are the unregistered grid and registered grid, respectively.

time_warps

List of time values for each iteration of the algorithm. time_warps[1] is the original (observed) time and time_warps[n] provides time values for the nth iteration.

loss

Loss for each iteration of the algorithm, calculated in the registration step using an exponential family likelihood with natural parameter from the FPCA step.

family gaussian or binomial.

Arguments

Y

Dataframe. Should have values id, value, index.

Kt

Number of B-spline basis functions used to estimate mean functions. Defaults to 8.

Kh

Number of B-spline basis functions used to estimate warping functions h. Defaults to 4.

family

gaussian or binomial.

max_iterations

Number of iterations for overall algorithm. Defaults to 10.

npc

Number of principal components to calculate. Defaults to 1.

...

Additional arguments passed to registr and fpca functions.

Author

Julia Wrobel jw3134@cumc.columbia.edu Jeff Goldsmith ajg2202@cumc.columbia.edu

Details

Requires input data Y to be a dataframe in long format with variables id, index, and value to indicate subject IDs, times, and observations, respectively. The code calls two

Examples

Run this code


 Y = simulate_unregistered_curves(I = 20, D = 200)
 registr_object = register_fpca(Y, family = "binomial", max_iterations = 5)

# \donttest{ 
 # example using accelerometer data from nhanes 2003-2004 study
 data(nhanes)
 register_nhanes = register_fpca(nhanes, npc = 2, family = "binomial", max_iterations = 5)
# }

Run the code above in your browser using DataLab