import(stats)
importFrom(ggplot2, ggplot, geom_density, facet_wrap, aes, "scale_x_continuous")
importFrom(statmod, tweedie)
importFrom(tweedie, rtweedie)
importFrom(systemfit, systemfit, systemfit.control)
importFrom(methods, coerce, cbind2, rbind2 )
importFrom(utils, packageDescription, head, setTxtProgressBar, 
           tail, txtProgressBar)
importFrom(lattice, xyplot, barchart)
importFrom(actuar, pllogis)
importFrom(reshape2, acast)
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)
importFrom(grid, grid.layout, unit, frameGrob, placeGrob, 
           linesGrob, gpar, textGrob)

importFrom(cplm, cpglm)
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(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(CLFMdelta, LRfunction)
export(glmReserve)

#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(print, MackChainLadder)
S3method(print, MunichChainLadder)
S3method(print, BootChainLadder)
S3method(print, triangle)
S3method(print, ClarkLDF)
S3method(print, ClarkCapeCod)
S3method(print, ata)


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(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, 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)
