## Copyright (C) 2013 Marius Hofert, Bernhard Pfaff
##
## This program is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation; either version 3 of the License, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
## details.
##
## You should have received a copy of the GNU General Public License along with
## this program; if not, see <http://www.gnu.org/licenses/>.


useDynLib(QRM)


## import
import(Matrix)
import(mvtnorm)
import(numDeriv)
import(timeSeries)

## importFrom
importFrom("graphics", "abline", "axis", "box", "contour", "legend",
           "mtext", "par", "persp", "title")
importFrom("methods", "is")
importFrom("stats", "as.formula", "ave", "cor", "dexp", "dgamma",
           "dnorm", "dt", "fitted", "integrate", "ks.test",
           "mahalanobis", "nlminb", "optim", "pchisq", "pexp",
           "pgamma", "plot.stepfun", "pnorm", "ppoints", "predict",
           "pt", "qbeta", "qchisq", "qexp", "qnorm", "qt", "rbinom",
           "rchisq", "rgamma", "rnorm", "runif", "spline", "stepfun",
           "uniroot", "var")
importFrom("utils", "setTxtProgressBar", "txtProgressBar")
importFrom("gsl", psi)
importFrom("mgcv", gam, s)
importFrom("timeDate", kurtosis)
importFrom(Rcpp, evalCpp)

## S3 methods
S3method(plot, MPP)
S3method(plot, PP)
S3method(plot, sePP)

## exports
export(BiDensPlot,
       cal.beta,
       cal.claytonmix,
       cal.probitnorm,
       dclaytonmix,
       dcopula.AC,
       dcopula.clayton,
       dcopula.gauss,
       dcopula.gumbel,
       dcopula.t,
       dGPD,
       dGEV,
       dghyp,
       dghypB,
       dGumbel,
       dmghyp,
       dmnorm,
       dmt,
       dprobitnorm,
       dsmghyp,
       edf,
       eigenmeth,
       EGIG,
       ElogGIG,
       EMupdate,
       equicorr,
       ESnorm,
       ESst,
       findthreshold,
       fit.AC,
       fit.binomial,
       fit.binomialBeta,
       fit.binomialLogitnorm,
       fit.binomialProbitnorm,
       fit.gausscopula,
       fit.GEV,
       fit.GPD,
       fit.mNH,
       fit.mst,
       fit.NH,
       fit.norm,
       fit.st,
       fit.tcopula,
       hill,
       hillPlot,
       jointnormalTest,
       Kendall,
       MardiaTest,
       MCECM.Qfunc,
       MCECMupdate,
       MEplot,
       momest,
       Pconstruct,
       Pdeconstruct,
       pGEV,
       pGPD,
       pGumbel,
       plotFittedGPDvsEmpiricalExcesses,
       plotTail,
       pclaytonmix,
       pprobitnorm,
       qGEV,
       qGPD,
       qGumbel,
       QQplot,
       qst,
       RiskMeasures,
       rAC,
       rACp,
       rBB9Mix,
       rbinomial.mixture,
       rcopula.clayton,
       rcopula.frank,
       rcopula.gauss,
       rcopula.Gumbel2Gp,
       rcopula.GumbelNested,
       rcopula.gumbel,
       rcopula.t,
       rFrankMix,
       rGEV,
       rghyp,
       rghypB,
       rGumbel,
       rclaytonmix,
       rlogitnorm,
       rprobitnorm,
       rstable,
       rtcopulamix,
       rGIG,
       rGPD,
       rmghyp,
       rmnorm,
       rmt,
       showRM,
       Spearman,
       xiplot,
       ## Export of defunct functions in QRMlib
       mk.returns,
       aggregateMonthlySeries,
       aggregateQuarterlySeries,
       aggregateSignalSeries,
       aggregateWeeklySeries,
       ConvertDFToTimeSeries,
       plotMultiTS,
       signalSeries,
       symmetrize,
       hessb,
       fit.Archcopula2d,
       besselM3,
       psifunc,
       kurtosisSPlus,
       fit.tcopula.rank,
       fit.GPDb,
       lbeta,
       CovToCor,
       ## Related to point processes
       extremalPP,
       unmark,
       plot.MPP,
       plot.PP,
       fit.POT,
       fit.seMPP,
       fit.sePP,
       plot.sePP,
       seMPP.negloglik,
       sePP.negloglik,
       stationary.sePP,
       volfunction
       )

export(gamGPDfit,
       gamGPDboot,
       get.gam.fit,
       gam.predict,
       get.GPD.fit,
       GPD.predict,
       risk.measure,
       VaRbound)
