linearmodels.iv.covariance.kernel_optimal_bandwidth

kernel_optimal_bandwidth(x, kernel='bartlett')[source]
Parameters:
xndarray

Array of data to use when computing optimal bandwidth

kernelstr

Name of kernel to use. Supported kernels include:

  • “bartlett”, “newey-west” - Bartlett’s kernel

  • “parzen”, “gallant” - Parzen’s kernel

  • “qs”, “quadratic-spectral”, “andrews” - Quadratic spectral kernel

Returns:
int

Optimal bandwidth. Set to nobs - 1 if computed bandwidth is larger.

Notes

Todo

  • Explain mathematics involved

  • References

Return type:

int