import(stats)
import(mvtnorm)
import(tmvtnorm)
import(Matrix)
if (packageVersion("spdep") < "1.2") {
  import(spdep, except=c("impacts", "SE_classic_setup", "cheb_setup",
     "do_ldet",  "mcdet_setup"))
} else {
  import(spdep)
  #importFrom(spdep, mat2listw, nb2listw, knearneigh, logLik.sarlm)
}
importFrom(spatialreg, impacts, SE_classic_setup, cheb_setup, do_ldet, mcdet_setup)
importFrom("grDevices", "dev.interactive", "devAskNewPage")
importFrom("graphics", "abline", "par", "plot")
importFrom("utils", "setTxtProgressBar", "txtProgressBar")

export(sar_eigs)
export(sar_lndet)
export(lndetfull)
export(lndetChebyshev)
export(kNearestNeighbors)

# SAR probit
export(sarprobit)
export(sar_probit_mcmc)
export(coefficients.sarprobit)
export(coef.sarprobit)
export(plot.sarprobit)
export(summary.sarprobit)
export(c.sarprobit)
export(marginal.effects)
export(marginal.effects.sarprobit)
export(impacts.sarprobit)
export(logLik.sarprobit)
export(fitted.sarprobit)

# SAR ordered probit 
export(sarorderedprobit)
export(sar_ordered_probit_mcmc)
export(summary.sarorderedprobit)
export(fitted.sarorderedprobit)

# SAR Tobit
export(sartobit)
export(sar_tobit_mcmc)
export(coefficients.sartobit)
export(coef.sartobit)
export(plot.sartobit)
export(summary.sartobit)
export(marginal.effects.sartobit)
export(impacts.sartobit)
export(fitted.sartobit)
#export(sartobit.default)
#export(sartobit.formula)

# SEM probit
export(semprobit)
export(sem_probit_mcmc)
export(coefficients.semprobit)
export(coef.semprobit)
export(plot.semprobit)
export(summary.semprobit)
export(logLik.semprobit)
export(fitted.semprobit)

export(LeSagePaceExperiment)

## register all the methods for generics elsewhere in case namespace is
## loaded but not currently attached.
S3method(plot, sarprobit)
S3method(plot, semprobit)
S3method(plot, sartobit)
S3method(marginal.effects, sarprobit)
S3method(marginal.effects, sartobit)
S3method(impacts, sarprobit)
S3method(impacts, sartobit)
S3method(coef, sarprobit)
S3method(coef, semprobit)
S3method(coef, sartobit)
S3method(c, sarprobit)
S3method(logLik, sarprobit)
S3method(logLik, semprobit)
S3method(summary, sarprobit)
S3method(summary, sarorderedprobit)
S3method(summary, semprobit)
S3method(summary, sartobit)
S3method(fitted, sarprobit)
S3method(fitted, sarorderedprobit)
S3method(fitted, semprobit)
S3method(fitted, sartobit)
#S3method(predict, sarprobit)
#S3method(residuals, sarprobit)