Last chance! 50% off unlimited learning
Sale ends in
AR1(ldrift = "identitylink", lsd = "loge", lvar = "loge",
lrho = "rhobit", idrift = NULL,
isd = NULL, ivar = NULL, irho = NULL,
ishrinkage = 0.9, type.likelihood = c("exact", "conditional"),
var.arg = FALSE, almost1 = 0.99, zero = c(-2, -3))
drift
is known as the drift, and
it is a scaled mean.
See Links
trace = TRUE
.
For a $S$-column response, these arguments can be of length
$S$, and they are recycled CommonVGAMffArguments
for more information.uninormal
."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.trace = TRUE
.
Yet to do: add an argument that allows the scaled mean parameter
to be deleted, i.e, a 2-parameter model is fitted.
Yet to do: ARff(p.lag = 1)
should hopefully be written soon.
Here are a few notes: 1. A test for stationarity might be to test whether $\mu^*$ is intercept-only. 2. The mean of all the $Y_i$ is $\mu^* /(1-\rho)$ and these are returned as the fitted values. 3. The correlation of all the $Y_i$ with $Y_{i-1}$ is $\rho$. 4. The default link function ensures that $-1 < \rho < 1$.
vglm.control
,
dAR1
,
uninormal
,
arima.sim
,# Example 1: using arimia.sim() to generate a stationary time series
nn <- 100; set.seed(1)
tsdata <- data.frame(x2 = runif(nn))
tsdata <- transform(tsdata,
index = 1:nn,
TS1 = arima.sim(nn, model = list(ar = -0.80),
sd = exp(1.0)),
TS2 = arima.sim(nn, model = list(ar = 0.50),
sd = exp(1.0 + 2 * x2)))
fit1a <- vglm(cbind(TS1, TS2) ~ x2, AR1(zero = c(1:4, 6)),
data = tsdata, trace = TRUE)
rhobit(-0.8)
rhobit( 0.5)
coef(fit1a, matrix = TRUE)
summary(fit1a) # SEs are useful to know
# Example 2: another stationary time series
nn <- 1000
my.rho <- rhobit(-1.0, inverse = TRUE)
my.mu <- 2.5
my.sd <- exp(1)
tsdata <- data.frame(index = 1:nn, TS3 = runif(nn))
for (ii in 2:nn)
tsdata$TS3[ii] <- my.mu + my.rho * tsdata$TS3[ii-1] + rnorm(1, sd = my.sd)
tsdata <- tsdata[-(1:ceiling(nn/5)), ] # Remove the burn-in data:
fit2a <- vglm(TS3 ~ 1, AR1(type.likelihood = "conditional"),
data = tsdata, trace = TRUE)
coef(fit2a, matrix = TRUE)
summary(fit2a) # SEs are useful to know
Coef(fit2a)["rho"] # Estimate of rho for intercept-only models
my.rho
coef(fit2a)[1] # drift
my.mu # Should be the same
head(weights(fit2a, type= "prior")) # First one is effectively deleted
head(weights(fit2a, type= "working")) # Ditto
Run the code above in your browser using DataLab