Estimate an autoregressive logit model with covariates
logitx.Rd
Estimate a dynamic Autoregressive (AR) logit model with covariates ('X') by maximising the logit likelihood.
Usage
logitx(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,
singular.ok = TRUE, plot = NULL)
dlogitx(y, ...)
Arguments
- y
a binary numeric vector, time-series or
zoo
object. Missing values in the beginning and at the end of the series is allowed, as they are removed with thena.trim
command- intercept
logical.
TRUE
, the default, includes an intercept in the logit specification, whereasFALSE
does not- ar
either
NULL
(default) or an integer vector, say,c(2,4)
or1:4
. The AR-lags to include in the logit specification. IfNULL
, then no lags are included- ewma
either
NULL
(default) or alist
with arguments sent to theeqwma
function. In the latter case a lagged moving average ofy
is included as a regressor- xreg
either
NULL
(default) or a numeric vector or matrix, say, azoo
object, of covariates. Note that, if bothy
andxreg
arezoo
objects, then their samples are chosen to match- vcov.type
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
- lag.length
NULL
or an integer that determines the lag-length used in the robust coefficient covariance. Iflag.length
is an integer, then it is ignored unlessmethod = 3
- initial.values
NULL
or a numeric vector with the initial parameter values passed on to the optimisation routine,nlminb
. IfNULL
, the default, then the values are chosen automatically- lower
numeric vector, either of length 1 or the number of parameters to be estimated, see
nlminb
- upper
numeric vector, either of length 1 or the number of parameters to be estimated, see
nlminb
- control
a
list
passed on to the control argument ofnlminb
- eps.tol
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
- solve.tol
numeric value passed on to the
tol
argument ofsolve
, 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- singular.ok
logical. If
TRUE
(default), then the regressors causing the singularity are dropped (usingdropvar
) before estimation. IfFALSE
, singularity returns error- plot
NULL
or logical. IfTRUE
, then a plot is produced. IfNULL
(default), then the value set byoptions
determines whether a plot is produced or not.- ...
arguments passed on to
logitx
Details
The function estimates a dynamic Autoregressive (AR) logit model with (optionally) covariates ('X') by maximising the logit likelihood. The estimated model is an augmented version of the model considered by Kauppi and Saikkonen (2008). Also, they considered estimation is by maximisation of the probit likelihood. Here, by contrast, estimation is by maximisation of the logit likelihood.
References
Heikki Kauppi and Pentti Saikkonen (2008): 'Predicting U.S. Recessions with Dynamic Binary Response Models'. The Review of Economics and 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
Author
Genaro Sucarrat, http://www.sucarrat.net/
See also
Methods: coef.logitx
, fitted.logitx
, gets.logitx
, logLik.logitx
, plot.logitx
, print.logitx
, summary.logitx
, toLatex.logitx
and vcov.logitx
Examples
##simulate from ar(1):
set.seed(123) #for reproducibility
y <- logitxSim(100, ar=0.3)
##estimate ar(1) and store result:
mymod <- logitx(y, ar=1)
##estimate ar(4) and store result:
mymod <- logitx(y, ar=1:4)
##create some more data, estimate new model:
x <- matrix(rnorm(5*100), 100, 5)
mymod <- logitx(y, ar=1:4, xreg=x)