.. index:: single: baseline_forecasting
.. _baseline_forecasting/0:

.. rst-class:: right

**object**

``baseline_forecasting``
========================

Naive, seasonal naive, mean, and drift time series forecasters with missing observations and immutable online updates.

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

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

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Imports:**
|    ``public`` :ref:`forecaster_common <forecaster_common/0>`
| **Uses:**
|    :ref:`format <format/0>`
|    :ref:`list <list/0>`
|    :ref:`type <type/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`forecaster_protocol/0::check_forecaster/1`  :ref:`options_protocol/0::check_option/1`  :ref:`options_protocol/0::check_options/1`  :ref:`options_protocol/0::default_option/1`  :ref:`options_protocol/0::default_options/1`  :ref:`forecaster_protocol/0::diagnostic/2`  :ref:`forecaster_protocol/0::diagnostics/2`  :ref:`forecaster_protocol/0::export_to_clauses/4`  :ref:`forecaster_protocol/0::export_to_file/4`  :ref:`forecaster_protocol/0::forecast/3`  :ref:`forecaster_protocol/0::forecaster_options/2`  :ref:`forecaster_protocol/0::learn/2`  :ref:`forecaster_protocol/0::learn/3`  :ref:`options_protocol/0::option/2`  :ref:`options_protocol/0::option/3`  :ref:`forecaster_protocol/0::print_forecaster/1`  :ref:`forecaster_protocol/0::valid_forecaster/1`  :ref:`options_protocol/0::valid_option/1`  :ref:`options_protocol/0::valid_options/1`  

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

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

.. index:: update/3
.. _baseline_forecasting/0::update/3:

``update/3``
^^^^^^^^^^^^

Returns a new forecaster after appending a numeric or missing (unbound) observation. The original forecaster is not modified.

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

| **Template:**
|    ``update(Forecaster,Observation,UpdatedForecaster)``
| **Mode and number of proofs:**
|    ``update(+compound,@term,-compound)`` - ``one_or_error``

| **Exceptions:**
|    ``Forecaster`` is a variable:
|        ``instantiation_error``
|    ``Forecaster`` is not a valid baseline forecaster:
|        ``domain_error(forecaster,Forecaster)``
|    ``Observation`` is neither a variable nor a number:
|        ``type_error(number,Observation)``
|    Updating the numeric sum raises an arithmetic evaluation error:
|        ``evaluation_error(Error)``


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

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

(no local declarations; see entity ancestors if any)

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

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

