Skip to content

Instantly share code, notes, and snippets.

View sitmo's full-sized avatar

Thijs van den Berg sitmo

View GitHub Profile
@sitmo
sitmo / calculate_iq_cov_matrix.py
Created October 25, 2024 16:18
Squeezing Financial Noise: A Novel Approach to Covariance Matrix Estimation
import numpy as np
def calculate_iq_cov_matrix(returns, delta_params, eta_weights, tau, epsilon, gamma):
"""
Calculate the IQ-based covariance matrix.
Parameters:
- returns: Matrix of asset returns, shape (T, N), where T is time and N is assets.
- delta_params: Boundary parameters defining squeezing channels.
- eta_weights: Array of squeezing weights for each channel.