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.
disturber(tt, y, s, ps, s.outlier.fraction = 0, interval)
numeric vector: Observation times \(t_1,\ldots,t_n\) (see Details).
numeric vector: Observed values \(y_1,\ldots,y_n\) (see Details).
numeric vector: Measurement accuracies \(s_1,\ldots,s_n\) (see Details).
positive value: Sampling period \(p_s\) indirectly defines the length of the time interval, in which observed values \(y_i\) are replaced by atypical values (see Details).
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.
logical: If TRUE
, the observed values belonging to a random time interval of length 3\(p_s\) are replaced by atypical values (see Details). If TRUE
and the light curve is shorter than \(3p_s\), the function will stop with an error message.
numeric vector: New \(y_i\)-values, partly different from the old ones if interval=TRUE
(see Details).
numeric vector: New \(s_i\)-values, partly different from the old ones if s.outlier.fraction>0
(see Details).
This function disturbes the light curve \((t_i,y_i,s_i)_{i=1,\ldots,n}\) given. It randomly chooses a proportion of s.outlier.fraction
measurement accuracies \(s_i\) and replaces them by \(0.5\min(s_1,\ldots,s_n)\). In case of interval=TRUE
a time interval \([t_{start},t_{start}+3p_s]\) 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^{changed} = 6 \ \tilde y_{0.9}\ \frac{d_{\mathcal N(t_{start}+1.5p_s, p_s^2)}(t_i) }{ d_{\mathcal N(0,p_s^2)}(0)} \quad \forall \ i \ : \ t_i\in[t_{start}, t_{start}+3p_s],$$
where \(d_{\mathcal N(a,b^2)}(x)\) 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.
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>
Applied in tsgen
(see there for example).