BSkyHoltWintersSeasonal: Exponential smoothing

BSkyHoltWintersSeasonalR Documentation

Exponential smoothing

Description

BSkyHoltWintersSeasonal is a wrapper function for HoltWinters from package stats that computes Holt-Winters Filtering of a given time series. Unknown parameters are determined by minimizing the squared prediction error. Internally calls HoltWinters with gamma parameter used for the seasonal component set to FALSE, beta parameter of Holt-Winters Filter is set to FALSE to do exponential smoothing and seasonal = "None".

Usage

BSkyHoltWintersSeasonal(
  vars,
  start,
  frequency,
  seasonal = "add",
  exponential = FALSE,
  plotSeries = TRUE,
  saveFitted = FALSE,
  fittedValsDatasetName = "",
  plotOriginalandForecast = FALSE,
  predict = FALSE,
  periodToPredict = 0,
  savePredictedVals = FALSE,
  predictedValsDatasetName = "",
  plotPredictedValues = FALSE,
  correlogram = FALSE,
  lag.max = 0,
  Ljung_Boxtest = FALSE,
  maintitle = "",
  ylab = "",
  dataset,
  excludeEnvPrefix = FALSE
)

Arguments

vars

select a variable to build a model for

start

Time of first observation should be entered in the format year,month or year,quarter e.g.( if your data is organized in months the 1992,1 for Jan 1992 or if your data is organized in quarters then 1992,1 refers to the first quarter of 1992.

frequency

Number of observations in unit time. Example: for monthly there are 12 observation in a year. For quarterly there are 4 observation in a year.

seasonal

a character string "None" for exponential smoothing.

exponential

Determines whether exponential smoothing will be done, value set to TRUE

plotSeries

if TRUE a time series plot will also be generated.

saveFitted

if TRUE fit values are saved.

plotOriginalandForecast

Plot original and forecasted series

predict

if TRUE predicted values will also be generated.

savePredictedVals

predicted values will be saved.

plotPredictedValues

predicted values will also be plotted.

correlogram

if TRUE a correlogram will be generated.

ylab

title for the y axis

dataset

the name of the dataset from which the variables have been selected

main

main title of the plot

Value

An object of class "HoltWinters", a list with components: fitted: A multiple time series with one column for the filtered series as well as for the level, trend and seasonal components, estimated contemporaneously (that is at time t and not at the end of the series). x: The original series alpha: alpha used for filtering beta: beta used for filtering gamma: gamma used for filtering coefficients: A vector with named components a, b, s1, ..., sp containing the estimated values for the level, trend and seasonal components seasonal: The specified seasonal parameter SSE: The final sum of squared errors achieved in optimizing call: The call used


BlueSkyStatistics/BlueSky documentation built on Jan. 29, 2025, 4:15 p.m.