SMOOTH

The SMOOTH function computes a single or a double exponential smoothing of a numeric expression.

Return Value

DECIMAL

Syntax

SMOOTH(expression {SINGLE alpha|DOUBLE alpha beta m} [BASEDON dimension-list])

Arguments

expression

The numeric expression whose values are to be smoothed.

SINGLE
DOUBLE

The method to use in the exponential smoothing of the values in expression. The SINGLE method specifies single exponential smoothing and requires an alpha argument. The DOUBLE method specifies double exponential smoothing (also known as Holt's linear exponential smoothing) and requires an alpha argument, a beta argument, and an m argument.

alpha

A number in the range from 0 to 1 that smooths the difference between the observed data forecast and the last forecast. The higher the value, the more weight the most recent forecast has, so smoothing decreases as the smoothing factor increases. A smoothing factor of 0 completely smooths the forecasts and always returns the first forecast, which is the first data observation. A smoothing factor of 1 produces no smoothing at all and returns the previous data observation. (See "Results of alpha Values".)

beta

A number in the range from 0 to 1 that smooths the difference between the previous forecast and the current forecast. As with the alpha argument, smoothing decreases as the smoothing factor increases.

m

A positive `INTEGER` between 1 and the total number of periods of data in the data series. The m argument specifies the number of periods on which to base the forecasts.

BASEDON dimension-list

An optional list of one or more of the dimensions of expression to include in the exponential smoothing. When you do not specify the dimensions, then SMOOTH bases the smoothing on all of the dimensions of expression.

Notes

The Effect of NASKIP on SMOOTH

SMOOTH is affected by the NASKIP option. When NASKIP is set to `YES` (the default), then SMOOTH ignores `NA` values. When NASKIP is set to `NO`, then SMOOTH returns `NA` for every forecast after the `NA` value.

Results of alpha Values

This note illustrates the results of using different alpha values for single exponential smoothing. The results are based on the `sales` variable with the dimensions limited by the following statements.

```LIMIT month TO 'Jan96' TO 'Dec96'
LIMIT product TO 'Tents'
LIMIT district TO 'Boston'
REPORT DOWN month SMOOTH(sales, SINGLE, ALPHA, BASEDON month)
```

The following table shows the data values of the `sales` variable and also shows the results of the SMOOTH function in the preceding statement when the alpha argument variable has the different values shown in the table.

MONTH Sales of tents in Boston alpha = 0 alpha = .1 alpha = .5 alpha = .9
Jan96 50,808.96 NA NA NA NA
Feb96 34,641.59 50,808.96 50,808.96 50,808.96 50,808.96
Mar96 45,742.21 50,808.96 49,192.22 42,725.28 36,258.33
Apr96 61,436.19 50,808.96 48,847.22 44,233.74 44,793.82
May96 86,699.67 50,808.96 50,106.12 52,834.97 59,771.95
Jun96 95,120.83 50,808.96 53,765.47 69,767.32 84,006.90
Jul96 93,972.49 50,808.96 57,901.01 82,444.07 94,009.44
Aug96 94,738.05 50,808.96 61,508.16 88,208.28 93,976.18
Sep96 75,407.66 50,808.96 64,831.15 91,473.17 94,661.86
Oct96 70,622.91 50,808.96 65,888.80 83,440.41 77,333.08
Nov96 46,124.99 50,808.96 66,362.21 77,031.66 71,293.93
Dec96 36,938.27 50,808.96 64,338.49 61,578.33 48,641.88

Examples

Example 8-100 Smoothing Values

These statements limit the dimensions of the `sales` variable, set the data column width for reports, and report the data values for `sales`.

```LIMIT month TO 'Jan96' TO 'Dec96'
LIMIT product TO 'Tents'
LIMIT district TO 'Boston'
COLWIDTH = 14

REPORT W 6 DOWN month sales
```

The preceding statements produce the following output.

```DISTRICT: Boston
----SALES-----
---PRODUCT----
MONTH      Tents
------ --------------
Jan96       50,808.96
Feb96       34,641.59
Mar96       45,742.21
Apr96       61,436.19
...
Nov96       46,124.99
Dec96       36,938.27
```

This statement reports the results of using the SMOOTH function on the `sales` variable with the SINGLE method, a data smoothing factor of `.5`, and based on the `month` dimension.

```REPORT W 6 DOWN month SMOOTH(sales, SINGLE, .5, BASEDON month)
```

The preceding statement produces the following output.

```DISTRICT: Boston
SMOOTH(SALES,-
-SINGLE, .5,--
BASEDON MONTH)
---PRODUCT----
MONTH      Tents
------ --------------
Jan96              NA
Feb96       50,808.96
Mar96       42,725.28
Apr96       44,233.74
...
Nov96       77,031.66
Dec96       61,578.33
```