stream (version 1.2-3)

DSC_Window: A sliding window from a Data Stream

Description

Implements a sliding window which keeps a fixed amount (window length) of the most recent data points of the stream.

Usage

DSC_Window(horizon = 100, lambda=0)

Arguments

horizon
the window length.
lambda
decay factor damped window model. lambda=0 means no dampening.

Value

An object of class DSC_Window (subclass of DSC, DSC_R, DSC_Micro).

Details

If lambda is greater than 0 then the weight uses a damped window model (Zhu and Shasha, 2002). The weight for points in the window follows $2^{-lambda*t}$ where $t$ is the age of the point.

References

Zhu, Y. and Shasha, D. (2002). StatStream: Statistical Monitoring of Thousands of Data Streams in Real Time, Intl. Conference of Very Large Data Bases (VLDB'02).

See Also

DSC, DSC_Micro

Examples

Run this code
stream <- DSD_Gaussians(k=3, d=2, noise=0.05)

window <- DSC_Window(horizon=100)
window

update(window, stream, 200)
window

# plot micro-clusters
plot(window, stream)

# animation for a window using a damped window model. The weight decays 
# with a half-life of 25
## Not run: 
# window <- DSC_Window(horizon=25, lambda=1/25)
# animate_cluster(window, stream, horizon=1, n=100, xlim=c(0,1), ylim=c(0,1))
# ## End(Not run)

Run the code above in your browser using DataLab