disturber {RobPer} | R Documentation |
Disturbing light curve data
Description
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 |
y |
numeric vector: Observed values |
s |
numeric vector: Measurement accuracies |
ps |
positive value: Sampling period |
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 |
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.
Value
y |
numeric vector: New |
s |
numeric vector: New |
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>
See Also
Applied in tsgen
(see there for example).