tsEvaNanRunningMean {RtsEva}R Documentation

Calculate the running mean of a time series with NaN handling

Description

This function calculates the running mean of a time series, taking into account NaN values. It uses a sliding window approach to calculate the mean, where the window size is specified by the user. If the number of non-NaN values within the window is greater than a threshold, the mean is calculated. Otherwise, NaN is returned.

Usage

tsEvaNanRunningMean(series, windowSize)

Arguments

series

The input time series

windowSize

The size of the sliding window

Value

A vector containing the running mean of the time series

Examples

series <- c(1,2,NaN,4,5,6,NaN,8,9,4,5,6,7,3,9,1,0,4,5,2)
windowSize <- 3
result <- tsEvaNanRunningMean(series, windowSize)
print(result)


[Package RtsEva version 1.0.0 Index]