.. index:: single: exponential_smoothing_common
.. _exponential_smoothing_common/0:

.. rst-class:: right

**category**

``exponential_smoothing_common``
================================

Shared fitting and forecasting predicates for exponential smoothing models.

| **Availability:** 
|    ``logtalk_load(exponential_smoothing(loader))``

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-10-02

| **Compilation flags:**
|    ``static``


| **Uses:**
|    :ref:`deque <deque/0>`
|    :ref:`list <list/0>`
|    :ref:`numberlist <numberlist/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|    (none)

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

.. index:: finite_number/1
.. _exponential_smoothing_common/0::finite_number/1:

``finite_number/1``
^^^^^^^^^^^^^^^^^^^

True when the argument is a finite integer or floating point number.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``finite_number(Number)``
| **Mode and number of proofs:**
|    ``finite_number(+term)`` - ``zero_or_one``


------------

.. index:: observed_series/2
.. _exponential_smoothing_common/0::observed_series/2:

``observed_series/2``
^^^^^^^^^^^^^^^^^^^^^

Returns the known observations from a validated numeric-or-unbound series without binding missing observations.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``observed_series(Series,ObservedSeries)``
| **Mode and number of proofs:**
|    ``observed_series(+list,-list(number))`` - ``one``


------------

.. index:: fit_smoothing/9
.. _exponential_smoothing_common/0::fit_smoothing/9:

``fit_smoothing/9``
^^^^^^^^^^^^^^^^^^^

Fits the selected exponential smoothing method using fixed parameters and the requested initialization strategy. Unbound observations advance predictions and seasonal phase without being scored, instantiated, or updating smoothing components.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``fit_smoothing(Method,Series,Frequency,Parameters,InitializationSpecification,State,SumSquaredError,ErrorCount,Residuals)``
| **Mode and number of proofs:**
|    ``fit_smoothing(+atom,+list,+term,+list(float),+compound,-compound,-float,-non_negative_integer,-list(float))`` - ``one_or_error``

| **Exceptions:**
|    Initialization has too few known observations:
|        ``domain_error(insufficient_known_observations,Initialization)``
|    A seasonal phase has no known initialization observation:
|        ``domain_error(insufficient_seasonal_phase_observations,Phase)``
|    The multiplicative Holt-Winters level update is not positive:
|        ``domain_error(positive_multiplicative_level,Level)``
|    Fitting or initialization arithmetic fails:
|        ``evaluation_error(Error)``


------------

.. index:: update_smoothing/7
.. _exponential_smoothing_common/0::update_smoothing/7:

``update_smoothing/7``
^^^^^^^^^^^^^^^^^^^^^^

Updates a learned smoothing state with one observation by applying the same fixed-parameter transition used during batch fitting. The returned residual list is empty for a skipped missing observation and a singleton for an observed value.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``update_smoothing(Method,State,Parameters,Observation,UpdatedState,SumSquaredErrorIncrement,Residuals)``
| **Mode and number of proofs:**
|    ``update_smoothing(+atom,+compound,+list(float),+term,-compound,-float,-list(float))`` - ``one_or_error``

| **Exceptions:**
|    The multiplicative Holt-Winters level update is not positive:
|        ``domain_error(positive_multiplicative_level,Level)``
|    Update arithmetic fails:
|        ``evaluation_error(Error)``


------------

.. index:: forecast_smoothing/4
.. _exponential_smoothing_common/0::forecast_smoothing/4:

``forecast_smoothing/4``
^^^^^^^^^^^^^^^^^^^^^^^^

Generates forecasts for the selected exponential smoothing method from a learned final state.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``forecast_smoothing(Method,State,Horizon,Forecasts)``
| **Mode and number of proofs:**
|    ``forecast_smoothing(+atom,+compound,+non_negative_integer,-list(number))`` - ``one_or_error``

| **Exceptions:**
|    A multiplicative Holt-Winters forecast is not positive:
|        ``domain_error(positive_multiplicative_forecast,Forecast)``


------------

.. index:: initial_parameter_point/2
.. _exponential_smoothing_common/0::initial_parameter_point/2:

``initial_parameter_point/2``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Builds the optimizer initial point from the parameters whose option value is ``auto``.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``initial_parameter_point(ParameterSpecification,Point)``
| **Mode and number of proofs:**
|    ``initial_parameter_point(+list(compound),-list(float))`` - ``one``


------------

.. index:: parameter_bounds/2
.. _exponential_smoothing_common/0::parameter_bounds/2:

``parameter_bounds/2``
^^^^^^^^^^^^^^^^^^^^^^

Builds closed unit-interval bounds for the parameters whose option value is ``auto``.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``parameter_bounds(ParameterSpecification,Bounds)``
| **Mode and number of proofs:**
|    ``parameter_bounds(+list(compound),-list(pair(float)))`` - ``one``


------------

.. index:: parameters_from_point/3
.. _exponential_smoothing_common/0::parameters_from_point/3:

``parameters_from_point/3``
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Combines fixed parameter option values and an optimizer point into the canonical numeric parameter list.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``parameters_from_point(ParameterSpecification,Point,Parameters)``
| **Mode and number of proofs:**
|    ``parameters_from_point(+list(compound),+list(float),-list(float))`` - ``one``


------------

.. index:: optimization_initial_point/6
.. _exponential_smoothing_common/0::optimization_initial_point/6:

``optimization_initial_point/6``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Builds the joint optimizer initial point for automatic smoothing parameters and, when requested, the initial model state.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``optimization_initial_point(Method,Series,Frequency,ParameterSpecification,InitializationSpecification,Point)``
| **Mode and number of proofs:**
|    ``optimization_initial_point(+atom,+list(number),+term,+list(compound),+compound,-list(float))`` - ``one``


------------

.. index:: optimization_bounds/6
.. _exponential_smoothing_common/0::optimization_bounds/6:

``optimization_bounds/6``
^^^^^^^^^^^^^^^^^^^^^^^^^

Builds finite data-derived bounds for the joint smoothing-parameter and initial-state optimization point.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``optimization_bounds(Method,Series,Frequency,ParameterSpecification,InitializationSpecification,Bounds)``
| **Mode and number of proofs:**
|    ``optimization_bounds(+atom,+list(number),+term,+list(compound),+compound,-list(pair(float)))`` - ``one``


------------

.. index:: optimization_components/8
.. _exponential_smoothing_common/0::optimization_components/8:

``optimization_components/8``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Decodes a joint optimization point into the canonical smoothing parameter list and effective initialization specification.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``optimization_components(Method,Series,Frequency,ParameterSpecification,InitializationSpecification,Point,Parameters,EffectiveInitializationSpecification)``
| **Mode and number of proofs:**
|    ``optimization_components(+atom,+list(number),+term,+list(compound),+compound,+list(float),-list(float),-compound)`` - ``one``


------------

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

