denoise: Smoothing procedure by replacing outliers.

Description Usage Arguments Value Author(s) Examples

Description

Smoothing procedure by replacing outliers (defined by deviations from mean) with median in a sliding window.

Usage

1
denoise(data, k = 30, t = 2)

Arguments

data

A numeric vector.

k

Define window size.

t

The number of standard deviation used to define outliers.

Value

Smoothed data, a numeric vector.

Author(s)

Mengjie Chen

Examples

1
2
3
4
5
6
x <- c(rnorm(200, 0.4, 0.05), rnorm(200, 0.1, 0.05)) 
x[round(runif(20)*400)] <- rnorm(20, 0.2, 0.05)
x[round(runif(20)*400)] <- rnorm(20, 0.3, 0.05)
y <- denoise(x)
plot(x)
points(y, pch=20, col="red")

SomatiCA documentation built on Oct. 5, 2016, 4:18 a.m.