Learn R Programming

Actigraphy (version 1.4.0)

fda.smoothdata: Functional Actigraphy Data Smoothing

Description

This function produces functional actigraphy data from matrix actigraphy data.

Usage

fda.smoothdata(data, basistype="fourier", nbasis=9, norder=4)

Arguments

data

A list consisting of the following two components: data$mat A matrix where rows represent the time, columns are the samples, and the column names are the subjects. data$cov A two column matrix that contains the actigraphy data and clinical covariate.

basistype

A string specifying either "Fourier" and "bspline".

nbasis

The number of basis functions to be used for functional data. Default value is 9.

norder

The order of the bspline basis functions. Default value is 4.

Value

A list consisting of two components as follows:

fd

A fdSmooth data object containing the functional data (see function smooth.basis in the package fda for details).

cov

An object that is the same as the argument data$cov.

Details

Note: The output of function fda.matchid can be directly used as the input for this argument. If the data is a categorical covariate

Examples

Run this code
# NOT RUN {
	data(act_29pt)
	data(clinic_29pt_ahi)
	
	data <- act_29pt
	ahi <- clinic_29pt_ahi
	
	matchid  <- fda.matchid(data, ahi, "contin")
	FDcont <- fda.smoothdata(matchid)
	
	### Smooth the Results
	ts.plot(predict(FDcont$fd$fd, 1:1440), main="Smoothed Activity Data")
# }

Run the code above in your browser using DataLab