fsmooth: A wrapper for smoothing splines

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/twostage.R

Description

This function is a wrapper to smooth a set of multidimensional discrete timecourse data.

timecourse data; Ts are the time points; rough.pen is the roughness penalty used in smoothing. Note that we must be very careful in selecting the "right" penalty for the real data. n.plot: number of functions to be plotted in the figure (having too many curves in one figure is not a good idea).

Usage

1
fsmooth(Y, Ts, rough.pen=.001, norder=4, plot=FALSE, n.plot=5)

Arguments

Y

An dxn-dimensional matrix of discrete observations. Each row is a dimension and each column is a timepoint.

Ts

An n-dimensional vector of time points in ascending order. Our recommendation is to standardize those time points so that Ts[1]=0 and Ts[length(Ts)]=1.

rough.pen

Roughness penalty used in smoothing spline. Its default value is 0.001, which is a reasonable value if: (a) the range ofTs is relatively small (e.g., from 0 to 1 as we recommended), and (b) the signal-to-noise level of the data is relatively small, i.e., it is easy to see the overall temporal trend from the discrete data by visual examination.

norder

The order of b-splines, which is one higher than their degree. The default of 4 gives cubic splines.

plot

If plot=TRUE, A plot of the discrete data and smoothed curves in the first n.plot dimensions will be plotted. The default value is FALSE.

n.plot

Number of dimensions to be used in the plot.

Details

This function is a wrapper to smooth a set of multidimensional discrete timecourse data. It calls functions create.bspline.basis(), fdPar(), and smooth.basis() in R package fda to perform the computation.

Value

Xt

A list of smoothed cubic splines.

Author(s)

Xing Qiu

References

Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.

See Also

create.bspline.basis, fdPar, smooth.basis

Examples

1
2
3
4
5
6
## load Example 3.1
data("example3.1")

## smoothing
yt1 <- fsmooth(yy1, tt, rough.pen=1e-3, plot=FALSE)
yt2 <- fsmooth(yy2, tt, rough.pen=1e-3, plot=TRUE)

qiuxing/ode.ident documentation built on Sept. 30, 2020, 11:17 a.m.