useDynLib(spatialreg)

import(spData)

importFrom("stats", "lm.fit", "as.formula", "coef", "lm", "model.extract",
             "model.matrix", "na.fail", "napredict", "pnorm",
             "printCoefmat", "quantile", "residuals", "terms", 
	     "coefficients", "deviance", "nlminb", "optim",
             "pchisq", "summary.lm", "var", "logLik", "optimHess",
             "gaussian", "glm.fit", "model.offset", "model.weights",
             "rnorm", "sd", "predict", "AIC", "nlm", "optimize",
             "dbeta", "rchisq", "runif", "spline", "fitted", "formula",
             "model.response", "anova", "delete.response", "fitted.values",
             "model.frame")

importFrom("spdep", "is.symmetric.glist", "lag.listw", "card",
 "nb2listw", "n.comp.nb", "listw2U", "listw2mat", "Szero", "listw2sn",
 "invIrW", "mat2listw", "is.symmetric.nb", "chkIDs", "get.spChkOption",
 "subset.listw")

import(Matrix, except=c("expm"))
importFrom(expm, expAtv, expm)
importFrom(coda, as.mcmc, HPDinterval)
importFrom(MASS, mvrnorm)
importFrom(boot, boot)
importFrom("methods", "new", "is", "slot", "as")
importFrom("graphics", "plot")
importFrom(splines, interpSpline)
importFrom(LearnBayes, rwmetrop)
importFrom(nlme, fdHess)
importFrom(gmodels, estimable)


##################

export(lextrB, lextrW, lextrS, l_max)

export(griffith_sone, subgraph_eigenw)

export(mom_calc, mom_calc_int2)

export(stsls, print.stsls, summary.stsls, print.summary.stsls, 
	residuals.stsls, coef.stsls, deviance.stsls, impacts.stsls)

export(GMerrorsar, gstsls, GMargminImage,
	residuals.gmsar, deviance.gmsar, coef.gmsar, fitted.gmsar, 
	print.gmsar, summary.gmsar, print.summary.gmsar, impacts.gmsar)

export(lagmess, LR1.lagmess, coef.lagmess, deviance.lagmess, fitted.lagmess,
    impacts.lagmess, logLik.lagmess, print.lagmess, print.summary.lagmess,
    residuals.lagmess, summary.lagmess)

export(SpatialFiltering, print.SFResult, fitted.SFResult,
	ME, print.ME_res, fitted.ME_res)


export(LR.sarlm, LR1.sarlm, Wald1.sarlm)

export(Hausman.test, Hausman.test.gmsar, Hausman.test.sarlm,
  logLik.sarlm)

export(as_dgRMatrix_listw, as_dsTMatrix_listw, as_dsCMatrix_I,
	as_dsCMatrix_IrW, Jacobian_W, listw2U_Matrix)

exportMethods(coerce)

export(powerWeights)

export(as.spam.listw, listw2U_spam)

export(trW, impacts, intImpacts, plot.lagImpact, print.lagImpact, print.summary.lagImpact, summary.lagImpact, HPDinterval.lagImpact)

export(eigenw, jacobianSetup, can.be.simmed, similar.listw)

export(do_ldet, eigen_setup, mcdet_setup, cheb_setup, spam_setup,
        Matrix_setup, LU_setup, Matrix_J_setup, spam_update_setup,
        moments_setup, SE_classic_setup, SE_whichMin_setup, SE_interp_setup,
        LU_prepermutate_setup, eigen_pre_setup)

export(MCMCsamp, MCMCsamp.spautolm, MCMCsamp.sarlm)

export(spautolm, residuals.spautolm, deviance.spautolm, coef.spautolm, 
	fitted.spautolm, print.spautolm, summary.spautolm, LR1.spautolm, 
	logLik.spautolm, print.summary.spautolm)

export(spBreg_lag, spBreg_err, spBreg_sac, impacts.MCMC_sac_g, impacts.MCMC_sar_g, impacts.MCMC_sem_g)

export(lmSLX, create_WX, predict.SLX, impacts.SLX)

export(errorsarlm, lagsarlm, sacsarlm)

export(print.sarlm, summary.sarlm, residuals.sarlm, deviance.sarlm, 
	coef.sarlm, fitted.sarlm, logLik.sarlm, anova.sarlm, vcov.sarlm,
	predict.sarlm, print.summary.sarlm, print.sarlm.pred,
        as.data.frame.sarlm.pred, bptest.sarlm, impacts.sarlm)

export(set.mcOption, get.mcOption, set.coresOption, get.coresOption,
        set.ClusterOption, get.ClusterOption)

export(set.VerboseOption, get.VerboseOption, set.ZeroPolicyOption, 
        get.ZeroPolicyOption)

S3method(residuals, stsls) 
S3method(deviance, stsls) 
S3method(coef, stsls) 
S3method(print, stsls) 
S3method(summary, stsls) 
S3method(impacts, stsls) 

S3method(print, summary.stsls) 

S3method(residuals, gmsar)
S3method(deviance, gmsar)
S3method(coef, gmsar)
S3method(fitted, gmsar)
S3method(print, gmsar)
S3method(summary, gmsar)
S3method(Hausman.test, gmsar)
S3method(impacts, gmsar)

S3method(print, summary.gmsar)

S3method(print, lagmess)
S3method(summary, lagmess)
S3method(print, summary.lagmess)
S3method(residuals, lagmess)
S3method(deviance, lagmess)
S3method(coef, lagmess)
S3method(fitted, lagmess)
S3method(logLik, lagmess)
S3method(impacts, lagmess)

S3method(fitted, SFResult)
S3method(print, SFResult)
S3method(fitted, ME_res)
S3method(print, ME_res)

S3method(print, lagImpact)
S3method(plot, lagImpact)
S3method(summary, lagImpact)
S3method(HPDinterval, lagImpact)
S3method(print, summary.lagImpact)

S3method(print, sarlm)
S3method(summary, sarlm)
S3method(residuals, sarlm)
S3method(deviance, sarlm)
S3method(coef, sarlm)
S3method(vcov, sarlm)
S3method(fitted, sarlm)
S3method(logLik, sarlm)
S3method(anova, sarlm)
S3method(predict, sarlm)
S3method(impacts, sarlm)
S3method(print, summary.sarlm)
S3method(print, sarlm.pred)
S3method(as.data.frame, sarlm.pred)
S3method(Hausman.test, sarlm)
S3method(MCMCsamp, sarlm)

S3method(MCMCsamp, spautolm)
S3method(residuals, spautolm)
S3method(deviance, spautolm)
S3method(coef, spautolm)
S3method(fitted, spautolm)
S3method(print, spautolm)
S3method(summary, spautolm)
S3method(logLik, spautolm)

S3method(print, summary.spautolm)

S3method(impacts, MCMC_sar_g)
S3method(impacts, MCMC_sem_g)
S3method(impacts, MCMC_sac_g)

S3method(print, WXImpact)
S3method(summary, WXImpact)
S3method(print, summary.WXImpact)

S3method(impacts, SLX)
S3method(predict, SLX)

