Learn R Programming

itsmr (version 1.9)

smooth.ma: Apply a moving average filter

Description

Apply a moving average filter

Usage

smooth.ma(x, q)

Value

Returns a vector the same length as x.

Arguments

x

Time series data

q

Filter order

Details

The averaging function uses 2q+1 values.

Examples

Run this code
y = smooth.ma(strikes,2)
plotc(strikes,y)

Run the code above in your browser using DataLab