import("chron")

importFrom("grDevices", "rainbow")
importFrom("graphics", "abline", "axis", "hist", "lines", "par",
           "plot", "points", "segments")
importFrom("stats", "binomial", "dgamma", "dnorm", "glm", "lag", "lm",
           "loess", "median", "na.omit", "optim", "optimize", "pgamma",
           "pnorm", "power", "predict", "rgamma", "rnorm", "runif",
           "sd", "uniroot")

export(julTOymdh,ymdhTOjul,dateCheck)
export(ensembleData,trainingData,plotProbcast)

export(dataVerifObs,dataVerifObs.ensembleData)
export(dataNA,dataNA.ensembleData)
export(dataNobs,dataNobs.ensembleData)
export(dataObsLabels,dataObsLabels.ensembleData)
export(dataStartupSpeed,dataStartupSpeed.ensembleData)

export(ensembleForecasts,ensembleForecasts.ensembleData)
export(ensembleSize,ensembleSize.ensembleData)
export(ensembleValidDates,ensembleValidDates.ensembleData)
export(ensembleFhour,ensembleFhour.ensembleData)
export(ensembleItime,ensembleItime.ensembleData)
export(ensembleGroups,ensembleGroups.ensembleData)
export(ensembleMembers,ensembleMembers.ensembleData)

export(controlBMAgamma0,controlBMAgamma,controlBMAnormal)
export(ensembleBMA,ensembleBMAgamma0,ensembleBMAgamma,ensembleBMAnormal)
export(fitBMA,fitBMAgamma0,fitBMAgamma,fitBMAnormal)

export( CRPS, CRPS.default)
export( MAE, MAE.default)

export(pitHist,verifRankHist,verifPlot)

export(brierScore,
       brierScore.ensembleBMAgamma0,
       brierScore.ensembleBMAgamma,
       brierScore.ensembleBMAnormal,
       brierScore.fitBMAgamma0,
       brierScore.fitBMAgamma,
       brierScore.fitBMAnormal)
export(cdf,
       cdf.ensembleBMAgamma0,
       cdf.ensembleBMAgamma,
       cdf.ensembleBMAnormal,
       cdf.fitBMAgamma0,
       cdf.fitBMAgamma,
       cdf.fitBMAnormal)
export(crps,
       crps.ensembleBMAgamma0,
       crps.ensembleBMAgamma,
       crps.ensembleBMAnormal,
       crps.fitBMAgamma0,
       crps.fitBMAgamma,
       crps.fitBMAnormal)
export(modelParameters,
       modelParameters.ensembleBMAgamma0,
       modelParameters.ensembleBMAgamma,
       modelParameters.ensembleBMAnormal,
       modelParameters.fitBMAgamma0,
       modelParameters.fitBMAgamma,
       modelParameters.fitBMAnormal)
export(quantileForecast,
       quantileForecast.ensembleBMAgamma0,
       quantileForecast.ensembleBMAgamma,
       quantileForecast.ensembleBMAnormal,
       quantileForecast.fitBMAgamma0,
       quantileForecast.fitBMAgamma,
       quantileForecast.fitBMAnormal)
export(pit,
       pit.ensembleBMAgamma0,
       pit.ensembleBMAgamma,
       pit.ensembleBMAnormal,
       pit.fitBMAgamma0,
       pit.fitBMAgamma,
       pit.fitBMAnormal)
export(combine,
       combine.ensembleBMAgamma0,
       combine.ensembleBMAgamma,
       combine.ensembleBMAnormal)

S3method("CRPS", "default")
S3method("MAE", "default")

S3method("brierScore", "ensembleBMAgamma")
S3method("brierScore", "ensembleBMAgamma0")
S3method("brierScore", "ensembleBMAnormal")
S3method("brierScore", "fitBMAgamma")
S3method("brierScore", "fitBMAgamma0")
S3method("brierScore", "fitBMAnormal")

S3method("cdf", "ensembleBMAgamma")
S3method("cdf", "ensembleBMAgamma0")
S3method("cdf", "ensembleBMAnormal")
S3method("cdf", "fitBMAgamma")
S3method("cdf", "fitBMAgamma0")
S3method("cdf", "fitBMAnormal")

S3method("combine", "ensembleBMAgamma")
S3method("combine", "ensembleBMAgamma0")
S3method("combine", "ensembleBMAnormal")

S3method("crps", "ensembleBMAgamma")
S3method("crps", "ensembleBMAgamma0")
S3method("crps", "ensembleBMAnormal")
S3method("crps", "fitBMAgamma")
S3method("crps", "fitBMAgamma0")
S3method("crps", "fitBMAnormal")

S3method("modelParameters", "ensembleBMAgamma")
S3method("modelParameters", "ensembleBMAgamma0")
S3method("modelParameters", "ensembleBMAnormal")
S3method("modelParameters", "fitBMAgamma")
S3method("modelParameters", "fitBMAgamma0")
S3method("modelParameters", "fitBMAnormal")

S3method("pit", "ensembleBMAgamma")
S3method("pit", "ensembleBMAgamma0")
S3method("pit", "ensembleBMAnormal")
S3method("pit", "fitBMAgamma")
S3method("pit", "fitBMAgamma0")
S3method("pit", "fitBMAnormal")

S3method("quantileForecast", "ensembleBMAgamma")
S3method("quantileForecast", "ensembleBMAgamma0")
S3method("quantileForecast", "ensembleBMAnormal")
S3method("quantileForecast", "fitBMAgamma")
S3method("quantileForecast", "fitBMAgamma0")
S3method("quantileForecast", "fitBMAnormal")

S3method("dataNA", "ensembleData")
S3method("dataNobs", "ensembleData")
S3method("dataObsLabels", "ensembleData")
S3method("dataStartupSpeed", "ensembleData")
S3method("dataVerifObs", "ensembleData")
S3method("ensembleFhour", "ensembleData")
S3method("ensembleForecasts", "ensembleData")
S3method("ensembleGroups", "ensembleData")
S3method("ensembleItime", "ensembleData")
S3method("ensembleMembers", "ensembleData")
S3method("ensembleSize", "ensembleData")
S3method("ensembleValidDates", "ensembleData")

S3method("plot", "ensembleBMAgamma")
S3method("plot", "ensembleBMAgamma0")
S3method("plot", "ensembleBMAnormal")
S3method("plot", "fitBMAgamma")
S3method("plot", "fitBMAgamma0")
S3method("plot", "fitBMAnormal")

S3method("[", "ensembleBMAgamma")
S3method("[", "ensembleBMAgamma0")
S3method("[", "ensembleBMAnormal")

#importFrom("fields","image.plot","US","world")
#importFrom("maps","map")
