Smooth.fun: Smoothing piecewise linear functions

Description Usage Arguments Details Value Author(s)

View source: R/Smooth.R

Description

Function for smoothing piecewise linear functions.

Usage

1
Smooth.fun(data,z,sigma,newz=NA,newx=NA,fac.extrap=1,method="quadratic")

Arguments

data

list of matrices specifying piecewise linear functions: for each function, the independent variable x must be provided in the first column, the dependent variable y in the second

z

vector of z-coordinates corresponding to the functions

sigma

standard deviation of Gaussian distribution used as weights for local quadratic regression in z-coordinates (see function Smooth)

newz

optional vector of z-coordinates at which smoothed functions are to be calculated (if not specified, results are provided at the same locations as there is data available)

newx

optional vector of x-coordinates at which smoothed function values are to be calculated

fac.extrap

calculate smoothed value only if data is available within fac.extrap*sigma (default is 1)

method

"quadratic" (default) indicates local quadratic regression, otherwise local linear regression is used

Details

The smoothing parameter is the standard deviation of the Gaussian weights.

Value

Returns a list of data frames with columns:

x

x-coordinates at which smoothed results are available

y

smoothed results at the locations x

Author(s)

Peter Reichert <peter.reichert@eawag.ch>


baccione-eawag/EawagSchoolTools documentation built on Dec. 19, 2021, 6:38 a.m.