Estimation#

Functions used by Long-Range AutoRegression to estimate parameters from training data.

  • estimate_long_range_ar_parameters estimates and returns all parameters of a LongRangeAR instance.

  • vector_temporal_power_spectrum and compute_low_pass_filter_params are used to compute the low-pass filter parameters.

  • least_squares_solution computes the prediction weights of a LongRangeAR model.

Functions#

Functions:

estimate_long_range_ar_parameters(...[, ...])

Estimate the parameters used by an instance of the LongRangeAR class to generate synthetic data.

compute_low_pass_filter_params(...)

Calculates the parameters of a set of low-pass filters given an initial cut-off frequency.

least_squares_solution(data, time_lags, ...)

Uses least-squares regression to estimate the prediction weights for a Long-Range AR model, as described in Long-Range AutoRegression.

vector_temporal_power_spectrum(data_values)

Estimates the Temporal Power Spectrum (TPS) of an input time series of vectors by averaging the 1-D TPS estimates for each vector component (i.e., for each time series of data values at a single vector component).

aomodel.estimation.compute_low_pass_filter_params(initial_cutoff_frequency, num_low_pass_filters)[source]#

Calculates the parameters of a set of low-pass filters given an initial cut-off frequency. For the i-th low-pass filter, the cut-off frequency is i orders of magnitude below the initial cut-off frequency.

Parameters:
  • initial_cutoff_frequency (float) – initial cut-off frequency (in [cycles per time-step]) for the low-pass filters.

  • num_low_pass_filters (int) – number of low-pass filters to create.

Returns:

low_pass_filter_params (ndarray) – numpy 1-D array of length num_low_pass_filters containing the parameters of each low-pass filter.

aomodel.estimation.estimate_long_range_ar_parameters(training_data, time_lags, prediction_window_indices, predicted_components, num_low_pass_filters, low_pass_filter_params=None, cutoff_frequency=None, tps_block_size=None)[source]#

Estimate the parameters used by an instance of the LongRangeAR class to generate synthetic data.

Parameters:
  • training_data (ndarray) – numpy 2-D array of shape (data vector dimensionality, number of time samples) containing the data to fit.

  • time_lags (ndarray) – numpy 1-D array of time lags to use for the model.

  • prediction_window_indices (ndarray) – numpy 2-D integer-valued array of shape (number of predicted vector components, maximum prediction window size) containing the indices for which we calculate prediction weights.

    • In the case that one vector component has a smaller prediction window size than others, the remaining spaces in the row associated to the component should be filled in with -1 (to the right of the true prediction window indices).

  • predicted_components (ndarray) – numpy 1-D integer array containing the indices of the data vector components for which the function will compute prediction weights.

  • num_low_pass_filters (int, optional) – [Default=0] the number of low-pass filters to use in the linear time predictive model.

  • low_pass_filter_params (ndarray, optional) – [Default=None] numpy 1-D array of length num_low_pass_filters containing the parameters of each low-pass filter.

    • If set to None or has length zero, the function assumes that no low-pass filters are used.

  • cutoff_frequency (float, optional) – [Default=None] cutoff frequency (in units of cycles/sample) to use for estimation of the low-pass filter parameters.

    • If set to None and low-pass filters are used, then this function estimates the cutoff frequency as the peak frequency of the temporal power spectrum (TPS) of the training data.

  • tps_block_size (int, optional) – [Default=None] time-block size for calculating the TPS of the training data.

    • If set to None and the low-pass filter parameters need to be estimated, finds the block size so that the TPS estimates are averaged over 100 blocks. This ensures that the signal-to-noise ratio of each 1-D TPS estimate is at least 10.

Returns:

parameters (dict) – a dictionary containing the estimated model parameters with the following keys

  • prediction_weights (ndarray) – numpy 1-D array containing the (concatenated) prediction weights for each vector component.

  • low_pass_filter_params (ndarray) – numpy 1-D array of length num_low_pass_filters containing the parameters of each low-pass filter.

  • residuals_mean (ndarray) – numpy 1-D array of length vector_dimensionality containing the mean vector of the residuals of the least-squares fit.

  • noise_modulation (ndarray) – numpy 2-D array of shape (vector_dimensionality, vector_dimensionality) scaling the (unit-variance) white noise to match the covariance of the residuals.

