fr_rss: Perform flux randomisation/random subset section on input...

Description Usage Arguments Details Value Notes See Also Examples

Description

fr_rss returns a randomise version of an input data array.

Usage

1
fr_rss(dat)

Arguments

dat

(data frame) containing columns t, y and (optionally) dy.

Details

Performs "flux randomisation" and "random sample selection" of an input time series, following Peterson et al. (2004, ApJ, v613, pp682-699). This is essentially a bootstrap for a data vector.

Value

A data frame containing columns

t

time bins for randomised data

y

values for randomised data

dy

errors for randomised data

Notes

Given an input data series (t, y, dy) of length N we sample N points with replacement. Duplicated points are ignored, so the ouptut is usually shorter than the input. So far this is a basic bootstrap procedure.

If error bars are provided: when a point is selected m times, we decrease the error, scaling by 1/sqrt(m). See Appendix A of Peterson et al. After resampling, we then add a random Gaussian deviate to each remaining data point, with std.dev equal to its (new) error bar. If errors bars are not provided, this is a simple bootstrap (no randomisation of y).

See Also

cross_correlate, ccf_errors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 ## Example using the NGC 5548 data
 plot(cont$t, cont$y, type="l", bty = "n", xlim = c(50500, 52000))
 rcont <- fr_rss(cont)
 lines(rcont$t, rcont$y, col = "red")

 ## Examples from Venables & Ripley
 require(graphics)
 plot(fdeaths, bty = "n")
 tsf <- data.frame(t = time(fdeaths), y = fdeaths)
 rtsf <- fr_rss(tsf)
 lines(rtsf$t, rtsf$y, col="red", type="o")

svdataman/sour documentation built on May 30, 2019, 8:47 p.m.