venumML.time_series.Phineus.phineus_rolling_average
def
rolling_average(ctx, values, window):
Computes the rolling average of an encrypted array with a specified window size.
Parameters
- ctx (EncryptionContext): The encryption context used to encrypt the initial rolling average array.
- values (np.ndarray): Encrypted array of input values.
- window (int): The size of the window over which to compute the rolling average.
Returns
- np.ndarray: Encrypted array containing the rolling averages for each position in the input array.
Notes
For the first few elements where the window size is not fully available, the function calculates the average over the available elements up to the current position.