baseini {unknown}R Documentation

Initial Values for the Baseline Function

Description

This function can be used to derive initial values for the baseline function which are required by two other functions: puldet and pulest.

Usage

baseini(x, y, data, puloc, method=c("shift", "select"), 
     smooth=c("spline", "loess"), control=list(shift=-1, spline=list(nb=~x, 
     rk=cubic(x), spar="v", limnla=c(-1.5, 0)), loess=list(span=0.75), 
     select=list(npl=2, npr=3)))

Arguments

x a vector of observation time points.
y a vector of hormone concentrations.
data a data frame containing the variables occurring in the x and y arguments. If this option is not specified, the variables should be on the search list. Missing values are not allowed.
puloc a vector of pulse locations.
method a character string. If method="shift", a smooth curve will be fit to all observations using a smoothing method specified by the smooth argument, and then the whole curve will be shifted downward; if method="select", a smooth curve will be fit to the selected observations without those around pulse locations.
smooth a character string specifying which smoothing method will be used:
smooth="spline" for smoothing spline and smooth="loess" for loess.
control a list of control parameters for different method and smooth options. Names of the list are shift, spline, select, and loess. When method="shift", shift specifies the amount of shifting downward with a nonnegative value; the default shift=-1 asks the program to estimate the amount of shift. When method="select", the select list in the control argument decides the number of observation points to be eliminated on the left (npl) and on the right (npr) of each pulse location. When smooth="spline", as in pcp, the spline list in the control argument specifies the null space, reproducing kernel, and method and range for estimating the smoothing parameter. When smooth="loess", the loess list in the control argument specifies the span for the loess function.

Details

When smooth="spline", the ssr function in the assist package is used to fit the spline function. See cran.us.r-project.org/doc/packages/assist.pdf for more information about nb, rk, spar and limnla. The appropriate choices of npl and npr depend on the sampling rate as well as prior knowledge about the infusion and decay rates.

Value

Estimated baseline function evaluated at x.

Author(s)

Yu-Chieh Yang, Anna Liu, Yuedong Wang

References

Wang, Y. and Ke, C. (2002), ASSIST: A Suite of S-plus functions Implementing Spline smoothing Techniques. Available at cran.us.r-project.org/src/contrib/PACKAGES.html. Manual for the ASSIST package is available at www.pstat.ucsb.edu/faculty/yuedong/software.

Yang, Y. (2002), Detecting Change Points and Hormone Pulses Using Partial Spline Models, Ph.D. Thesis, University of California-Santa Barbara, Dept. of Statistics and Applied Probability.

See Also

loess, ssr

Examples

bl1 <- baseini(time, conc, data=acth, puloc=pl1, method="shift", smooth="spline")
bl2 <- baseini(time, conc, data=acth, puloc=pl1, method="select", smooth="spline")
bl3 <- baseini(time, conc, data=acth, puloc=pl1, method="shift", smooth="loess")
bl4 <- baseini(time, conc, data=acth, puloc=pl1, method="select", smooth="loess")

[Package Contents]