{
  "method": "DELELSTM_BLOCK",
  "slug": "delelstm-block",
  "title": "DeLELSTM block: level, slope and phase",
  "summary": "A Holt-style recurrence updates a level and slope on the prefix; its last slope extrapolates the trend afterward. The next step uses phase-wise means of the detrended prefix. The frames expose those buckets, their cumulative averages and the repeated seasonal output. The implemented trend is a level/slope recurrence with a phase template. No LSTM cell is trained or evaluated.",
  "steps": [
    {
      "title": "Update level and slope",
      "text": "A Holt-style recurrence updates a level and slope on the prefix; its last slope extrapolates the trend afterward."
    },
    {
      "title": "Average equal seasonal phases",
      "text": "Subtract the trend on the fitting prefix. Group samples by index modulo the specified period and average each phase bucket."
    },
    {
      "title": "Repeat the phase template",
      "text": "Tile the fitted phase means over the record. The suffix does not update the template in this prefix configuration."
    },
    {
      "title": "Inspect the derived residual",
      "text": "Compute input minus the implemented trend and seasonal estimate. This residual is part of a retrospective decomposition, not a forecast score."
    }
  ],
  "parameters": [
    {
      "name": "alpha / beta",
      "effect": "Control level and slope updates in the implemented Holt recurrence; no LSTM cell is evaluated."
    },
    {
      "name": "primary_period",
      "effect": "Defines phase buckets in samples; the fitting prefix must contain enough cycles for an interpretable average."
    },
    {
      "name": "fit_scope / train_fraction",
      "effect": "Explicitly selects a two-thirds prefix in this example; it does not create a rolling forecasting evaluation."
    }
  ],
  "cautions": [
    "The implemented trend is a level/slope recurrence with a phase template. No LSTM cell is trained or evaluated.",
    "Prefix fitting is a fixed fitting convention. It does not certify rolling causality or an out-of-sample prediction experiment.",
    "A repeated phase template assumes that the fitted seasonal shape remains useful over the displayed suffix.",
    "The residual is derived by subtraction; exact reconstruction does not validate the scientific interpretation of either component."
  ],
  "references": [
    {
      "title": "Implemented DeTime operator",
      "url": "https://github.com/systems-mechanobiology/DeTime/blob/main/src/detime/methods/neural_blocks/neural_block_portfolio.py"
    },
    {
      "title": "Wang et al. (2023), DeLELSTM: Decomposition-based Linear Explainable LSTM to Capture Instantaneous and Long-term Effects in Time Series",
      "url": "https://arxiv.org/abs/2308.13797"
    }
  ],
  "trace_kind": "computed_operator_trace",
  "trace_note": "Intermediate arrays are computed with the implemented operator helpers. The final trend, season and residual are checked against public decompose(). The animation explains this standalone experimental block; its source architecture is cited for provenance.",
  "input_note": "Deterministic synthetic teaching signal; not a benchmark.",
  "example_config": {
    "method": "DELELSTM_BLOCK",
    "params": {
      "primary_period": 24,
      "fit_scope": "prefix",
      "train_fraction": 0.6666666666666666,
      "alpha": 0.4,
      "beta": 0.2
    },
    "backend": "python"
  },
  "checks": {
    "public_method_executed": true,
    "method_output_max_abs_errors": {
      "trend": 0.0,
      "season": 0.0,
      "residual": 0.0
    },
    "reconstruction_max_abs_error": 4.440892098500626e-16,
    "validation_scope": "One deterministic teaching input; no benchmark claim.",
    "fit_end": 96
  },
  "source_files": [
    "src/detime/methods/neural_blocks/neural_block_portfolio.py"
  ],
  "frames": 32,
  "duration_ms": 12050,
  "poster_frame": 15,
  "width": 1280,
  "height": 820,
  "artifacts": {
    "gif": {
      "file": "delelstm-block.gif",
      "bytes": 335104,
      "sha256": "17692b1686cabde00e6c967fddc150703b27e6f4777f154e8944df9512ab1c40"
    },
    "poster": {
      "file": "delelstm-block.png",
      "bytes": 122208,
      "sha256": "70f9733688c7f368d1c94cf9c661a25947b0243673ba8240048b995d979fa71c"
    },
    "data": {
      "file": "delelstm-block.npz",
      "bytes": 8790,
      "sha256": "712d097fcb5d5e29e55e8030afe530ec689599d8a8d8371a64b1c07371c71221"
    }
  },
  "source_arrays": {
    "observed": [
      144
    ],
    "trend_candidates": [
      1,
      144
    ],
    "trend": [
      144
    ],
    "detrended": [
      144
    ],
    "prefix_phase_matrix": [
      4,
      24
    ],
    "raw_template": [
      144
    ],
    "season": [
      144
    ],
    "residual": [
      144
    ],
    "fit_end": []
  },
  "render_provenance": {
    "python_version": "3.12.14",
    "dependencies": {
      "numpy": "2.3.5",
      "scipy": "1.17.0",
      "statsmodels": "0.15.0",
      "matplotlib": "3.10.8",
      "Pillow": "12.3.0",
      "PyWavelets": "1.10.0",
      "EMD-signal": "1.10.0",
      "vmdpy": "0.2",
      "PySDKit": "0.5.0"
    },
    "source_hashes": {
      "scripts/generate_method_animations.py": "f62989af55a7e48495c24afcfee31751d3785e5f78bb4b900bef23a429deaa84",
      "scripts/method_animations/common.py": "73ad7e8b4e5b67f87d13e59adab2c93e983fe1aaf06ee627d22cb7c7e696016a",
      "scripts/method_animations/neural.py": "fc1c2a73490391f0f863ede52e38f12924cc1fec572b7188356a2308216716e6",
      "src/detime/backends.py": "7432dcf59e382580dfb32f1f57e61ff71a30567c049b35243e24e3644523eda6",
      "src/detime/core.py": "d95b348cd8b16b56d18840965579c947a11628d969dd6c32c4af7723f5a027f4",
      "src/detime/methods/neural_blocks/neural_block_portfolio.py": "2aab635b9927d1d42bbcd8e0b4f37cb9fcdcf85cbd0331b5011621b495c4acfa",
      "src/detime/registry.py": "e934ffca17880cefe5add728aa497e63ea811d7ae43abec1ea498de718094066"
    }
  }
}
