ACMx | R Documentation |
Estimation of autoregressive conditional mean models with exogenous variables.
ACMx(y, order = c(1, 1), X = NULL, cond.dist = "po", ini = NULL)
y |
time series of counts. |
order |
the order of ACM model. |
X |
matrix of exogenous variables. |
cond.dist |
conditional distributions. "po" for Poisson, "nb" for negative binomial, "dp" for double Poisson. |
ini |
initial parameter estimates designed for use in "nb" and "dp". |
ACMx returns a list with components:
data |
time series. |
X |
matrix of exogenous variables. |
estimates |
estimated values. |
residuals |
residuals. |
sresi |
standardized residuals. |
x=rnorm(1000)*0.1
y=matrix(0,1000,1)
y[1]=2
lambda=matrix(0,1000,1)
for (i in 2:1000){
lambda[i]=2+0.2*y[i-1]/exp(x[i-1])+0.5*lambda[i-1]
y[i]=rpois(1,exp(x[i])*lambda[i])
}
ACMx(y,order=c(1,1),x,"po")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.