Last data update: 2014.03.03

R: Generator for irregularly sampled observation times
samplerR Documentation

Generator for irregularly sampled observation times

Description

Generates irregularly sampled observation times with a periodic sampling pattern

Usage

sampler(ttype, npoints, ncycles, ps = 1)

Arguments

ttype

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).

npoints

integer: Sample size (see Details).

ncycles

integer: Number of sampling cycles (see Details).

ps

positive numeric value: Sampling period (see Details).

Details

sampler generates observation times t with a periodic sampling of period ps. Four distributions are possible: In case of ttype="equi", the t[i] are equidistantly sampled with t[i]=i*ps*ncycles/npoints. For ttype="unif", the observation times are independently drawn form a uniform distribution on [0,ncycles*ps]. Both these sampling schemes are aperiodic, the sampling period 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,…,ncycles} and observation phases φ.star[i] are drawn from a density

d.sine(x)=sin(2π x)+1

(for ttype="sine") or

d.trian(x)=3x if 0 ≤ x ≤ 2/3

d.trian(x)=6-6x if 2/3 < x ≤ 1

(for ttype="trian"). The unsorted observation times t.star[i] are then generated using

t.star[i]=φ.star[i]+(z.star[i]-1)*ps.

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).

Value

numeric vector: Ordered observation times.

Note

To sample from d.sine, the function BBsolve, package BB, is used.

A former version of this function is used in Thieler et al. (2013).

Author(s)

Anita M. Thieler and Jonathan Rathjens

References

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>

See Also

Applied in tsgen (see there for an example).

Results