import(stats)
importFrom(ggplot2, ggplot, geom_density, facet_wrap, aes, "scale_x_continuous")
importFrom(tweedie, rtweedie, "tweedie.profile")
importFrom(statmod, tweedie)
importFrom(systemfit, systemfit, systemfit.control)
importFrom(methods, coerce, cbind2, rbind2 )
importFrom(utils, packageDescription, head, setTxtProgressBar,
           tail, txtProgressBar)
importFrom(lattice, xyplot, barchart, panel.xyplot, panel.lines)
importFrom(actuar, pllogis)
importFrom(methods, show, coerce, cbind2, rbind2,
                    as, new, slot, slotNames)
importFrom(graphics, plot, abline, barplot, boxplot, hist, legend,
           lines, matplot, mtext, par, points, rug, text,
           axis, segments, strwidth, polygon)
importFrom(grid, grid.layout, unit, frameGrob, placeGrob,
           linesGrob, gpar, textGrob)
importFrom(cplm, cpglm)
importFrom(MASS, glm.nb)

importClassesFrom(cplm, NullNum, NullList)
importMethodsFrom(cplm, show, predict, vcov, residuals, resid, coef, fitted, plot, terms)
importMethodsFrom(Matrix, summary)

export(MackChainLadder, MunichChainLadder, BootChainLadder,
       MultiChainLadder, MultiChainLadder2)
export(triangle,as.triangle)
export(chainladder)
export(getLatestCumulative)
export(incr2cum, cum2incr)
export(Join2Fits, JoinFitMse, Mse, residCov, residCor)
export(ClarkLDF, ClarkCapeCod)
export(Table64, Table65, Table68)
export(ata)
export(as.LongTriangle)
export(CLFMdelta, LRfunction)
export(glmReserve)
export(cyEffTest, dfCorTest, checkTriangleInflation, inflateTriangle, BS.paid.adj)

#Classes
exportClasses(triangles, MultiChainLadder, MultiChainLadderFit,
              MCLFit, GMCLFit, MultiChainLadderMse,
              MultiChainLadderSummary,
              NullNum, NullChar)

#Methods
S3method(plot, MackChainLadder)
S3method(plot, MunichChainLadder)
S3method(plot, BootChainLadder)
S3method(plot, triangle)

S3method(plot, clark)

S3method(plot, cyEffTest)
S3method(plot, dfCorTest)
S3method(plot, checkTriangleInflation)


S3method(print, MackChainLadder)
S3method(print, MunichChainLadder)
S3method(print, BootChainLadder)
S3method(print, triangle)
S3method(print, ClarkLDF)
S3method(print, ClarkCapeCod)
S3method(print, ata)

S3method(print, cyEffTest)
S3method(print, dfCorTest)
S3method(print, checkTriangleInflation)

S3method(as.triangle, matrix)
S3method(as.triangle, data.frame)
S3method(as.data.frame, triangle)

S3method(summary, MackChainLadder)
S3method(summary, MunichChainLadder)
S3method(summary, BootChainLadder)
S3method(summary, ClarkLDF)
S3method(summary, ClarkCapeCod)
S3method(summary, ata)

S3method(summary, cyEffTest)
S3method(summary, dfCorTest)
S3method(summary, checkTriangleInflation)


S3method(print, glmReserve)
S3method(summary, glmReserve)
S3method(residuals, glmReserve)
S3method(resid, glmReserve)
S3method(plot, glmReserve)


S3method(predict, TriangleModel)
S3method(predict, ChainLadder)
S3method(coef, ChainLadder)
S3method(residuals, MackChainLadder)
S3method(quantile, MackChainLadder)
S3method(quantile, BootChainLadder)
S3method(residuals, BootChainLadder)
S3method(mean, BootChainLadder)

S3method(vcov, clark)

exportMethods(predict, Mse, summary, show, coerce,
              "[", "$", "[[", "[<-", names, coef, vcov, residCov, residCor,
              residuals, resid, rstandard, fitted, plot, cbind2, rbind2, dim)

S3method(CDR, MackChainLadder)
S3method(CDR, BootChainLadder)
S3method(CDR, default)
export(CDR)

export(tweedieReserve)
S3method(print, tweedieReserve)
S3method(summary, tweedieReserve)

export(PaidIncurredChain)
export(QuantileIFRS17)
