timecorr.eye_weights

Contents

timecorr.eye_weights#

timecorr.eye_weights(T, params={})[source]#

Generate identity (delta) weighting function for dynamic correlations.

This function creates an identity matrix for weighting, where each timepoint only receives weight from itself. Useful for computing instantaneous correlations without temporal smoothing.

Parameters:
Tint

Number of timepoints in the timeseries

paramsdict, optional

Empty dictionary (no parameters needed). Default: {}

Returns:
numpy.ndarray

T x T identity matrix where weights[i,j] = 1 if i==j, else 0

Examples

>>> import timecorr as tc
>>> weights = tc.eye_weights(50, {})
>>> print(weights.shape)  # (50, 50)
>>> print(weights[0, 0])  # 1.0
>>> print(weights[0, 1])  # 0.0