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: – IntegerInput
-
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: – IntegerInput
-
On entry: the number of terms of the time series being generated.
Constraint:
.
- 3: – IntegerInput
-
On entry: the smoothing function.
- Single exponential.
- Brown's double exponential.
- Linear Holt.
- Additive Holt–Winters.
- Multiplicative Holt–Winters.
Constraint:
, , , or .
- 4: – IntegerInput
-
On entry: if
or
, the seasonal order,
, otherwise
p is not referenced.
Constraint:
if or , .
- 5: – Real (Kind=nag_wp) arrayInput
-
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) arrayInput
-
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) arrayInput/Output
-
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 arrayCommunication 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) arrayInput
-
On entry: if
and
, a vector from which the errors,
are randomly drawn, with replacement.
If
,
e is not referenced.
- 11: – IntegerInput
-
On entry: if
, the length of the vector
e.
If both and then
, for .
- 12: – Real (Kind=nag_wp) arrayOutput
-
On exit: the generated time series,
, for .
- 13: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value 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.