sfpca_con: 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 continuous.

Usage

1
2
sfpca_con(xmat, y, theta, lambda, npc_select = 3, timepts = NULL,
  xmat_new = NULL)

Arguments

xmat

a matrix. Each column represents a sample.

y

a vector. The response variable for each sample.

theta

between 0 and 1. The weight parameter.

lambda

a positive number. The smoothing parameter.

npc_select

an integer. The number of FPCs required.

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
11
## Not run: 
data(medfly)
xmat = medfly$eggcount  # 26 days and 50 flies 
y = medfly$lifetime
res = sfpca_con(xmat,y,0.1,1e3,npc_select=5,xmat_new = xmat[,1:10])
plot(res$beta_fd,ylab="beta(t)")
res$fitted
res$predicted 
res$sfpcs

## End(Not run)

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