import(zoo)

importFrom("stats", ".lm.fit", "Box.test", "coef", "cycle", "deltat", "dnorm",
  "fitted", "as.formula", "frequency", "lm", "logLik", "model.matrix",
  "nlminb", "nobs", "pchisq", "pnorm", "poisson.test", "printCoefmat", "pt",
  "qnorm", "qt", "quantile", "residuals", "rnorm", "runif", "sd", "sigma",
  "var", "vcov", "window")

importFrom("graphics", "abline", "legend", "lines", "mtext", "par",
  "plot", "points", "polygon", "text", "title")

importFrom("grDevices", "rgb")

importFrom("utils", "packageVersion", "tail", "toLatex", "write.csv")

importFrom("parallel", "detectCores", "makeCluster", "clusterExport",
  "parLapply", "stopCluster")

importFrom("methods", "is")

export(
  ##generic functions:
  "gets", "isat", "as.arx",
  
  ##base functions:
  "blocksFun", "diagnostics", "dropvar", "eqwma", "getsFun", "gmm",
  "info.criterion", "infocrit", "leqwma", "ols", "regressorsMean",
  "regressorsVariance",  
  
  ##convenience functions:
  "periodicdummies", "eviews", "stata", "printtex", "as.lm",
  
  ##arx-class functions:
  "arx", "coef.arx", "ES", "fitted.arx", "gets.arx", "logLik.arx",
  "model.matrix.arx", "nobs.arx", "plot.arx", "predict.arx", "print.arx",
  "recursive", "rsquared", "residuals.arx", "sigma.arx", "summary.arx",
  "toLatex.arx", "VaR", "vcov.arx",
  
  ##gets-class functions:
  "getsm", "getsv", "coef.gets", "fitted.gets", "paths",
  "plot.gets", "predict.gets", "print.gets", "residuals.gets", "sigma.gets",
  "summary.gets", "terminals", "toLatex.gets", "vcov.gets",
  
  ##isat functions:
  "isat.default", "coef.isat", "fitted.isat", "logLik.isat", "plot.isat",
  "predict.isat", "print.isat", "residuals.isat", "sigma.isat",
  "summary.isat", "vcov.isat", "biascorr", "isattest", "isatvar",
  "isvarcor", "isvareffcor", "iim", "sim", "tim", "isatdates",
  "isatloop", "isatvarcorrect", "mvrnormsim", "outlierscaletest",
  "outliertest", "vargaugeiis", "gets.isat", "isat.lm", "isat.arx",

  ##larch-class functions:
  "larchEstfun", "larch", "coef.larch", "fitted.larch", "gets.larch",
  "logLik.larch", "model.matrix.larch", "nobs.larch", "plot.larch",
  "predict.larch", "print.larch", "residuals.larch", "summary.larch",
  "toLatex.larch", "vcov.larch", 

  ##logitx-class functions:
  "logitxSim", "logit", "logitx", "coef.logitx", "fitted.logitx",
  "gets.logitx", "logLik.logitx", "plot.logitx", "print.logitx",
  "summary.logitx", "toLatex.logitx", "vcov.logitx", "dlogitxSim",
  "dlogitx",

  ##lm-class functions:
  "as.arx.lm", "gets.lm",

  ##outlier-distortion functions:
  "distorttest", "distorttestboot", "print.distorttestboot"

)

##methods for class arx:
S3method("coef", "arx")
S3method("fitted", "arx")
S3method("gets", "arx")
S3method("isat", "arx")
S3method("logLik", "arx")
S3method("model.matrix", "arx")
S3method("nobs", "arx")
S3method("plot", "arx")
S3method("predict", "arx")
S3method("print", "arx")
S3method("residuals", "arx")
S3method("sigma", "arx")
S3method("summary", "arx")
S3method("toLatex", "arx")
S3method("vcov", "arx")

##methods for class gets:
S3method("coef", "gets")
S3method("fitted", "gets")
S3method("logLik", "gets")
S3method("plot", "gets")
S3method("predict", "gets")
S3method("print", "gets")
S3method("residuals", "gets")
S3method("sigma", "gets")
S3method("summary", "gets")
S3method("toLatex", "gets")
S3method("vcov", "gets")

##default method for generic isat:
S3method("isat", "default")

##methods for class isat:
S3method("coef", "isat")
S3method("fitted", "isat")
S3method("gets", "isat")
S3method("logLik", "isat")
S3method("plot", "isat")
S3method("predict", "isat")
S3method("print", "isat")
S3method("residuals", "isat")
S3method("sigma", "isat")
S3method("summary", "isat")
S3method("vcov", "isat")

##methods for class larch:
S3method("coef", "larch")
S3method("fitted", "larch")
S3method("gets", "larch")
S3method("logLik", "larch")
S3method("model.matrix", "larch")
S3method("nobs", "larch")
S3method("plot", "larch")
S3method("predict", "larch")
S3method("print", "larch")
S3method("residuals", "larch")
S3method("summary", "larch")
S3method("toLatex", "larch")
S3method("vcov", "larch")

##methods for class logitx:
S3method("coef", "logitx")
S3method("fitted", "logitx")
S3method("gets", "logitx")
S3method("logLik", "logitx")
S3method("plot", "logitx")
S3method("print", "logitx")
S3method("summary", "logitx")
S3method("toLatex", "logitx")
S3method("vcov", "logitx")

##methods for class lm:
S3method("as.arx", "lm")
S3method("gets", "lm")
S3method("isat", "lm")

##methods for class distorttest.boot
S3method("print","distorttestboot")
