Disturbes a light curve replacing measurement accuracies by outliers and/or observed values by atypical values.
See RobPer-package for more information about light curves.
Usage
disturber(tt, y, s, ps, s.outlier.fraction = 0, interval)
Arguments
tt
numeric vector: Observation times (see Details).
y
numeric vector: Observed values (see Details).
s
numeric vector: Measurement accuracies (see Details).
ps
positive value: Sampling period. Indirectly defines the length of the time interval, in which observed values are replaced by atypical values (see Details).
s.outlier.fraction
numeric value in [0,1]: Defines the proportion of measurement accuracies that is replaced by outliers (see Details). A value of 0 means that no measurement accuracy is replaced by an outlier.
interval
logical: If TRUE, the observed values belonging to a random time interval of length 3ps are replaced by atypical values (see Details). If TRUE and the light curve is shorter than ps, the function will stop with an error message.
Details
This function disturbes the light curve (t[i], y[i], s[i]), i=1,…,n, given. It randomly chooses a proportion of s.outlier.fraction measurement accuracies s and replaces them by 0.5*min(s). In case of interval=TRUE a time interval [t.start, t.start+3ps] within the intervall
[t[1], t[n]] is randomly chosen and all observed values belonging to this time interval are replaced by a peak function:
y[i]=6*quantile(y, 0.9)*dnorm(t[i], mean=t.start+1.5ps, sd=ps)/dnorm(0, sd=ps), for i : t[i] in [t.start, t.start+3ps],
where dnorm(x, mean=a, sd=b) denotes the density of a normal distribution with mean a and variance b^2 at x.
In case of s.outlier.fraction=0 and interval=FALSE, y and s are returned unchanged.
Value
y
numeric vector: New y-values, partly different from the old ones if interval=TRUE (see Details).
s
numeric vector: New s-values, partly different from the old ones if s.outlier.fraction>0 (see Details).
Note
A former version of this function is used in Thieler et al. (2013). See also Thieler, Fried and Rathjens (2016).
Author(s)
Anita M. Thieler
References
Thieler, A. M., Backes, M., Fried, R. and Rhode, W. (2013): Periodicity Detection in Irregularly Sampled Light Curves by Robust Regression and Outlier Detection. Statistical Analysis and Data Mining, 6 (1), 73-89
Thieler, A. M., Fried, R. and Rathjens, J. (2016): RobPer: An R Package to Calculate Periodograms for Light Curves Based on Robust Regression. Journal of Statistical Software, 69 (9), 1-36, <doi:10.18637/jss.v069.i09>