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", "text", "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,
  AddSharedLocalLevel,
  AddStaticIntercept,
  AddStudentLocalLinearTrend,
  AddTrig,
  AggregateTimeSeries,
  AggregateWeeksToMonths,
  bsts,
  bsts.mixed,
  bsts.prediction.errors,
  BstsOptions,
  CompareBstsModels,
  DateRange,
  DateRangeHoliday,
  DateToPOSIX,
  DayPlot,
  dirm,
  DirmModelOptions,
  DynamicRegressionArOptions,
  DynamicRegressionHierarchicalRandomWalkOptions,
  DynamicRegressionRandomWalkOptions,
  EstimateTimeScale,
  ExtendTime,
  FixedDateHoliday,
  GeometricSequence,
  GetFractionOfDaysInInitialMonth,
  GetFractionOfDaysInInitialQuarter,
  HarveyCumulator,
  HasDuplicateTimestamps,
  IsRegular,
  LastDayInMonth,
  LastWeekdayInMonthHoliday,
  LongToWide,
  MATCH.NumericTimestamps,
  MatchWeekToMonth,
  MaxWindowWidth,
  MaxWindowWidth.default,
  MaxWindowWidth.DateRangeHoliday,
  mbsts,
  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,
  plot.mbsts,
  plot.mbsts.prediction,
  predict.mbsts,
  PlotMbstsSeriesMeans,
  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,
  WideToLong,
  YearMonToPOSIX,
  YearPlot)

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

S3method(plot, bsts.prediction)

S3method(plot, bsts.mixed)

S3method(plot, mbsts)
S3method(predict, mbsts)
S3method(plot, mbsts.prediction)

# 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)
