Learn R Programming

tswge (version 2.1.0)

ma.smooth.wge: Centered Moving Average Smoother

Description

Given a time series in the vector x and order (either an odd or even integer) ma.smooth.wge computes a centered moving average smoother and optionally plots the data and smoothed data

Usage

ma.smooth.wge(x,order=3,plot=TRUE)

Value

x

Original data

smooth

Data after application of centered average filter.l

order

Order (odd or even integer) of the smoother

Arguments

x

Vector containing original realization

order

Order (odd or even integer) of moving average smoother

plot

If plot=TRUE then plots of the data and smoothed data are plotted

Author

Wayne Woodward

References

"Practical Time Series Analysis with R" by Woodward, Sadler, and Robertson"

Examples

Run this code
data(wtcrude)
sm=ma.smooth.wge(x=wtcrude,order=5)

Run the code above in your browser using DataLab