aomodel.estimation.least_squares_solution(data, time_lags, prediction_window_indices, predicted_components, low_pass_filter_params=None)[source]#

Uses least-squares regression to estimate the prediction weights for a Long-Range AR model, as described in Long-Range AutoRegression. This function takes into account the “prediction window”, which determines which weights to estimate and which to leave as zero. The (non-zero) estimated prediction weights are output in a 1-D array, in the order of the vector components to which they are associated. This solution is partially adapted from [1], which derives the solution for a Vector AR model.

Parameters:
  • data (ndarray) – numpy 2-D array of shape (data vector dimensionality, number of samples) containing the ground-truth data values for the regression calculation.

  • time_lags (ndarray) – numpy 1-D array of time lags to use for the model.

  • prediction_window_indices (ndarray) – numpy 2-D integer-valued array of shape (number of predicted vector components, maximum prediction window size) containing the indices for which to calculate prediction weights.

    • In the case that one vector component has a smaller prediction window size than others, the remaining spaces in the row associated to the component should be filled in with -1 (to the right of the true prediction window indices).

  • predicted_components (ndarray) – numpy 1-D integer array containing the indices of the data vector components for which the function will compute prediction weights.

  • low_pass_filter_params (ndarray, optional) – [Default=None] numpy 1-D array of length num_low_pass_filters containing the parameters of each low-pass filter.

    • If set to None, the function assumes that no low-pass filters are used.

Returns:

  • prediction_weights_array (ndarray) – numpy 1-D array containing the (concatenated) prediction weights for each vector component.

  • residuals (ndarray) – numpy 2-D array of shape (vector dimensionality, num_samples - max(time_lags)) containing the residuals of the linear prediction.

aomodel.estimation.vector_temporal_power_spectrum(data_values, time_block_size=None, sampling_frequency=None, remove_mean=True, use_overlapping_blocks=True)[source]#

Estimates the Temporal Power Spectrum (TPS) of an input time series of vectors by averaging the 1-D TPS estimates for each vector component (i.e., for each time series of data values at a single vector component). Each 1-D TPS is estimated using Welch’s method [9], in which the time series is broken up into independent “blocks” of length time_block_size. A Hamming window is applied to each block and the TPS is estimated using an FFT and a scaling factor which normalizes the variance of the estimate. This function is partially adapted from [2, 3] and is described in detail in [6].

Parameters:
  • data_values (ndarray) – numpy 2-D array of shape (number of time-steps, vector dimensionality) containing the data values. This function requires at least 1,000 time-steps of data.

  • time_block_size (int, optional) – [Default=None] the size of each time block to use for the TPS estimation. This value must be a positive integer and can be at most the number of time-steps in data_values.

    • If set to None, the function finds the block size so that the TPS estimates are averaged over at least 100 blocks. This ensures that the signal-to-noise ratio of each 1-D TPS estimate is at least 10.

  • sampling_frequency (float, optional) – [Default=None] the temporal sampling frequency of the discrete-time signal data_values. This input should be included if the desired TPS units are energy per unit time instead of energy per unit sample. In this case, the frequency bins are in units of cycles per unit time instead of cycles per unit sample.

    • If set to None, the TPS units are energy/sample and the frequency units are cycles/sample.

  • remove_mean (bool, optional) – [Default=True] choice of removing the temporal mean of each vector component before computing the TPS. It is recommended to set this to True in most cases. If set to False, the lowest frequencies may be offset.

  • use_overlapping_blocks (bool, optional) – [Default=True] whether to use overlapping time-blocks when calculating the TPS. If set to True, then the time-blocks will have a 50% overlap. This method allows one to maintain the same block size while also reducing noise in the TPS calculation. If set to False, then the time-blocks will have no overlap.

Returns:

  • frequencies (ndarray) – numpy 1-D array containing the frequency bins of the TPS calculation.

  • tps_estimate (ndarray) – numpy 1-D array containing the TPS estimates for each frequency bin.

Raises:

ValueError – if the input data_values has fewer than 1,000 time-steps.


Disclaimer: Approved for public release; distribution is unlimited. Public Affairs release approval # AFRL-2026-1309.