Learn R Programming

kza (version 1.01)

kzsv: Kolmogorov-Zurbenko Adaptive filter with Sample Variance.

Description

Sample variance of a Kolmogorov-Zurbenko adaptive filter. You should get a sigma of at least 3 but preferably more than that.

Usage

kzsv(y, kza, kz, q, k=3, m=round(0.05*q), tol=1.0e-5)

Arguments

y
The raw data.
kza
A vector of the resultant time series from kza function.
kz
A moving average result from the kz function.
q
The window size for the filter.
k
The number of iterations that were used.
m
Minimum size of filtering window.
tol
The smallest value to accept as nonzero.

Examples

Run this code
x <- c(rep(0,4000),rep(0.5,2000),rep(0,4000))
noise <- rnorm(n = 10000, sd = 1.0) # normally-distributed random variates
v <- x + noise
kzsv(v, q=1000, k=3)

Run the code above in your browser using DataLab