sfpcs_binary: This function computes the sfpc when the response variable is...

Description Usage Arguments Examples

Description

This function computes the sfpc when the response variable is binary.

Usage

1
2
sfpcs_binary(xmat, y, npc_select = 2, theta = 0.5, lambda = 10,
  timepts = NULL, xmat_new = NULL)

Arguments

xmat

a matrix. Each column represents a sample.

y

a vector either 0 or 1. The binary response variable for each sample.

npc_select

an integer. The number of FPCs required.

theta

between 0 and 1. The weight parameter.

lambda

a positive number. The smoothing parameter.

xmat_new

a matrix. New dataset wish to predict on, each col corresponds to one sample.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data(binary_dat);xmat = binary_dat$x;y=binary_dat$y
res = sfpcs_binary(xmat,y,npc_select=2,theta=1,xmat_new = xmat)
res$fitted
mean(y==res$fitted) # fitted accuracy
res$fitted # prediction on new data 
res$sfpcs # sFPCs 
res$beta_fd # coefficient function

## End(Not run)

YunlongNie/sFPCA documentation built on May 10, 2019, 1:54 a.m.