Weighted Permutation Entropy (WPE)
- Weighted Permutation Entropy (WPE) is an amplitude-aware, model-free measure that computes time series complexity using ordinal patterns and variance-based weights.
- It refines traditional permutation entropy by incorporating local variance, enhancing sensitivity to dynamical changes and suppressing noise-driven patterns.
- WPE is applied in fields like climate science and renewable energy to detect anomalies and quantify subtle shifts in time series behavior.
Weighted permutation entropy (WPE) is a model-free time series analysis measure that quantifies the complexity and unpredictability of temporal data by integrating both ordinal pattern structure and amplitude information. Unlike permutation entropy (PE), which relies solely on the frequency distribution of ordinal patterns (permutations) within embedding windows, WPE adjusts the pattern statistics by amplitude-derived weights, typically the local variance, thus enhancing sensitivity to dynamical changes that are obscured by small-scale noise and improving discrimination of large excursions.
1. Mathematical Definition
Given a real-valued time series , WPE is computed via the following steps:
- Embedding: Fix an embedding dimension and a time delay . For each , form the delay vector:
- Ordinal Pattern Assignment: For each , determine the permutation representing the rank ordering of its entries.
- Weighting Function: The local variance is assigned as the weight:
- Weighted Probability Calculation: For each permutation :
where if , $0$ otherwise.
- Entropy Computation: The weighted Shannon entropy:
- Normalization: To obtain a value in :
This construction ensures that larger-scale fluctuations are not masked by frequent but low-amplitude noise-driven ordinal transitions (Garland et al., 2018, Garland et al., 2018, Karimi-Arpanahi et al., 2023).
2. Algorithmic Workflow and Parameterization
WPE computation is standardized with the following stepwise workflow:
- Uniform Sampling: Ensure the series is uniformly sampled; resampling is permissible but may introduce artificial monotonic ramps that reduce entropy.
- Parameter Selection:
- Embedding dimension : Typically , balancing pattern diversity and adequate statistical sampling.
- Time delay : Chosen relative to sampling rate and dynamical timescale; may reduce high-frequency noise sensitivity.
- Window size : Sufficiently large to provide stable frequency estimates, usually (e.g., ).
- Pattern Extraction and Weight Accumulation: Slide a window, extract delay vectors, assign ordinal patterns, compute variance weights, and accumulate weighted counts for each permutation.
- Probability Formation and Entropy Calculation: Normalize weighted counts to probabilities and compute WPE for each window position.
The following pseudocode implementation reproduces this workflow for a univariate input:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
for t in range(N - (d-1)*tau): V = x[t : t + d * tau : tau] mu = np.mean(V) w[t] = np.mean((V - mu)**2) pi[t] = ordinal_pattern_of(V) for t in range(N - (d-1)*tau - W + 1): numer = np.zeros(d!) denom = 0 for s in range(t, t+W): numer[pi[s]] += w[s] denom += w[s] H = 0 for i in range(d!): p = numer[i] / denom if p > 0: H -= p * np.log2(p) WPE_series[t] = H / np.log2(factorial(d)) |
3. Properties and Theoretical Significance
WPE generalizes permutation entropy by integrating amplitude information, unlike PE which treats all patterns of the same ordinal type equivalently. This weighting mechanism enables WPE to down-weight "almost flat" embeddings that are likely attributable to noise, improving robustness and fidelity for processes generating significant amplitude excursions.
For stationary processes, permutation entropy estimates converge to the Kolmogorov-Sinai entropy (a variant of Shannon entropy rate) under appropriate limits. WPE, by preferentially amplifying the influence of high-variance segments, provides a closer lower-bound to the Shannon entropy rate for noisy, finite series, and improves sensitivity to dynamical state changes (Garland et al., 2018).
4. Parameter Selection and Computational Complexity
Hyperparameter Considerations
| Parameter | Typical Values | Role/Significance |
|---|---|---|
| Embedding | Pattern diversity vs. sample size | |
| Delay | Attenuates noise, matches process timescales | |
| Window | (e.g., 3k+) | Controls estimate stability, temporal resolution |
Selection strategies include maximizing the interquartile range of WPE across systems (for anomaly detection), ensuring reliable permutation count statistics in each window, and minimizing computation. WPE computation time scales as per time series, with full parallelizability across samples (Karimi-Arpanahi et al., 2023).
Practical Recommendations
- Use window sizes exceeding $5 d!$ for robust probability estimation.
- Select as high as data length permits without exhausting unique pattern counts.
- For anomaly detection in PV generation, three months of five-minute data supports , .
- Data gaps are handled by imputation or exclusion of cases with excessive missingness.
5. Applications in Scientific Data Analysis
WPE's core utility is amplitude-aware complexity quantification, yielding enhanced anomaly detection capabilities and sensitivity to underlying dynamical transitions.
Climate and Paleoclimate Records
In Antarctic ice core isotope records, WPE correlates with accumulation rates, highlights instrument-driven noise, and flags missing data with high precision. Notably, major climate events (e.g., Dansgaard-Oeschger) induce only minor shifts in WPE, suggesting limited impact on overall system complexity (Garland et al., 2018, Garland et al., 2018). The weighted distinction allows separation of physically meaningful changes from laboratory or data-processing effects.
Photovoltaic Generation Systems
WPE has demonstrated efficacy in detecting subtle anomalies and faults in large-scale rooftop PV operations, outperforming threshold-based metrics. Anomalous systems are identified via correlation analysis of rolling WPE profiles against regional means; flagged instances correspond to persistent deviations such as inverter malfunction or shading. No additional sensor data is required, leveraging only historical output (Karimi-Arpanahi et al., 2023).
6. Limitations and Best Practices
WPE estimation mandates uniform sampling; resampling or interpolation can create monotonic patterns that artificially suppress entropy. Selection of , , and directly impacts reliability and interpretability; undersized windows or excessive undermine statistical stability. Edge-case handling includes defining when all weights vanish and mitigating artifacts from missing data via careful pre-processing.
Statistical significance assessment is non-standard for WPE traces; feature persistence across parameter choices and use of surrogates are recommended, but a general theory remains under development (Garland et al., 2018).
7. Comparison to Permutation Entropy and Related Measures
WPE refines unweighted PE by including amplitude information, enabling heightened sensitivity to scale-dependent anomalies (e.g., instrument spikes, physical events) while reducing susceptibility to high-frequency noise. In tandem, PE and WPE provide a more comprehensive forensic toolkit, guiding targeted re-analysis and data quality improvements in environmental and engineering contexts (Garland et al., 2018). Unweighted PE is better suited for detecting order-based complexity, while WPE excels in highlighting pattern excursions tied to amplitude changes.
The expanded landscape has motivated further generalizations, such as the introduction of scaling parameters that establish a "complexity-entropy-scale causality box," which further maps the disorder dynamics across multiple scales (Stosic et al., 2022).
Weighted permutation entropy is an amplitude-aware, ordinal-pattern-based complexity metric, bringing enhanced robustness and discriminative power to the analysis of diverse real-world time series. Its adoption in climate science and renewable energy monitoring demonstrates practical utility, subject to stringent data handling and parameter selection protocols.
Sponsored by Paperpile, the PDF & BibTeX manager trusted by top AI labs.
Get 30 days free