Scentree: a framework for generating scenario trees for multistage stochastic programming
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Statistics. The day in statistics: methods, theory and the inference under them.
Tom: We're looking at the paper: "Scentree: a framework for generating scenario trees for multistage stochastic programming".
Jane: Here's the gist of the paper. Scentree presents an open-source Python package for constructing scenario fans and scenario trees for multistage stochastic programming from historical data because it automates the complete workflow, including model selection, parameter estimation, scenario fan generation, and scenario tree construction.
Tom: Framework Overview Scentree combines machine learning and multivariate time series models to obtain a scenario fan that captures inter-stage dependencies in the stochastic processes.
Jane: This scenario fan is subsequently transformed into a scenario tree suitable for multistage stochastic optimization, providing a flexible and extensible framework for uncertainty modeling.
Tom: A key contribution is the automation of the complete workflow, including model selection, parameter estimation, scenario generation, and tree construction.
Paper summary: Tom: So, wrapping up this discussion on Scentree: a framework for generating scenario trees for multistage stochastic programming. The authors essentially gave us an open-source Python package that automates the whole pipeline from dimensionality reduction and model selection right up to scenario tree construction.
Jane: They showed that you can combine machine learning and time series models to create a scenario fan that handles those inter-stage dependencies, which then becomes a usable scenario tree for multistage optimization problems.
Lu: The main point is the automation of the complete workflow—model selection, parameter estimation, scenario fan generation, and tree construction—and it does this without requiring you to specify assumptions about the underlying data distribution.
Meng: From my side, what matters is that if I can deploy something that takes historical data and spits out a usable structure without me having to be a statistician first, then I see value in testing it on real traffic.
Lalam: Lalam here. What this means for us is that we can build these complex uncertainty representations much faster, and the framework's design allows us to swap out different models or tree construction methods later without breaking the existing system.
Tom: Exactly, so the title Scentree: a framework for generating scenario trees for multistage stochastic programming points to how this tool handles that entire process end-to-end.
Jane: It simplifies uncertainty modeling by taking complex historical data and automatically turning it into a structure suitable for multi-stage decision making under uncertainty.
Lu: The work suggests that we can build better tools for generating these scenarios from real data, which is a key step in moving toward more realistic applications of this kind of stochastic programming.
Conclusion: Tom: So we’ve been looking at Scentree, this open-source Python package that handles everything from picking the right model to building those scenario trees for multistage planning using historical data.
Jane: Right, it automates the whole workflow, which means you don't have to be a statistician just to get a usable tree structure for your optimization problem.
Lu: The authors focus on making this process flexible; they don't assume anything specific about the underlying probability distribution of your data.
Meng: From my side, I'm wondering if this automation means we can actually deploy this reliably without needing someone to manually tune every single hyperparameter for every stage.
Lalam: I see what you mean, Meng; it handles that model selection automatically using cross-validation and then uses a forward tree construction algorithm to build the final structure.
Tom: And the output is a graph of the tree and a json file to save all that data, which is pretty useful for checking things.
Jane: So, what’s actually new about this? It’s not just building trees; it's combining principal component analysis for dimensionality reduction with model families to generate the initial fan.
Lu: The core idea is using machine learning and multivariate time series models together to capture those inter-stage dependencies within the scenario fan itself, which then feeds into a tree construction algorithm.
Meng: I just worry about the complexity of setting up all those predictive model families; if it gets too complex, running it at scale might become a headache.
Lalam: The framework is designed to be agnostic about the specific multistage optimization problem you’re solving, so you can plug in different models or tree construction methods later without rewriting everything.
Tom: It seems like they've built a really accessible tool that takes complex historical data and turns it into a structured uncertainty representation for optimization problems.
Jane: Exactly; it simplifies the hard part of scenario generation by automating the steps that usually require deep statistical knowledge.
Lu: The authors emphasize extensibility, planning to add more advanced machine learning models in the future, like diffusion models, which suggests this is just one piece of a larger picture.
Meng: It's interesting to hear about those future plans; if they can actually integrate things like diffusion models into that framework, that opens up some new avenues for how we model uncertainty.
Tom: So Scentree is positioned as a flexible and accessible starting point for anyone trying to build scenario representations from historical data.
Jane: It’s about taking complex time series data and automatically generating the tools needed for multistage stochastic programming, without you having to define the probability distribution yourself.
Departament d’Estadística i Investigaci₆ Operativa · Universitat Politecnica de Catalunya
stat.CO, cs.SE
Submitted: 2026-09-18
Updated: 2026-11-12
Code: https://github.com/julienkeutchayan/StochOptim
License: http://creativecommons.org/licenses/by-sa/4.0/
Importance score: 72/100
The gist: Scentree presents an open-source Python package for constructing scenario fans and scenario trees for multistage stochastic programming from historical data because it automates the complete…
Key concepts
- Scenario Fan
- A multi-dimensional representation of possible future states derived from historical data. Scentree uses Principal Component Analysis (PCA) on the data to reduce dimensionality before generating this fan, capturing how different variables change together over time.
- Model Selection Process
- This involves testing several predictive models against the data using time series cross-validation. The model that minimizes the root mean squared error is automatically chosen from a family of candidate models, ensuring optimal performance for the subsequent scenario generation.
- Forward Tree Construction (FTC)
- This algorithm sequentially builds a scenario tree from an initial fan. At each stage, it considers scenarios based on which nodes they were assigned in the previous stage and calculates the probability of reaching each node at every point in time.
Terminology
Summary
Scentree presents an open-source Python package for constructing scenario fans and scenario trees for multistage stochastic programming from historical data because it automates the complete workflow, including model selection, parameter estimation, scenario fan generation, and scenario tree construction. p. 1 The framework combines multivariate time series and machine learning models to learn the underlying stochastic process and generate scenario
fans, which are subsequently transformed into scenario trees. The complete
workflow, including model selection, parameter estimation, scenario generation, and tree construction, is automated, reducing the statistical and
machine learning expertise required from the user.Where the paper says it
Framework Overview
Scentree combines machine learning and multivariate time series models to obtain a scenario fan that captures inter-stage dependencies in the stochastic processes. This scenario fan is subsequently transformed into a scenario tree suitable for multistage stochastic optimization, providing a flexible and extensible framework for uncertainty modeling. p. 0 It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. This scenario fan
is subsequently transformed into a scenario tree suitable for multistage
stochastic optimization, providing a flexible and extensible framework
for uncertainty modeling. This scenario fan
is subsequently transformed into a scenario tree suitable for multistage
stochastic optimization, providing a flexible and extensible framework
for uncertainty modeling. A key contribution is the automation of
the complete workflow, including model selection, parameter estimation, scenario fan generation, and scenario tree construction. A key contribution is the automation of
the complete workflow, including model selection, parameter estimation, scenario fan generation, and scenario tree construction. Scentree
does not rely on assumptions about the underlying data distribution,
reducing the statistical expertise required to produce a scenario tree. Scentree
does not rely on assumptions about the underlying data distribution,
reducing the statistical expertise required to produce a scenario tree. Furthermore, it is agnostic to the specific multistage stochastic problem to be solved.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Scenario Fan Generation
The first step in generating a scenario fan involves dimensionality reduction using Principal Component Analysis (PCA). After applying PCA to the data, the resulting matrix is of size d × k, and the data are scaled so that the mean and variance of each column are 0 and 1. p. 5 data are scaled so that the mean and variance of each column are 0 and 1,
respectively. Let X˜ be the resulting matrix. Let X˜ be the resulting matrix. Once the data is preprocessed, a set of predictive model families, denoted
by Γ, is considered to identify the best-performing model.Where the paper says it
Where the paper says it
Model Selection Process
The selection of the best predictive model involves hyperparameter tuning for each family in Γ. Since the data are indexed by D, time series cross-validation is used to obtain a set of predictive models, denoted by ˜Γ. p. 5 Since the data are indexed by D, we use
time series cross-validation (Bergmeir and Ben´ıtez 2012). As a result, a set
of predictive models, Γ, is obtained. Each model in ˜ Γ is the best-performing ˜
model within its respective family. Afterwards, the final model, f, is selected using the root mean squared
error:
f := arg min
g∈Γ˜
1
d − h
d
X−h
i=1
r
1
k
g(x˜i
, x˜i+1, . As a result, a set
of predictive models, Γ, is obtained. Each model in ˜ Γ is the best-performing ˜
model within its respective family.Where the paper says it
Where the paper says it
Where the paper says it
Scenario Tree Construction
The scenario tree construction utilizes the forward tree construction algorithm (FTC) to construct a scenario tree from an initial scenario fan by proceeding sequentially through the stages. At each stage, scenarios are considered according to the nodes to which they were assigned in the previous stage. p. 7 scenario fan by proceeding sequentially through the stages. At each stage,
the scenarios are considered according to the nodes to which they were assigned in the previous stage. These values are given by the scenario selected as the
representative of that node. The FTC algorithm also computes the probability of each node at each
stage throughout the scenarios. Our framework implements the FTC algorithm to construct the scenario
trees. For each of the nf scenario fans, a corresponding scenario tree is
obtained.Where the paper says it
Where the paper says it
Where the paper says it
Output and Flexibility
The output structure provides several relevant data, including a graph representing the scenario tree and an exporter module that saves all output data in a json file. The design is agnostic to the underlying algorithm, allowing alternative tree construction methods to be implemented without affecting existing ones. p. 7 (2020), and Li and Gao (2019). Consequently, the tree modeling design adopted in scentree is agnostic to
the underlying algorithm, allowing alternative tree construction methods
to be implemented without affecting the existing ones. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. Built on top of JuMP (Dunning, Huchette, and Lubin
2017), it provides a high-level modeling interface while maintaining performance comparable to low-level implementations. Its main contribution is
the development of a flexible, solver-independent, and extensible implementation of SDDP.Where the paper says it
Where the paper says it
Where the paper says it
Illustrative Example
An illustrative example considers a three-stage problem with dimensions p1 = 6, p2 = 15, and p3 = 14, resulting in a total dimension of p = 35. Two different datasets, X1 and X2, are used as simulated observations from a Brownian motion with a trend. p. 8 Two different datasets, represented by X1 and X2, are used. Both of them consisting of observations
from a Brownian motion with a trend (BMT for short). Although Python uses zero-based
indexing, we use one-based indexing when referring to matrix columns/rows
throughout this example. Our framework allows each dataset to be loaded individually, with the
corresponding mapping specified as illustrated in Listing 4. This procedure is repeated until
the final stage, resulting in the complete scenario tree. Given a scenario fan, the resulting scenario tree can be represented, in
terms of data, by a matrix of size ns × p.Where the paper says it
Where the paper says it
Where the paper says it
Conclusion
Overall, scentree is intended to provide a flexible and accessible framework for scenario generation while maintaining sufficient extensibility to accommodate future developments in predictive modeling and scenario tree construction. The work presents scentree, an open-source Python package for generating scenario fans and scenario trees for multistage stochastic programming using historical data. p. 0 Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. This scenario fan
is subsequently transformed into a scenario tree suitable for multistage
stochastic optimization, providing a flexible and extensible framework
for uncertainty modeling. A key contribution is the automation of
the complete workflow, including model selection, parameter estimation, scenario fan generation, and scenario tree construction. A scenario representation should capture the main characteristics of the underlying stochastic process. When
historical observations of the uncertain process are available, scenario generation can be approached directly from data rather than by assuming a
predefined probability distribution. The framework combines multivariate time series and machine learning models to learn the underlying stochastic process and generate scenario
fans, which are subsequently transformed into scenario trees. The complete
workflow, including model selection, parameter estimation, scenario generation, and tree construction, is automated, reducing the statistical and
machine learning expertise required from the user. Consequently, the tree modeling design adopted in scentree is agnostic to
the underlying algorithm, allowing alternative tree construction methods
to be implemented without affecting the existing ones. The choice of the
method will be therefore left to the user.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Acknowledgments
This work has been supported with grants PID2022-139219OB-I00 and CetpFP-2023-00185 from the Spanish Ministerio de Ciencia, Innovaci´on y Universidades. This research has been funded by CETPartnership, the Clean Energy Transition Partnership under the 2023 joint call for research proposals, co-funded by the European Commission (GA N°101069750) and with the funding organisations FFG (Austria), AEI (Spain) and MUR (Italy).
References
Bellman, Richard E. (1957). Dynamic Programming. p. 2 Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). In order to select the best model for each family in Γ, the first step
consists of hyperparameter tuning. Since the data are indexed by D, we use
time series cross-validation (Bergmeir and Ben´ıtez 2012). In order to select the best model for each family in Γ, the first step
consists of hyperparameter tuning. Since the data are indexed by D, we use
time series cross-validation (Bergmeir and Ben´ıtez 2012). In order to select the best model for each family in Γ, the first step
consists of hyperparameter tuning. Since the data are indexed by D, we use
time series cross-validation (Bergmeir and Ben´ıtez 2012). Keywords: scenario fan, scenario tree reduction, machine learning,
multivariate time series models, multistage stochastic programming,
uncertainty estimation. 1 Introduction
Uncertainty arises in a natural way in many situations where decision must
be made before all relevant information in available. , an already trained machine
learning model), which requires the user to have prior knowledge of the
underlying stochastic process. Recent advances in optimization software have established Julia (Bezanson et al. Recent advances in optimization software have established Julia (Bezanson et al. 2017) as a suitable programming language for mathematical programming. When
historical observations of the uncertain process are available, scenario generation can be approached directly from data rather than by assuming a
predefined probability distribution. This approach is particularly relevant
when the underlying process is multivariate or exhibits complex temporal
dependencies. As a result, dependencies among the components of multivariate random
vectors cannot be modeled, preventing the direct generation of multivariate
scenario trees from data. The final package considered in this review is StochOptim, which is
available at https://github. As a result, dependencies among the components of multivariate random
vectors cannot be modeled, preventing the direct generation of multivariate
scenario trees from data. The final package considered in this review is StochOptim, which is
available at https://github. 2017) as a suitable programming language for mathematical programming. Biel and Johansson 2022 present StochasticPrograms. Biel and Johansson 2022 present StochasticPrograms. jl, an
open-source framework for modeling and solving stochastic programming
problems in Julia. In these
and many other applications, uncertain quantities evolve over time, and new
information becomes available as the decision-making process progresses. Multistage stochastic programming (Birge and Louveaux 2011) provides
a mathematical framework for addressing this type of decision problem by
explicitly incorporating the evolution of uncertain parameters across multiple stages. In these
and many other applications, uncertain quantities evolve over time, and new
information becomes available as the decision-making process progresses. Multistage stochastic programming (Birge and Louveaux 2011) provides
a mathematical framework for addressing this type of decision problem by
explicitly incorporating the evolution of uncertain parameters across multiple stages. Keywords: scenario fan, scenario tree reduction, machine learning,
multivariate time series models, multistage stochastic programming,
uncertainty estimation. 1 Introduction
Uncertainty arises in a natural way in many situations where decision must
be made before all relevant information in available. Essentially,
to obtain a scenario fan, we apply a Monte Carlo method (Hammersley and
Handscomb 1964). Due to the nature of PCA, the reduced data can be mapped back to
the original p-dimensional space. Essentially,
to obtain a scenario fan, we apply a Monte Carlo method (Hammersley and
Handscomb 1964). Due to the nature of PCA, the reduced data can be mapped back to
the original p-dimensional space. Once the data is preprocessed, a set of predictive model families, denoted
by Γ, is considered to identify the best-performing model. The families
in Γ include multivariate time series models, such as vector autoregressive
models (Sims 1980), and machine learning models, including support vector
machines (Cortes and Vapnik 1995). Once the data is preprocessed, a set of predictive model families, denoted
by Γ, is considered to identify the best-performing model. The families
in Γ include multivariate time series models, such as vector autoregressive
models (Sims 1980), and machine learning models, including support vector
machines (Cortes and Vapnik 1995). Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. To address this challenge, we developed scentree, an open-source
Python package that automates the complete scenario generation workflow
from historical data. The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). These works focus on modeling uncertainty associated with renewable energy systems through a multistage stochastic programming framework. Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). Built on top of JuMP (Dunning, Huchette, and Lubin
2017), it provides a high-level modeling interface while maintaining performance comparable to low-level implementations. Recent advances in optimization software have established Julia (Bezanson et al. 2017) as a suitable programming language for mathematical programming. 1 Scenario fan generation
As the dimension of the stochastic process, p, could be so large as to incur
the curse of dimensionality (Bellman 1957), the first step is to reduce the
dimensionality by means of Principal Component Analysis (PCA for short;
Pearson 1901). The number of principal components is selected such that
at least 80% of the total variance is explained, following a commonly used
variance-retention criterion (Dunteman 1989). 1 Scenario fan generation
As the dimension of the stochastic process, p, could be so large as to incur
the curse of dimensionality (Bellman 1957), the first step is to reduce the
dimensionality by means of Principal Component Analysis (PCA for short;
Pearson 1901). The number of principal components is selected such that
at least 80% of the total variance is explained, following a commonly used
variance-retention criterion (Dunteman 1989). Consequently, a discrete approximation of
the stochastic process is required. Such an approximation can be represented
by a finite collection of scenarios (Dupaˇcov´a, Consigli, and Wallace 2000),
where each scenario corresponds to one possible realization of the stochastic
process over the planning horizon. Consequently, a discrete approximation of
the stochastic process is required. Such an approximation can be represented
by a finite collection of scenarios (Dupaˇcov´a, Consigli, and Wallace 2000),
where each scenario corresponds to one possible realization of the stochastic
process over the planning horizon. Such an approximation can be represented
by a finite collection of scenarios (Dupaˇcov´a, Consigli, and Wallace 2000),
where each scenario corresponds to one possible realization of the stochastic
process over the planning horizon. For multistage problems, scenarios must account for the underlying structure of the uncertain process, which is typically described over a parameterized space, denoted by D in this work, often with time as the parameter. Section 3 provides
a detailed description of the scentree package, together with an illustrative example in Section 4. Finally, Section 5 presents the conclusions and
discusses potential directions for future research. To address this challenge, we developed scentree, an open-source
Python package that automates the complete scenario generation workflow
from historical data. The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). To address this challenge, we developed scentree, an open-source
Python package that automates the complete scenario generation workflow
from historical data. The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). To address this challenge, we developed scentree, an open-source
Python package that automates the complete scenario generation workflow
from historical data. The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). These works focus on modeling uncertainty associated with renewable energy systems through a multistage stochastic programming framework. Note that the output is a tensor F˜ of size nf × ns × k or, equivalently,
a vector of length nf whose entries are matrices of size ns × k. Essentially,
to obtain a scenario fan, we apply a Monte Carlo method (Hammersley and
Handscomb 1964). Note that the output is a tensor F˜ of size nf × ns × k or, equivalently,
a vector of length nf whose entries are matrices of size ns × k. Essentially,
to obtain a scenario fan, we apply a Monte Carlo method (Hammersley and
Handscomb 1964). Note that the output is a tensor F˜ of size nf × ns × k or, equivalently,
a vector of length nf whose entries are matrices of size ns × k. Essentially,
to obtain a scenario fan, we apply a Monte Carlo method (Hammersley and
Handscomb 1964). (2023) presents mpi-sppy, a Python package (Python
Software Foundation 2026) whose main feature is its efficient parallelization
capabilities. The framework is integrated with Pyomo (Hart, Watson, and
Woodruff 2011), allowing users to take advantage of the full range of functionalities provided by Pyomo. (2023) presents mpi-sppy, a Python package (Python
Software Foundation 2026) whose main feature is its efficient parallelization
capabilities. The framework is integrated with Pyomo (Hart, Watson, and
Woodruff 2011), allowing users to take advantage of the full range of functionalities provided by Pyomo. (2023) presents mpi-sppy, a Python package (Python
Software Foundation 2026) whose main feature is its efficient parallelization
capabilities. The framework is integrated with Pyomo (Hart, Watson, and
Woodruff 2011), allowing users to take advantage of the full range of functionalities provided by Pyomo. Biel and Johansson 2022 present StochasticPrograms. jl, an
open-source framework for modeling and solving stochastic programming
problems in Julia. In these
and many other applications, uncertain quantities evolve over time, and new
information becomes available as the decision-making process progresses. Multistage stochastic programming (Birge and Louveaux 2011) provides
a mathematical framework for addressing this type of decision problem by
explicitly incorporating the evolution of uncertain parameters across multiple stages. Thus, when solving the
optimization problem, a discrete process ξtr approximating ξ must be considered (Shapiro, Dentcheva, and Ruszczy´nski 2009). Heitsch and R¨omisch (2009) propose a practical approach to construct
ξtr. It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. This scenario fan
is subsequently transformed into a scenario tree suitable for multistage
stochastic optimization, providing a flexible and extensible framework
for uncertainty modeling. In these
and many other applications, uncertain quantities evolve over time, and new
information becomes available as the decision-making process progresses. Multistage stochastic programming (Birge and Louveaux 2011) provides
a mathematical framework for addressing this type of decision problem by
explicitly incorporating the evolution of uncertain parameters across multiple stages. Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. To address this challenge, we developed scentree, an open-source
Python package that automates the complete scenario generation workflow
from historical data. The framework is inspired by Heredia, Cuadrado, and Corchero (2018)
and Cuadrado-Guevara (2020), who propose the idea of constructing scenario fans using time series factor analysis (TSFA for short; Gilber and Meijer 2005). The authors use TSFA to (1) reduce the dimensionality of the data,
(2) estimate the underlying stochastic process, and (3) predict future values,
with the ultimate goal of supporting participation in the electricity market. Similarly, Sol`a Vilalta, Bosch, and Heredia (2025) apply the same methodology to construct an optimal bid curve for participation in the Spanish
electricity markets. Section 3 provides
a detailed description of the scentree package, together with an illustrative example in Section 4. Finally, Section 5 presents the conclusions and
discusses potential directions for future research. Although FTC is one of the earliest algorithms proposed, considerable
research has been devoted to this topic. Examples include Hewitt, Ortmann,
and Rei (2022), Medina-Gonz´alez et al. Similarly, in financial planning, investment decisions are made under uncertainty about future market conditions. In these
and many other applications, uncertain quantities evolve over time, and new
information becomes available as the decision-making process progresses. Section 3 provides
a detailed description of the scentree package, together with an illustrative example in Section 4. Finally, Section 5 presents the conclusions and
discusses potential directions for future research. Note that the index set D remains unchanged. This approach is also exploited by Hyndman and Shang (2009), who forecast the principal component scores of functional observations as time series. Note that the index set D remains unchanged. This approach is also exploited by Hyndman and Shang (2009), who forecast the principal component scores of functional observations as time series. Note that the index set D remains unchanged. This approach is also exploited by Hyndman and Shang (2009), who forecast the principal component scores of functional observations as time series. A key contribution is the automation of
the complete workflow, including model selection, parameter estimation, scenario fan generation, and scenario tree construction. Scentree
does not rely on assumptions about the underlying data distribution,
reducing the statistical expertise required to produce a scenario tree. stochastic program and does not provide methods for generating scenarios
from historical data. Kirui, Pichler, and Pflug (2020) present ScenTrees. stochastic program and does not provide methods for generating scenarios
from historical data. Kirui, Pichler, and Pflug (2020) present ScenTrees. stochastic program and does not provide methods for generating scenarios
from historical data. Kirui, Pichler, and Pflug (2020) present ScenTrees. Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. 2 Background
The literature on software for stochastic programming is extensive. The
work of Knueven et al. (2023) presents mpi-sppy, a Python package (Python
Software Foundation 2026) whose main feature is its efficient parallelization
capabilities. The framework is integrated with Pyomo (Hart, Watson, and
Woodruff 2011), allowing users to take advantage of the full range of functionalities provided by Pyomo. (2023) presents mpi-sppy, a Python package (Python
Software Foundation 2026) whose main feature is its efficient parallelization
capabilities. The framework is integrated with Pyomo (Hart, Watson, and
Woodruff 2011), allowing users to take advantage of the full range of functionalities provided by Pyomo. The package provides an expressive modeling language,
distributed-memory support for large-scale instances, and parallel implementations of structure-exploiting algorithms, such as variants of the Lshaped. Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. In these
and many other applications, uncertain quantities evolve over time, and new
information becomes available as the decision-making process progresses. Multistage stochastic programming (Birge and Louveaux 2011) provides
a mathematical framework for addressing this type of decision problem by
explicitly incorporating the evolution of uncertain parameters across multiple stages. Examples include Hewitt, Ortmann,
and Rei (2022), Medina-Gonz´alez et al. (2020), and Li and Gao (2019). Furthermore, it is agnostic to the specific multistage stochastic problem to be solved. Keywords: scenario fan, scenario tree reduction, machine learning,
multivariate time series models, multistage stochastic programming,
uncertainty estimation. Multistage stochastic programming (Birge and Louveaux 2011) provides
a mathematical framework for addressing this type of decision problem by
explicitly incorporating the evolution of uncertain parameters across multiple stages. At each stage, decisions can be adjusted according to the
1
arXiv:2609. Although FTC is one of the earliest algorithms proposed, considerable
research has been devoted to this topic. Examples include Hewitt, Ortmann,
and Rei (2022), Medina-Gonz´alez et al. stochastic program and does not provide methods for generating scenarios
from historical data. Kirui, Pichler, and Pflug (2020) present ScenTrees. In addition, the framework is agnostic to the specific multistage stochastic problem to be solved
and facilitates scenario generation. To the best of our knowledge, this is the
first Python framework that addresses scenario fan construction and scenario
tree modeling using a machine learning approach. readthedocs. 1 Scenario fan generation
As the dimension of the stochastic process, p, could be so large as to incur
the curse of dimensionality (Bellman 1957), the first step is to reduce the
dimensionality by means of Principal Component Analysis (PCA for short;
Pearson 1901). Let F be the tensor of size nf × ns × p
containing the p-dimensional scenario fans which has been obtained from F˜. It is worth mentioning that we use scikit-learn (Pedregosa et al. Let F be the tensor of size nf × ns × p
containing the p-dimensional scenario fans which has been obtained from F˜. It is worth mentioning that we use scikit-learn (Pedregosa et al. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). Regarding the scenario creation process, the framework does not include
methods for generating scenarios from historical data, as it relies on usersupplied scenarios or on a user-defined sampling mechanism representing the
underlying stochastic process. jl (Dowson and Kapelevich 2021) is an open-source Julia package for solving large multistage stochastic optimization problems using the
Stochastic Dual Dynamic Programming (SDDP) algorithm (Philpott, Matos,
and Finardi 2013). The
work of Knueven et al. (2023) presents mpi-sppy, a Python package (Python
Software Foundation 2026) whose main feature is its efficient parallelization
capabilities. Recent advances in optimization software have established Julia (Bezanson et al. 2017) as a suitable programming language for mathematical programming. It is worth mentioning that we use scikit-learn (Pedregosa et al. 2011)
as well as statsmodels (Seabold and Perktold 2019) to incorporate predictive models. It is worth mentioning that we use scikit-learn (Pedregosa et al. 2011)
as well as statsmodels (Seabold and Perktold 2019) to incorporate predictive models. However,
constructing representative scenarios often requires substantial statistical
expertise. To address this challenge, we developed scentree, an open-source
Python package that automates the complete scenario generation workflow
from historical data. Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. 2 Scenario tree modeling
A key aspect of multistage stochastic programming is the need to consider
a discrete approximation of the stochastic process. Thus, when solving the
optimization problem, a discrete process ξtr approximating ξ must be considered (Shapiro, Dentcheva, and Ruszczy´nski 2009). Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. It combines machine learning and
multivariate time series models to obtain a scenario fan that captures
inter-stage dependencies in the stochastic processes. This scenario fan
is subsequently transformed into a scenario tree suitable for multistage
stochastic optimization, providing a flexible and extensible framework
for uncertainty modeling. jl, the first Julia
package dedicated to scenario generation for stochastic programming. Scenario generation can be based either on a user-defined stochastic process or,
when historical data are available, on kernel density estimation (KDE for
short; Silverman 1986) implemented in the package. jl, the first Julia
package dedicated to scenario generation for stochastic programming. Scenario generation can be based either on a user-defined stochastic process or,
when historical data are available, on kernel density estimation (KDE for
short; Silverman 1986) implemented in the package. Once the data is preprocessed, a set of predictive model families, denoted
by Γ, is considered to identify the best-performing model. The families
in Γ include multivariate time series models, such as vector autoregressive
models (Sims 1980), and machine learning models, including support vector
machines (Cortes and Vapnik 1995). Scentree: a framework for generating scenario trees
for multistage stochastic programming
Cristian Pach´on-Garc´ıa, Albert Sol`a Vilalta and F-. Javier Heredia
Departament d’Estad´ıstica i Investigaci´o Operativa
Universitat Polit`ecnica de Catalunya
September 2026
Abstract
We present scentree, an open-source Python package for constructing a scenario fan and a scenario tree for multistage stochastic programming from historical data. The authors use TSFA to (1) reduce the dimensionality of the data,
(2) estimate the underlying stochastic process, and (3) predict future values,
with the ultimate goal of supporting participation in the electricity market. Similarly, Sol`a Vilalta, Bosch, and Heredia (2025) apply the same methodology to construct an optimal bid curve for participation in the Spanish
electricity markets. This approach is also exploited by Hyndman and Shang (2009), who forecast the principal component scores of functional observations as time series. 2 Scenario tree modeling
A key aspect of multistage stochastic programming is the need to consider
a discrete approximation of the stochastic process. As a result, dependencies among the components of multivariate random
vectors cannot be modeled, preventing the direct generation of multivariate
scenario trees from data. The final package considered in this review is StochOptim, which is
available at https://github.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Automated Scenario Generation from Historical Data: The system can construct a scenario fan by learning underlying stochastic processes using multivariate time series models and machine learning, as described in Section 3.1 of Scentree. This eliminates the need for users to specify a probability distribution,
reducing the statistical expertise required to produce a scenario tree.
-
Flexibility in Model and Tree Construction: The framework is agnostic to the specific multistage stochastic problem or predictive model used, allowing users to select any model from family Gamma. Furthermore, it allows for alternative tree construction methods because
the design of scentree is agnostic to any particular algorithm, allowing new models and scenario tree construction or clustering methods to be incorporated without affecting the existing implementations.
-
Automated Workflow Management: The system automates the complete workflow, including
model selection, parameter estimation, scenario generation, and scenario tree construction,
thereby reducing user expertise needed for these complex steps.
Abstract
We present scentree, an open-source Python package for constructing scenario trees for multistage stochastic programming models using either historical data or samples drawn from a probability distribution. It combines machine learning and multivariate time series models to obtain a scenario fan that captures dependencies in the stochastic processes. This scenario fan is subsequently reduced into a scenario tree that preserves representativeness of the stochastic process, providing a flexible and extensible framework for uncertainty modeling in stochastic programming problems. The framework can also be naturally applied to two-stage stochastic programming problems. Key contributions are the joint modeling of the stochastic process, preserving correlations between all random variables, and the automation of the complete workflow, including forecasting model selection, parameter estimation, scenario fan generation, and scenario tree construction. In addition, scentree does not assume any underlying data distribution, reducing the statistical expertise required to produce a scenario tree, and is modular by design, allowing external forecasts and other partial executions of the workflow.
Sources
Related papers
- Sticky Manifold Piecewise Deterministic Monte Carlo for Bayesian Model Averaging
- A perturbation theory for Feynman-Kac models and their particle interpretations
- Fast Functional Clustering via Closed-Form Covariance Updates
- A fast non-reversible sampler for Bayesian mixture models
- Inventory and Assortment Optimization under General Choice: A Unified Approximation Framework
- Least squares variational inference