g05pmf returns
, a realization of a time series from an exponential smoothing model defined by one of five smoothing functions:
- Single Exponential Smoothing
- Brown Double Exponential Smoothing
- Linear Holt Exponential Smoothing
- Additive Holt–Winters Smoothing
- Multiplicative Holt–Winters Smoothing
where
is the mean,
is the trend and
is the seasonal component at time
with
being the seasonal order. The errors,
are either drawn from a normal distribution with mean zero and variance
or randomly sampled, with replacement, from a user-supplied vector.
-
1:
– Integer
Input
-
On entry: indicates if
g05pmf is continuing from a previous call or, if not, how the initial values are computed.
- Values for , and
, for , are supplied in init.
- g05pmf continues from a previous call using values that are supplied in r. r is not updated.
- g05pmf continues from a previous call using values that are supplied in r. r is updated.
Constraint:
, or .
-
2:
– Integer
Input
-
On entry: the number of terms of the time series being generated.
Constraint:
.
-
3:
– Integer
Input
-
On entry: the smoothing function.
- Single exponential.
- Brown's double exponential.
- Linear Holt.
- Additive Holt–Winters.
- Multiplicative Holt–Winters.
Constraint:
, , , or .
-
4:
– Integer
Input
-
On entry: if
or
, the seasonal order,
, otherwise
p is not referenced.
Constraint:
if or , .
-
5:
– Real (Kind=nag_wp) array
Input
Note: the dimension of the array
param
must be at least
if
or
,
if
and at least
if
or
.
On entry: the smoothing parameters.
If
or
,
and any remaining elements of
param are not referenced.
If
,
,
,
and any remaining elements of
param are not referenced.
If
or
,
,
,
and
and any remaining elements of
param are not referenced.
Constraints:
- if , ;
- if , ;
- if , and and ;
- if or , and and and .
-
6:
– Real (Kind=nag_wp) array
Input
Note: the dimension of the array
init
must be at least
if
,
if
or
and at least
if
or
.
On entry: if
, the initial values for
,
and
, for
, used to initialize the smoothing.
If
,
and any remaining elements of
init are not referenced.
If
or
,
and
and any remaining elements of
init are not referenced.
If
or
,
,
and
to
hold the values for
, for
. Any remaining elements of
init are not referenced.
-
7:
– Real (Kind=nag_wp)
Input
-
On entry: the variance, of the Normal distribution used to generate the errors . If then Normally distributed errors are not used.
-
8:
– Real (Kind=nag_wp) array
Communication Array
Note: the dimension of the array
r
must be at least
if
,
or
and at least
if
or
.
On entry: if
or
,
r must contain the values as returned by a previous call to
g05pmf,
r need not be set otherwise.
On exit: if
,
r is unchanged. Otherwise,
r contains the information on the current state of smoothing.
Constraint:
if
or
,
r must have been initialized by at least one call to
g05pmf or
g13amf with
, and
r must not have been changed since that call.
-
9:
– Integer array
Communication Array
Note: the actual argument supplied
must be the array
state supplied to the initialization routines
g05kff or
g05kgf.
On entry: contains information on the selected base generator and its current state.
On exit: contains updated information on the state of the generator.
-
10:
– Real (Kind=nag_wp) array
Input
-
On entry: if
and
, a vector from which the errors,
are randomly drawn, with replacement.
If
,
e is not referenced.
-
11:
– Integer
Input
-
On entry: if
, the length of the vector
e.
If both and then
, for .
-
12:
– Real (Kind=nag_wp) array
Output
-
On exit: the generated time series,
, for .
-
13:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Not applicable.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
This example reads
observations from a time series relating to the rate of the earth's rotation about its polar axis and fits an exponential smoothing model using
g13amf.