carxSim: Simulate data from a 'carx' model

Description Usage Arguments Value References See Also Examples

View source: R/carx_simulate.R

Description

Use the provided parameters in the supplied carx model and other settings to simulate data from the carx model; see Wang and Chan (2017).

Usage

1
2
3
carxSim(nObs = 200, prmtrAR = c(-0.28, 0.25), prmtrX = c(0.2, 0.4),
  sigma = 0.6, lcl = -1, ucl = 1, x = NULL, seed = NULL,
  inno.dist = c("normal", "t"), t.df = 5, intercept = 0)

Arguments

nObs

number of observations to be simulated.

prmtrAR

the AR parameter.

prmtrX

the regression parameters for X.

sigma

the innovation standard deviation for the AR process.

lcl

the lower censoring limit.

ucl

the upper censoring limit.

x

optional matrix for X. Default = NULL, in which case X will be simulated from the standard normal distribution with dimensions determined by nObs and prmtrX.

seed

optional to set the seed of random number generator used by R, default=NULL.

inno.dist

innovation distribution, can be "normal" or "t", default="normal". If it is "t", its degree of freedom should be supplied in t.df.

t.df

the degree of freedom of the t distribution, used only if inno.dist="t". Default=5.

intercept

the intercept in the regression. Default=0.

Value

a data frame of simulated y, x, ci, lcl and ucl.

References

Wang C, Chan KS (2017). "Quasi-likelihood estimation of a censored autoregressive model with exogenous variables." Journal of the American Statistical Association. 2017 Mar 20(just-accepted). with exogenous variables." Submitted.

See Also

carx for model specification.

Examples

1
dat = carxSim()

Example output



carx documentation built on May 2, 2019, 3:43 a.m.

Related to carxSim in carx...