.. index:: single: time_series_regression .. _time_series_regression/0: .. rst-class:: right **object** ``time_series_regression`` ========================== Autoregressive (AR) time series forecaster fitted by least squares, with optional intercept, optional differencing (ARI models), automatic order selection using information criteria, and support for missing observations represented as unbound variables. | **Availability:** | ``logtalk_load(time_series_regression(loader))`` | **Author:** Paulo Moura | **Version:** 1:0:0 | **Date:** 2026-10-14 | **Compilation flags:** | ``static, context_switching_calls`` | **Imports:** | ``public`` :ref:`forecaster_common ` | **Uses:** | :ref:`format ` | :ref:`integer ` | :ref:`linear_algebra ` | :ref:`list ` | :ref:`type ` | :ref:`univariate_distributions(Random) ` | **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 .. _time_series_regression/0::update/3: ``update/3`` ^^^^^^^^^^^^ Returns a new forecaster after appending one observation. ``Observation`` may be left an unbound variable to represent a missing observation; see ``update/4``. | **Compilation flags:** | ``static`` | **Template:** | ``update(Forecaster,Observation,UpdatedForecaster)`` | **Mode and number of proofs:** | ``update(+compound,@number,-compound)`` - ``one_or_error`` | **Exceptions:** | ``Forecaster`` is a variable: | ``instantiation_error`` | ``Forecaster`` is neither a variable nor a valid forecaster: | ``domain_error(forecaster,Forecaster)`` | ``Observation`` is neither a variable nor a number: | ``type_error(number,Observation)`` ------------ .. index:: forecast_interval/5 .. _time_series_regression/0::forecast_interval/5: ``forecast_interval/5`` ^^^^^^^^^^^^^^^^^^^^^^^ Computes analytic prediction interval bounds for the next ``Horizon`` forecasts of a learned forecaster, assuming independent, identically distributed, zero-mean Gaussian innovations and treating the fitted coefficients as known. The ``h``-step forecast error variance is the residual variance times the sum of the squared ``psi`` weights ``psi(0)..psi(h-1)`` of the (integrated) model, and the bounds are the point forecast plus or minus the standard normal quantile for the requested confidence times the forecast error standard deviation. The residual variance is the sum of squared errors divided by the residual degrees of freedom (the number of scored observations minus the design matrix rank). A zero horizon returns two empty lists. | **Compilation flags:** | ``static`` | **Template:** | ``forecast_interval(Forecaster,Horizon,Lower,Upper,Options)`` | **Mode and number of proofs:** | ``forecast_interval(+compound,+non_negative_integer,-list(number),-list(number),+list(compound))`` - ``one_or_error`` | **Exceptions:** | ``Forecaster`` is a variable: | ``instantiation_error`` | ``Forecaster`` is neither a variable nor a valid forecaster: | ``domain_error(forecaster,Forecaster)`` | ``Horizon`` is a variable: | ``instantiation_error`` | ``Horizon`` is neither a variable nor an integer: | ``type_error(integer,Horizon)`` | ``Horizon`` is an integer but is negative: | ``domain_error(non_negative_integer,Horizon)`` | ``Options`` is a variable or a partial list: | ``instantiation_error`` | ``Options`` is neither a variable nor a list: | ``type_error(list,Options)`` | An option is a variable or has an unbound argument: | ``instantiation_error`` | An option is neither a variable nor a compound term: | ``type_error(compound,Option)`` | An option is a compound term but is not a valid interval option: | ``domain_error(option,Option)`` | ``Horizon`` is positive and the forecaster has no residual degrees of freedom (an exactly determined fit): | ``domain_error(residual_degrees_of_freedom,Forecaster)`` ------------ Protected predicates -------------------- (no local declarations; see entity ancestors if any) Private predicates ------------------ (no local declarations; see entity ancestors if any) Operators --------- (none) .. seealso:: :ref:`forecaster_protocol `, :ref:`time_series_dataset_protocol `