Canonical ensemble for time series

The package provides all the files necessary to sample from the canonical ensemble aimed at randomizing a set of time series.
Updated 14 Jul 2019

View License

The canonical ensemble here defined provides a way to create an unbiased randomization of a set of N time series each of length P (stored in a NxP matrix W) without missing data (but a similarly ensemble can be defined to include also missing data). The ensemble here defined is aimed at preserving, as averages, the following quantities :
- Total number of positive and negative events of each sampling time and each time series (number of entries greater/less than 0 of each row and column of W)
- Sum of positive and negative values recorded during each sampling and each time series (sum over positive/negative entries of each row and each column of W)
For further details see the article:

To use the package, given a matrix W in memory, just call [ lm ] = find_lm(W,1) to find the Lagrange Multipliers defining the ensemble. To sample n matrices from the ensemble, once the Lagrange Multipliers are known, use [ S ] = sample_ensamble( W,lm,n ) . Each instance of the ensemble can be seen as a alternative scenario coherent with the constraints imposed on the system.

Cite As

Riccardo Marcaccioli (2024). Canonical ensemble for time series (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Conditional Mean Models in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Description update: paper link added


Description Update