Smooth: Smoothing data points

Description Usage Arguments Details Value Author(s)

View source: R/Smooth.R

Description

Function for smoothing data points.

Usage

1
Smooth(x,y,sigma,newx=NA,fac.extrap=1,method="quadratic")

Arguments

x

vector of x-coordinates of data points to be smoothed

y

vector of y-coordinates of data points to be smoothed (x and y must be of the same length)

sigma

standard deviation of Gaussian distribution used as weights for local quadratic or local linear regression

newx

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

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

Function for smoothing data points and estimating the derivative of the smoothed curve by local quadratic or optionally local linear regression. Local regression is implemented by using a Gaussian distribution of weights centered at the point at which the smoothed curve is evaluated. The smoothing parameter is the standard deviation of the Gaussian weights.

Value

Returns a data frame containing:

x

x-coordinates at which smoothed results and derivatives are available

y

smoothed results at the locations x

ydot

derivatives of 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.