Learn R Programming

MARX (version 0.2)

sim.marx: The simulation of MARX processes

Description

This function allows you to simulate MARX processes based on different underlying distribution.

Usage

sim.marx(dist.eps, dist.x, obs, c_par, nc_par, exo_par)

Arguments

dist.eps

vector containing the error distribution and its parameters (options: t, normal, stable).

dist.x

vector containing the distribution of x and its parameters (options: t, normal, stable). Specify NULL or "not" if not wanted.

obs

Number of observations for simulated process.

c_par

vector of causal parameters.

nc_par

vector of noncausal parameters.

exo_par

Parameter of the exogenous variable.

Value

y

Simulated data y.

x

Simulated data x (exogenous variable).

Examples

Run this code
# NOT RUN {
dist.eps <- c('t',1,1) ## t-distributed errors with 1 degree of freedom and scale parameter 1
dist.x   <- c('normal',0,1) ## standard normally distributed x variable
obs <- 100
c_par <- c(0.2,0.4)
nc_par <- 0.8
exo_par <- 0.5
sim.marx(dist.eps,dist.x,obs,c_par,nc_par,exo_par) ## Simulates a MARX(2,1,1) process
# }

Run the code above in your browser using DataLab