Description Usage Arguments Details Value Examples
This function simulates univariate data with a structural change.
1 2 | rchangepoint(n, changepoint = NULL, mean1 = 0, mean2 = 0,
dist = rnorm, meanparam = "mean", ...)
|
n |
An integer for the data set's sample size |
changepoint |
An integer for where the change point occurs |
mean1 |
The mean prior to the change point |
mean2 |
The mean after the change point |
dist |
The function with which random data will be generated |
meanparam |
A string for the parameter in |
... |
Other arguments to be passed to dist |
This function generates artificial change point data, where up to the
specified change point the data has one mean, and after the point it has a
different mean. By default, the function simulates standard Normal data with
no change. If changepoint
is NULL
, then by default the change
point will be at about the middle of the data.
A vector of the simulated data
1 2 3 4 | CPAT:::rchangepoint(500)
CPAT:::rchangepoint(500, changepoint = 10, mean2 = 2, sd = 2)
CPAT:::rchangepoint(500, changepoint = 250, dist = rexp, meanparam = "rate",
mean1 = 1, mean2 = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.