nodejs-polars
    Preparing search index...

    Interface EwmOps<T>

    Exponentially-weighted operations that can be applied to a Series and Expr

    interface EwmOps<T> {
        ewmMean(
            alpha?: number,
            adjust?: boolean,
            minPeriods?: number,
            bias?: boolean,
            ignoreNulls?: boolean,
        ): T;
        ewmMean(
            opts: {
                adjust?: boolean;
                alpha?: number;
                bias?: boolean;
                ignoreNulls?: boolean;
                minPeriods?: number;
            },
        ): T;
        ewmMean(): T;
        ewmStd(
            alpha?: number,
            adjust?: boolean,
            minPeriods?: number,
            bias?: boolean,
            ignoreNulls?: boolean,
        ): T;
        ewmStd(
            opts: {
                adjust?: boolean;
                alpha?: number;
                bias?: boolean;
                ignoreNulls?: boolean;
                minPeriods?: number;
            },
        ): T;
        ewmStd(): T;
        ewmVar(
            alpha?: number,
            adjust?: boolean,
            minPeriods?: number,
            bias?: boolean,
            ignoreNulls?: boolean,
        ): T;
        ewmVar(
            opts: {
                adjust?: boolean;
                alpha?: number;
                bias?: boolean;
                ignoreNulls?: boolean;
                minPeriods?: number;
            },
        ): T;
        ewmVar(): T;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Methods

    • Exponentially-weighted moving average.

      Parameters

      • Optionalalpha: number

        Specify smoothing factor alpha directly, :math:0 < \alpha \leq 1.

      • Optionaladjust: boolean

        Divide by decaying adjustment factor in beginning periods to account for imbalance in relative weightings - When adjust: true the EW function is calculated using weights :math:w_i = (1 - \alpha)^i - When adjust=false the EW function is calculated recursively

      • OptionalminPeriods: number

        Minimum number of observations in window required to have a value (otherwise result is null).

      • Optionalbias: boolean

        When bias: false, apply a correction to make the estimate statistically unbiased.

      • OptionalignoreNulls: boolean

        Ignore missing values when calculating weights. - When ignoreNulls: false (default), weights are based on absolute positions. - When ignoreNulls: true, weights are based on relative positions.

      Returns T

      Expr that evaluates to a float 64 Series.

      > const df = pl.DataFrame({a: [1, 2, 3]});
      > df.select(pl.col("a").ewmMean())
      shape: (3, 1)
      ┌──────────┐
      a
      | --- │
      f64
      ╞══════════╡
      1.0
      1.666667
      2.428571
      └──────────┘
    • Parameters

      • opts: {
            adjust?: boolean;
            alpha?: number;
            bias?: boolean;
            ignoreNulls?: boolean;
            minPeriods?: number;
        }

      Returns T

    • Exponentially-weighted standard deviation.

      Parameters

      • Optionalalpha: number

        Specify smoothing factor alpha directly, :math:0 < \alpha \leq 1.

      • Optionaladjust: boolean

        Divide by decaying adjustment factor in beginning periods to account for imbalance in relative weightings - When adjust: true the EW function is calculated using weights :math:w_i = (1 - \alpha)^i - When adjust: false the EW function is calculated recursively

      • OptionalminPeriods: number

        Minimum number of observations in window required to have a value (otherwise result is null).

      • Optionalbias: boolean

        When bias: false, apply a correction to make the estimate statistically unbiased.

      • OptionalignoreNulls: boolean

        Ignore missing values when calculating weights. - When ignoreNulls: false (default), weights are based on absolute positions. For example, the weights of :math:x_0 and :math:x_2 used in calculating the final weighted average of - When ignoreNulls: true, weights are based on relative positions.

      Returns T

      Expr that evaluates to a float 64 Series.

      > const df = pl.DataFrame({a: [1, 2, 3]});
      > df.select(pl.col("a").ewmStd())
      shape: (3, 1)
      ┌──────────┐
      a
      | --- │
      f64
      ╞══════════╡
      0.0
      0.707107
      0.963624
      └──────────┘
    • Parameters

      • opts: {
            adjust?: boolean;
            alpha?: number;
            bias?: boolean;
            ignoreNulls?: boolean;
            minPeriods?: number;
        }

      Returns T

    • Exponentially-weighted variance.

      Parameters

      • Optionalalpha: number

        Specify smoothing factor alpha directly, :math:0 < \alpha \leq 1.

      • Optionaladjust: boolean

        Divide by decaying adjustment factor in beginning periods to account for imbalance in relative weightings - When adjust: true the EW function is calculated using weights :math:w_i = (1 - \alpha)^i - When adjust: false the EW function is calculated recursively

      • OptionalminPeriods: number

        Minimum number of observations in window required to have a value (otherwise result is null).

      • Optionalbias: boolean

        When bias: false, apply a correction to make the estimate statistically unbiased.

      • OptionalignoreNulls: boolean

        Ignore missing values when calculating weights. - When ignoreNulls: false (default), weights are based on absolute positions. - When ignoreNulls=true, weights are based on relative positions.

      Returns T

      Expr that evaluates to a float 64 Series.

      > const df = pl.DataFrame({a: [1, 2, 3]});
      > df.select(pl.col("a").ewmVar())
      shape: (3, 1)
      ┌──────────┐
      a
      | --- │
      f64
      ╞══════════╡
      0.0
      0.5
      0.928571
      └──────────┘
    • Parameters

      • opts: {
            adjust?: boolean;
            alpha?: number;
            bias?: boolean;
            ignoreNulls?: boolean;
            minPeriods?: number;
        }

      Returns T