Learn R Programming

registr (version 1.0.0)

bfpca: Binary functional principal components analysis

Description

Function used in the FPCA step for registering binary functional data, called by register_fpca when family = "binomial". This method uses a variational EM algorithm to estimate scores and principal components for binary functional data.

Usage

bfpca(
  Y,
  npc = 1,
  Kt = 8,
  maxiter = 50,
  t_min = NULL,
  t_max = NULL,
  print.iter = FALSE,
  row_obj = NULL,
  seed = 1988,
  ...
)

Value

An object of class fpca containing:

knots

Cutpoints for B-spline basis used to rebuild alpha.

efunctions

\(D \times npc\) matrix of estimated FPC basis functions.

evalues

Estimated variance of the FPC scores.

npc

number of FPCs.

scores

\(I \times npc\) matrix of estimated FPC scores.

alpha

Estimated population-level mean.

mu

Estimated population-level mean. Same value as alpha but included for compatibility with refund.shiny package.

subject_coefs

B-spline basis coefficients used to construct subject-specific means. For use in registr() function.

Yhat

FPC approximation of subject-specific means.

Y

The observed data.

family

binomial, for compatibility with refund.shiny package.

error

vector containing error for each iteration of the algorithm.

Arguments

Y

Dataframe. Should have variables id, value, index.

npc

Default is 1. Number of principal components to calculate.

Kt

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

maxiter

Maximum number of iterations to perform for EM algorithm. Default is 50.

t_min

Minimum value to be evaluated on the time domain.

t_max

Maximum value to be evaluated on the time domain.

print.iter

Prints current error and iteration

row_obj

If NULL, the function cleans the data and calculates row indices. Keep this NULL if you are using standalone register function.

seed

Set seed for reproducibility. Default is 1988.

...

Additional arguments passed to or from other functions

Author

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

References

Jaakkola, T. S. and Jordan, M. I. (1997). A variational approach to Bayesian logistic regression models and their extensions. Proceedings of the Sixth International Workshop on Artificial Intelligence and Statistics.

Tipping, M. E. (1999). Probabilistic Visualisation of High-dimensional binary data. Advances in neural information processing systems, 592--598.

Examples

Run this code
Y = simulate_functional_data()$Y
bfpca_object = bfpca(Y, npc = 2, print.iter = TRUE)

Run the code above in your browser using DataLab