Movatterモバイル変換


[0]ホーム

URL:


Skip to contents

msdFilter – A triangular Filter for smoothing data

Source:R/msdFilter.R
msdFilter.Rd

The filter will take a weighted average of a specified number of pointsaround the point of interest to create a smoother time series. Forexample, if the size of the filter is set to 31, the filter will take the15 points before and after the point of interest (for a total of 31 points),and calculate a weighted average based on how far away the points are fromthe point of interest.

Usage

msdFilter(x, window=31, quantity=2)

Arguments

x

TimeSeries or numeric vector

window

Size of Filter [Default = 31]

quantity

Number of passes to apply filter [Default = 2]

Value

Vector of Yearly data

Examples

dates<-seq(from=as.Date("1981-01-01"), to=as.Date("1982-12-31"), by="day")ts<-xts::xts(runif(length(dates),0,50),dates)filteredData<-msdrought::msdFilter(ts, window=31, quantity=2)

[8]ページ先頭

©2009-2025 Movatter.jp