Description Usage Arguments Value Author(s) References Examples
INARS(1) Process Random Generation
1 |
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 |
X |
design matrix for the mean. If NULL (default), the parameter
vector |
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. |
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.
Rodrigo M. R. Medeiros <rodrigo.matheus@live.com>
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.