Estimate a dynamic Autoregressive (AR) logit model with covariates ('X') by maximising the logit likelihood.
dlogitx(y, intercept = TRUE, ar = NULL, ewma = NULL, xreg = NULL,
vcov.type = c("ordinary", "robust"), lag.length = NULL,
initial.values = NULL, lower = -Inf, upper = Inf, control = list(),
eps.tol = .Machine$double.eps, solve.tol = .Machine$double.eps,
plot = NULL)
logical. TRUE
, the default, includes an intercept in the logit specification, whereas FALSE
does not
either NULL
(default) or an integer vector, say, c(2,4)
or 1:4
. The AR-lags to include in the logit specification. If NULL
, then no lags are included
either NULL
(default) or a numeric vector or matrix, say, a zoo
object, of covariates. Note that, if both y
and xreg
are zoo
objects, then their samples are chosen to match
character vector of length 1, either "ordinary" (default) or "robust". Partial matching is allowed. If "ordinary", then the ordinary variance-covariance matrix is used for inference. If "robust", then a robust coefficient-covariance of the Newey and West (1987) type is used
NULL
or an integer that determines the lag-length used in the robust coefficient covariance. If lag.length
is an integer, then it is ignored unless method = 3
NULL
or a numeric vector with the initial parameter values passed on to the optimisation routine, nlminb
. If NULL
, the default, then the values are chosen automatically
numeric vector, either of length 1 or the number of parameters to be estimated, see nlminb
numeric vector, either of length 1 or the number of parameters to be estimated, see nlminb
a list
passed on to the control argument of nlminb
numeric, a small value that ensures the fitted zero-probabilities are not too small when the log-transformation is applied when computing the log-likelihood
numeric value passed on to the tol
argument of solve
, which is called whenever the coefficient-coariance matrix is computed. The value controls the toleranse for detecting linear dependence between columns when inverting a matrix
NULL
or logical. If TRUE
, then a plot is produced. If NULL
(default), then the value set by options
determines whether a plot is produced or not.
A list of class 'dlogitx'.
The function estimates a dynamic Autoregressive (AR) logit model with (optionally) covariates ('X') by maximising the logit likelihood. The estimated model is that of Kauppi and Saikkonen (2008). However, there (in contrast to here) estimation is by maximisation of the probit likelihood.
Heikki Kauppi and Penti Saikkonen (2008): 'Predicting U.S. Recessions with Dynamic Binary Response Models'. The Review of Economic Statistics 90, pp. 777-791
Whitney K. Newey and Kenned D. West (1987): 'A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix', Econometrica 55, pp. 703-708
Methods: coef.dlogitx
, fitted.dlogitx
, gets.dlogitx
,
logLik.dlogitx
, plot.dlogitx
, print.dlogitx
, summary.dlogitx
, toLatex.dlogitx
and vcov.dlogitx
Related functions: dlogitxSim
, logit
, nlminb
# NOT RUN {
##simulate from ar(1):
set.seed(123) #for reproducibility
y <- dlogitxSim(100, ar=0.3)
##estimate ar(1) and store result:
mymod <- dlogitx(y, ar=1)
##estimate ar(4) and store result:
mymod <- dlogitx(y, ar=1:4)
##create some more data, estimate new model:
x <- matrix(rnorm(5*100), 100, 5)
mymod <- dlogitx(y, ar=1:4, xreg=x)
# }
Run the code above in your browser using DataLab