Description Usage Arguments Details Value References See Also Examples
View source: R/dataGeneration.R
Allows for easy generation of data that lies in a latent subspace with changepoints in the subspace.
1 2 3 4 5 6 7 8 9 | subspaceDataGeneration(
n,
p,
subspaceDim,
tau = c(1, n),
nvar = 0.05,
svar = 1,
changeSize = 0.5 * sqrt(subspaceDim)
)
|
n |
Number of time points. |
p |
Dimension of the time series. |
subspaceDim |
Dimension of the latent subspace. |
tau |
Vector of changepoint locations. |
nvar |
Variance of measurement error i.e the variance of the points in the directions of the orthogonal compliment of the subspace (assumed to be Normal). |
svar |
Variance within the subspace i.e. the variance of points in directions of the basis of the subspace (assumed to be Normal). |
changeSize |
Either scalar for change size of all the changepoints or a vector (of equal length to the number of changepoints) indicating the change size for each changepoint. All change sizes must be between 0 and sqrt(subspaceDim). |
This function allows for the creation of a data matrix that contains changes in subspaces as described in \insertCiteGrundy2020;textualchangepoint.cov. The creation of the data set starts by generating a random initial basis for the first segment. Subsequent subspace basis are then created that are the required change size from the previous subspace basis. svar
is then the variance of the points in the directions of the subspace bases and nvar
is the variance of the points in the directions orthogonal to these subspace bases. Hence, nvar
must be less then svar
for the subspace to be visible. The change size is defined in terms of the F-distance between subspace bases as described in \insertCiteGrundy2020;textualchangepoint.cov.
List with elements:
data Matrix of generated data with dimension n by p.
cpts Location of the changepoints.
changeSize Scalar or vector of change sizes.
subspace List of the bases of the subspace for each segment.
Grundy2020changepoint.cov
cptSubspace
, wishartDataGeneration
1 2 3 4 5 6 | set.seed(1)
dataObject <- subspaceDataGeneration(n=100,p=4,subspaceDim=2,tau=40)
dim(dataObject$data)
dataObject$cpts
dataObject$changeSize
dataObject$subspace
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.