Learn R Programming

EvalEst (version 2012.4-1)

genMineData: Generate Data

Description

Generate data for Monte Carlo experiments

Usage

genMineData(umodel, ymodel, uinput=NULL, sampleT=100, 
      unoise=NULL, usd=1,ynoise=NULL, ysd=1, rng=NULL)
    build.input.models(data, max.lag=NULL)
    build.diagonal.model(multi.models)

Arguments

umodel
Model for input data.
ymodel
Model for output data.
sampleT
Number of periods of data to generate.
unoise
Input noise.
usd
Standard deviationof input noise.
ynoise
Output noise.
ysd
Standard deviation of output noise.
rng
RNG setting.
multi.models
A list of TSestModels.
data
data from which to build models.
max.lag
number of lags in the estimated models.
uinput
Input data to umodel.

Value

  • A TSdata object.

concept

DSE

Details

This function generates test data using specified models. umodel is used to generate data corresponding to input data and ymodel is used to generate data corresponding to output data. The result of umodel is used as input to ymodel so the input dimension of ymodel should be the output dimension of umodel. Typically the ymodel would be degenerate in some of the input variables so the effective inputs are a subset. If umodel requires input data it should be specified in uinput If noise is NULL then an normal noise will be generated by simulate. This will be iid N(0,I). The RNG will be set first to rng if it is specified. If unoise or ynoise are specified they should be as expected by simulate for the specified umodel and ymodel. genMineData uses build.input.models, which makes a list of univariate TSestModels, one for each series in inputData(data) estimated by estVARXls with max.lag lags. genMineData then uses build.diagonal.model which builds one diagonal model from a list of models returned by build.input.models. It uses the AR part only.

See Also

simulate

Examples

Run this code
data("eg1.DSE.data.diff", package="dse")
    umodel <- build.diagonal.model(
            build.input.models(eg1.DSE.data.diff, max.lag=2))
    z  <- TSdata(output=outputData(eg1.DSE.data.diff), 
                 input = inputData(eg1.DSE.data.diff))
    ymodel <- TSmodel(estVARXls(z, max.lag=3))   
    sim.data <- genMineData(umodel, ymodel)

Run the code above in your browser using DataLab