sim-inars: INARS(1) Process Random Generation

Description Usage Arguments Value Author(s) References Examples

Description

INARS(1) Process Random Generation

Usage

1
inars_sim(n, par, X = NULL, innovation = c("SDL", "SK", "DLOG"))

Arguments

n

number of random values to return.

par

parameter vector; it must be specified in the following order: (alpha, mu, disp) to simulate without regressors; or (alpha, beta, disp) to simulate with a regression structure in the mean of the innovation process. In the latter, beta represents a p dimensional vector of the coefficients.

X

design matrix for the mean. If NULL (default), the parameter vector par must be specified as (alpha, mu, disp).

innovation

the assumed distribution for the innovation process. Currently, are available the skew discrete Laplace ("SDL"), the Skellam ("SK"), and the discret logistic ("DLOG") distributions.

Value

A integer-values time series of size n, which consists of a realization of the INARS(1) process with an innovation process specified via innovation argument.

Author(s)

Rodrigo M. R. Medeiros <rodrigo.matheus@live.com>

References

Kim, H. Y., & Park, Y. (2008). A non-stationary integer-valued autoregressive model. Statistical papers, 49, 485.

Andersson, J., & Karlis, D. (2014). A parametric time series model with covariates for integers in Z. Statistical Modelling, 14, 135–156.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Not run: 
# Sample size
n <- 100

###############################
# Generate without regressors #
##############################

# Parameters
alpha <- -0.5
mu <- -3
disp <- 4

# SDL innovations
y <- inars_sim(n, c(alpha, mu, disp))
barplot(table(y), xlab = "y", ylab = "Frequency")
plot(y, xlab = "Time", ylab = "y")

# SK innovation
y <- inars_sim(n, c(alpha, mu, disp), innovation = "SK")
barplot(table(y), xlab = "y", ylab = "Frequency")
plot(y, xlab = "Time", ylab = "y")

################################################
# Generate with a regression structure in the  #
#      mean of the innovation process          #
###############################################

# Parameters
alpha <- -0.5
beta <- c(1.2, 2)
disp <- 4

# Design matrix
X <- cbind(rep(1, n), runif(n, -1, 1))

# SDL innovations
y <- inars_sim(n, c(alpha, beta, disp), X)
barplot(table(y), xlab = "y", ylab = "Frequency")
plot(y, xlab = "Time", ylab = "y")

# SK innovations
y <- inars_sim(n, c(alpha, beta, disp), X, innovation = "SK")
barplot(table(y), xlab = "y", ylab = "Frequency")
plot(y, xlab = "Time", ylab = "y")

## End(Not run)

rdmatheus/inars documentation built on March 15, 2021, 1:45 p.m.