import(Boom, BoomSpikeSlab, xts, zoo)

importFrom("grDevices", "dev.off", "gray", "pdf", "rainbow")

importFrom("graphics", "abline", "axis", "axis.Date", "axis.POSIXct", "box",
  "boxplot", "hist", "legend", "lines", "par", "plot", "points",
  "polygon", "title", "close.screen", "screen", "split.screen",
  "strheight", "strwidth")

importFrom("stats", ".checkMFClasses", ".getXlevels", "acf", "delete.response",
  "is.ts", "lsfit", "median", "model.frame", "model.frame.default",
  "model.matrix", "model.response", "na.exclude", "na.omit", "na.pass",
  "plogis", "plot.ts", "ppoints", "quantile", "qnorm", "rnorm", "sd", "terms",
  "var", "window")

importFrom("utils", "head", "help", "tail")

export(AcfDist,
  AddAr,
  AddAutoAr,
  AddDynamicRegression,
  AddGeneralizedLocalLinearTrend,
  AddHierarchicalRegressionHoliday,
  AddLocalLevel,
  AddLocalLinearTrend,
  AddMonthlyAnnualCycle,
  AddRandomWalkHoliday,
  AddRegressionHoliday,
  AddSeasonal,
  AddSemilocalLinearTrend,
  AddStaticIntercept,
  AddStudentLocalLinearTrend,
  AddTrig,
  AggregateTimeSeries,
  AggregateWeeksToMonths,
  bsts,
  bsts.mixed,
  bsts.prediction.errors,
  BstsOptions,
  CompareBstsModels,
  DateRange,
  DateRangeHoliday,
  DateToPOSIX,
  DayPlot,
  EstimateTimeScale,
  ExtendTime,
  FixedDateHoliday,
  GeometricSequence,
  GetFractionOfDaysInInitialMonth,
  GetFractionOfDaysInInitialQuarter,
  HarveyCumulator,
  HasDuplicateTimestamps,
  IsRegular,
  LastDayInMonth,
  LastWeekdayInMonthHoliday,
  MATCH.NumericTimestamps,
  MatchWeekToMonth,
  MaxWindowWidth,
  MaxWindowWidth.default,
  MaxWindowWidth.DateRangeHoliday,
  MonthDistance,
  MonthPlot,
  NamedHoliday,
  named.holidays,
  NoDuplicates,
  NoGaps,
  NthWeekdayInMonthHoliday,
  plot.bsts,
  PlotBstsCoefficients,
  PlotBstsComponents,
  PlotBstsForecastDistribution,
  plot.bsts.mixed,
  PlotBstsMixedComponents,
  PlotBstsMixedState,
  plot.bsts.prediction,
  PlotBstsPredictionErrors,
  PlotBstsPredictors,
  PlotBstsResiduals,
  PlotBstsSize,
  PlotBstsState,
  PlotDynamicRegression,
  PlotHoliday,
  PlotSeasonalEffect,
  predict.bsts,
  Quarter,
  qqdist,
  RegularizeTimestamps,
  RegularizeTimestamps.Date,
  RegularizeTimestamps.POSIXt,
  RegularizeTimestamps.default,
  RegularizeTimestamps.numeric,
  residuals.bsts,
  Shorten,
  SimulateFakeMixedFrequencyData,
  SpikeSlabArPrior,
  StateSizes,
  SuggestBurn,
  summary.bsts,
  weekday.names,
  WeekEndsMonth,
  WeekEndsQuarter,
  YearMonToPOSIX,
  YearPlot)

S3method(plot, bsts)
S3method(summary, bsts)
S3method(predict, bsts)
S3method(residuals, bsts)

S3method(plot, bsts.prediction)
S3method(plot, bsts.mixed)

# Plot methods for specific state components
S3method(plot, StateModel)
S3method(plot, HierarchicalRegressionHolidayStateModel)
S3method(plot, RandomWalkHolidayStateModel)
S3method(plot, RegressionHolidayStateModel)
S3method(plot, Seasonal)

S3method(RegularizeTimestamps, default)
S3method(RegularizeTimestamps, numeric)
S3method(RegularizeTimestamps, Date)
S3method(RegularizeTimestamps, POSIXt)

S3method(MATCH, NumericTimestamps)

S3method(MaxWindowWidth, default)
S3method(MaxWindowWidth, DateRangeHoliday)

useDynLib(bsts, .registration = TRUE)
