Learn R Programming

rpatrec (version 1.0.1)

mav: Compute the moving average, exponential average or running median.

Description

Use this function to compute any of these three moving average methods. These are the simplest smoothers available in the package so it may be a good idea to start initial testing with this function.

Usage

mav(input, len = 10, method)

Arguments

input
Time series data to use for computation
len
An integer to determine the number of datapoints used for computation
method
String. Determines the method of computation. Permissible values are exponential, simple and median

Value

Vector containing the smoothed time series data of length of input less length of len

Details

For an overview of the package capabilities, click here rpatrec.

Examples

Run this code
## Not run: ------------------------------------
# #create a standard HS pattern:
# a <- generator()
# #add noise to this patterns
# b <- noise(a,'white',10)
# #smooth to regain the signal
# c <- kernel(b,2)
## ---------------------------------------------
##simply test the smoother
mav(1:10,5,'exponential')

Run the code above in your browser using DataLab