disturber | R Documentation |
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)
tt |
numeric vector: Observation times t_1,…,t_n (see Details). |
y |
numeric vector: Observed values y_1,…,y_n (see Details). |
s |
numeric vector: Measurement accuracies s_1,…,s_n (see Details). |
ps |
positive value: Sampling period ps indirectly defines the length of the time interval, in which observed values y_i 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 |
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.
y |
numeric vector: New y-values, partly different from the old ones if |
s |
numeric vector: New s-values, partly different from the old ones if |
A former version of this function is used in Thieler et al. (2013). See also Thieler, Fried and Rathjens (2016).
Anita M. Thieler
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).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.