Generates irregularly sampled observation times with a periodic sampling pattern
sampler(ttype, npoints, ncycles, ps = 1)
character string: Specifying the sampling pattern. Possible options: "equi"
and "unif"
for unperiodic sampling, "sine"
and "trian"
for sampling with a periodic density (see Details).
integer: Sample size \(n\) (see Details).
integer: Number of sampling cycles \(n_s\) (see Details).
positive numeric value: Sampling period \(p_s\) (see Details).
numeric vector: Ordered observation times.
sampler
generates observation times \(t_1,\ldots,t_n\) with a periodic sampling of period \(p_s\). Four distributions are possible:
In case of ttype="equi"
, the \(t_i\) are equidistantly sampled with \(t_i=i\frac{p_sn_s}{n}\).
For ttype="unif"
, the observation times are independently drawn form a uniform distribution on \([0,n_sp_s]\).
Both these sampling schemes are aperiodic, the sampling period \(p_s\) only influences the length \(t_n-t_1\) of the series of observation times.
For ttype="sine"
and ttype="trian"
, observation cycles \(z^\star_i\) are drawn from a uniform distribution on \(\{1,\ldots,n_s\}\) and observation phases \(\varphi^\star_i\) are drawn from a density
$$d_{sine}(x)= \sin(2\pi x)+1$$ (for ttype="sine"
) or
$$d_{trian}(x)= 3x, \quad 0\leq x\leq\frac{2}{3},$$
$$d_{trian}(x)= 6-6x, \quad \frac{2}{3}<x\leq 1$$ (for ttype="trian"
).
The unsorted observation times \(t^\star_i\) are then generated using
$$t^\star_i= \varphi^\star_i+(z^\star_i-1)p_s.$$
Separately sampling observation cycle and phase was proposed by Hall and Yin (2003). For more details see Thieler, Fried and Rathjens (2016) or Thieler et al. (2013).
Hall, P. and Yin, J. (2003): Nonparametric Methods for Deconvolving Multiperiodic Functions. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 65 (4), 869-886
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 an example).