simulation_master_list {knnwtsim} | R Documentation |
simulation_master_list
Description
A list of 20 lists. Each of the 20 lists contains 31 items including 4 simulated time series.
Each series contains an ARIMA component, a periodic component simulated using trig functions, a component determined by a functional relationship
to exogenous predictors which we will call the f(x) component, a constant, and finally additional noise generated from either a
Gaussian distribution with mean = 0, or Poisson distribution. The 4 series within a given sublist only differ based on the f(x) component of the series. One series, series.mvnormx
, uses
a matrix X
generated by MASS::mvrnorm()
with corresponding coefficients for the f(x) component. All other
series use piece-wise functional relationships for the f(x) component of the series.
Usage
simulation_master_list
Format
A list containing 20 sublists each with 31 items:
- series.len
the number of observations in the simulated time series
- random.seed
the random seed used in
set.seed()
for all random components in the sublist.- arima.p
The AR order argument for
stats::arima.sim()
.- arima.d
The differencing order argument for
stats::arima.sim()
.- arima.q
The MA order argument for
stats::arima.sim()
.- ar.coefficients
Coefficients for the AR process in
stats::arima.sim()
,NULL
ifarima.p=0
.- ma.coefficients
Coefficients for the MA process in
stats::arima.sim()
,NULL
ifarima.q=0
.- seasonal.periods
The number of periods in a full cycle for the periodic component of the series.
- sin.coef
Coefficient on the sin term of the periodic component of the series.
- cos.coef
Coefficient on the cos term of the periodic component of the series.
- X.cols
Number of predictors used to generate the f(x) component of
series.mvnormx
.- X.mu
The mean vector used in
MASS::mvrnorm()
to generateX
for the f(x) component ofseries.mvnormx
.- X.Sigma
The covariance matrix generated by
clusterGeneration::rcorrmatrix()
used inMASS::mvrnorm()
to generateX
for the f(x) component ofseries.mvnormx
.- X
The matrix of
X.cols
predictors generated byMASS::mvrnorm()
used to generate the f(x) component ofseries.mvnormx
.- x.coef
The vector of
X.cols
coefficients corresponding to the predictors ofX
used to generate the f(x) component ofseries.mvnormx
.- x.chng.mu
The mean value used in
stats::rnorm()
used to generatex.chng
.- x.chng.sd
The standard deviation value used in
stats::rnorm()
used to generatex.chng
.- x.chng.coef1
A coefficient for
x.chng
used in all piece-wise functional relationship, f(x), components, as thecoef
argument tolin.to.sqrt()
andquad.to.cubic
and thecoef1
argument tolin.coef.change
.- x.chng.coef2
A coefficient for
x.chng
used in the piece-wise functional relationship, f(x), component ofseries.lin.coef.chng.x
, as thecoef2
argument tolin.coef.change
.- x.chng.break.point
A value used in two piece-wise functional relationship, f(x), components, as the
break.point
argument toquad.to.cubic
andlin.coef.change
.- x.chng.break.point.sqrt
The
max()
ofx.chng.break.point
and some value > 0. Used in the piece-wise functional relationship, f(x), component ofseries.lin.to.sqrt.x
, as thebreak.point
argument tolin.to.sqrt
.- x.chng
A vector of observations of a single predictor used to generate the f(x) component of all series other than
series.mvnormx
.- type.noise
The family of probability distributions to to generate the additional noise component.
- poisson.rate
The
lambda
argument ofstats::rpois()
used to generate additional noise, only actually used iftype.noise = 'poisson'
.- norma.sd
The
sd
argument ofstats::rnorm()
used to generate additional noise, only actually used iftype.noise = 'normal'
.- constant
A numeric value which is the constant component of the series.
- series.mvnormx
A simulated time series generated from the sum of ARIMA, Periodic, f(x), noise, and constant components. In this case f(x) represents linear relationships to the columns of the matrix
X
.- series.lin.to.sqrt.x
A simulated time series generated from the sum of ARIMA, Periodic, f(x), noise, and constant components. In this case f(x) represents a linear relationship to a single predictor
x.chng
which changes to asqrt(x.chng)
relationship whenx.chng > x.chng.break.point.sqrt
.- series.lin.coef.chng.x
A simulated time series generated from the sum of ARIMA, Periodic, f(x), noise, and constant components. In this case f(x) represents a linear relationship to a single predictor
x.chng
which changes coefficient whenx.chng > x.chng.break.point
.- series.quad.to.cubic.x
A simulated time series generated from the sum of ARIMA, Periodic, f(x), noise, and constant components. In this case f(x) represents a quadratic relationship to a single predictor
x.chng
which changes to a cubic relationship whenx.chng > x.chng.break.point
, in addition a coefficient changes sign atx.chng.break.point
.
Details
Below we have the functional relationships used for the piece-wise series:
lin.to.sqrt <- function(x, break.point, coef){
if (x < break.point) {
out <- coef * x
} else {
out <- sqrt(x)
}
return(out)
}
quad.to.cubic <- function(x, break.point, coef){
if (x < break.point) {
out <- coef * (x ** 2)
} else {
out <- -coef * (x ** 3)
}
return(out)
}
lin.coef.change <- function(x, break.point, coef1, coef2){
if (x < break.point) {
out <- coef1 * x
} else {
out <- coef2 * x
}
return(out)
}
Source
https://github.com/mtrupiano1/knnwtsim/blob/main/data-raw/simulation_master_list.R