Skip to content

Main content

Hac One Lag Covariance Weight Tool

One Bartlett-kernel lag contribution; no automatic factor-of-two symmetrization or bandwidth selection.

Loading tool…

Description

bartlettWeight = 1-lag/(bandwidth+1) for lag <= bandwidth, otherwise zero; contribution = bartlettWeight*covariance.

Regression diagnostics and robust covariance calculations combine design information, residual terms and estimator-specific normalization. One leverage quadratic form, outer product or correction factor is only part of the full procedure.

bartlettWeight = 1-lag/(bandwidth+1) for lag <= bandwidth, otherwise zero; contribution = bartlettWeight*covariance.

When to use this tool

Use Hac One Lag Covariance Weight when checking one supplied design or covariance contribution.

How to use the tool and how it works

  1. Enter lag, bandwidth, covariance. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read bartlettWeight, contribution. Use the output convention below.

Require nonnegative whole lag and bandwidth. bartlettWeight = 1-lag/(bandwidth+1) for lag <= bandwidth, otherwise zero; contribution = bartlettWeight*covariance.1

HAC covariance estimation can use Bartlett lag weights. A weighted lag contribution alone is not the complete covariance estimator.2

Input fieldMeaning and unitsAccepted input
lagLagRequired. Safe integer; minimum 0.
bandwidthBandwidthRequired. Safe integer; minimum 0.
covarianceCovarianceRequired. Finite number.
Output fieldInterpretationReturned shape
bartlettWeightBartlett WeightRequired. Finite number.
contributionThis operation’s local contribution, to be combined only under the same larger-model convention.Required. Finite number.
json
{
  "input": {
    "lag": 2,
    "bandwidth": 3,
    "covariance": 8
  },
  "output": {
    "bartlettWeight": 0.5,
    "contribution": 4
  }
}

Limitations and assumptions

  • This is one supplied lag covariance term. A complete HAC estimator needs appropriate covariance normalization, both lag directions and an estimator-specific specification.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a complete estimator with matching weighting, clustering, degrees-of-freedom and normalization conventions for inference.

References

  1. Calculation and input contract: econometrics/hac-one-lag-covariance-weight — tool.io

  2. Heteroskedasticity and autocorrelation robust covariance — statsmodels

Similar or alternative tools