Description Usage Arguments Details Value Notes See Also Examples
fr_rss
returns a randomise version of an input data array.
1 | fr_rss(dat)
|
dat |
(data frame) containing columns |
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.
A data frame containing columns
t |
time bins for randomised data |
y |
values for randomised data |
dy |
errors for randomised data |
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
).
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.