Skip to content

add a function like R's filter() function for computing running averages for plotting etc. #550

@bhaller

Description

@bhaller

@vsudbrack suggests that a running average function would be useful; he is doing:

function (float)running_mean(lif y, [integer$ window = 3])
{
    half_window = asInteger(floor(window / 2));
    y_mean = rep(NAN, length(y));
    for (i in half_window:(length(y) - half_window - 1))
        y_mean[i] = mean(y[(i - half_window):(i + half_window)]);
    return y_mean;
}

R's filter() function would be perhaps good functionality to aim for, at least in part. Food for thought.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions