FPCA_covsmooth_fpcasc: Returns the score estimates of covariance function for...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/FPCA_covsmooth_fpcasc.R

Description

Inputs two data sets and returns the score estimates of covariance function that can be used for 2-sample testing with the 'testAD_fun.R' function.

Usage

1
FPCA_covsmooth_fpcasc(Y.1, Y.2, threshold = 0.99)

Arguments

Y.1

Y1 needs to be read in as n x d where n is the number of curves and d is the number of observations along the curve; Each row is a separate curve

Y.2

Y2 needs to be read in as n x d where n is the number of curves and d is the number of observations along the curve; Each row is a separate curve

threshold

The proporton of variance explained by the eigenvectors that are used to explain the data and create the smoothed covaraince matrix

Details

This code smooths the raw covariances first and then pools them. It uses the smoothing methodology from the refund package.

Value

The output is a list of following elements

cov.dat.1

smoothed covariance of data set 1

cov.dat.2

smoothed covariance of data set 2

L

L_U : The number of eigenfunctions that will be used to explain the data (this depends on the threshold)

eigenfns

(Phi.U_eigenfn): The eigenfunctions of the smoothed pooled covariance

eigenvals1

(lambda_U1_eigenval) : The estimated eigenvalues from projecting onto the space of pooled eigenfunctions

eigenvals2

(lambda_U2_eigenval) : The estimated eigenvalues from projecting onto the space of pooled eigenfunctions

sigma.noise2.1

estimated error variance of data set 1

sigma.noise2.2

estimated error variance of data set 2

Author(s)

Author of the function: Gina-Maria Pomann

Author of this package: Subhrangshu Nandi (snandi@wisc.edu or nands31@gmail.com)

References

Pomann, G.M., Staicu, A.M., and Ghosh,S. (2016). A two-sample distribution-free test for functional data with application to a diffusion tensor imaging study of multiple sclerosis. Journal of the Royal Statistical Society: Series C (Applied Statistics).

Examples

1
2
3
4
5
6
7
8
9
x <- rnorm(2000,0,3)
y <- rnorm(2000,0,10)
d1 <- matrix(x,20,100)
d2 <- matrix(y,20,100)
cd1 <- cov(d1)
cd2 <- cov(d2)
n.1 <- dim(d1)[1]
n.2 <- dim(d2)[1]
test <- FPCA_covsmooth_fpcasc(cd1,cd2, threshold = 0.96)

snandi/Registration documentation built on May 30, 2019, 5:04 a.m.