Skip to content

SIGNED JUMP VARIATION

Intuição

A Signed Jump Variation separa a componente de jumps em partes associadas a retornos positivos e negativos, capturando assimetria (jumps “bons” vs “ruins”).

Definição

Com RSV+, RSV- e BV:

  • ΔJ+_t = max(RSV+_t - BV_t/2, 0)
  • ΔJ-_t = max(RSV-_t - BV_t/2, 0)

A função retorna um DataFrame com as colunas signed_jump_pos e signed_jump_neg.

Uso

from quantmaster.features.volatility import signed_jump_variation

out = signed_jump_variation(df)
# df = df.join(out)

API

Source code in src/quantmaster/features/volatility.py
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
def signed_jump_variation(
    data: pd.DataFrame | pd.Series,
    *,
    price_col: str = "close",
    log_returns: bool = True,
) -> pd.DataFrame:
    rsv = realized_semivariance(data, price_col=price_col, log_returns=log_returns)
    bv = bipower_variation(data, price_col=price_col, log_returns=log_returns).astype(float)

    half_bv = bv / 2.0
    pos = (rsv["rsv_pos"].astype(float) - half_bv).clip(lower=0.0)
    neg = (rsv["rsv_neg"].astype(float) - half_bv).clip(lower=0.0)

    out = pd.DataFrame(index=rsv.index)
    out["signed_jump_pos"] = pos
    out["signed_jump_neg"] = neg
    return out