ScenTrees.jl

ScenTrees.jl: A Julia Package for Generating Scenario Trees and Scenario Lattices for Multistage Stochastic Programming - Published in JOSS (2020)

https://github.com/kirui93/scentrees.jl

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 19 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

julia multistage-stochastic-optimization scenario-lattice scenario-tree scenario-tree-generation stochastic-data stochastic-processes

Scientific Fields

Earth and Environmental Sciences Physical Sciences - 40% confidence
Materials Science Physical Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

Julia Package for Generating Scenario Trees and Scenario Lattices for Multistage Stochastic Optimization

Basic Info
  • Host: GitHub
  • Owner: kirui93
  • License: mit
  • Language: Julia
  • Default Branch: master
  • Homepage:
  • Size: 4.85 MB
Statistics
  • Stars: 25
  • Watchers: 1
  • Forks: 7
  • Open Issues: 6
  • Releases: 16
Topics
julia multistage-stochastic-optimization scenario-lattice scenario-tree scenario-tree-generation stochastic-data stochastic-processes
Created over 6 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Contributing License

README.md

Travis status Codecov Coverage Status Zenodo JOSS

ScenTrees.jl

Note: See also the active fork at https://github.com/aloispichler/ScenTrees.jl.

ScenTrees.jl is a Julia package for generating and improving scenario trees and scenario lattices for multistage stochastic optimization problems using stochastic approximation. It is totally written in the Julia programming language. This package provides functions for generating scenario trees and scenario lattices from stochastic processes and stochastic data.

We provide two important features at the moment:

  • Generation of scenario trees and scenario lattices using stochastic approximation procedure.
    • Scenario trees are used in the case of discrete time and discrete state stochastic processes.
    • Scenario lattices are a natural discretization of Markov processes and so if the stochastic process is Markovian, scenario lattices would approximate the process well.
  • Estimating trajectories from stochastic data using conditional density estimation.
    • This is a non-parametric technique for generating trajectories from a given observed data whose distribution is unknown.
    • The new trajectories estimated here can thus be used in stochastic approximation process to generate scenario trees and scenario lattices.

Stochastic approximation procedure in ScenTrees.jl library follows from the framework provided by Pflug and Pichler(2015). The two main user inputs are a fixed branching structure and a function that generates samples from a stochastic process.

N/B - This package is actively developed and therefore new improvements and new features are continuously added.

Installation

Get the latest stable release with Julia's package manager:

julia ] add ScenTrees

To use ScenTrees.jl, you need to have Julia >= v1.0. This package was developed in Julia 1.0.4, and has been tested for Julia >= v1.0 in Linux and OSX distributions.

Documentation

The STABLE documentation of ScenTrees.jl is available here. Here you can get the description of the various functions in the package and also different examples for the different features.

Example of Usage

After installing the ScenTrees.jl package, you can use it as in the following examples:

  1. Consider the Gaussian random walk process in 4 stages. This process is already available in the package and can just be called by gaussian_path1D() for 1D and gaussian_path2D() for 2D. We want to approximate 1D process with a scenario tree as follows:

julia julia> using ScenTrees julia> gstree = tree_approximation!(Tree([1,2,2,2],1),gaussian_path1D,100000,2,2); julia> tree_plot(gstree) Scenario Tree

  1. We want to approximate running maximum process with a scenario lattice. It follows the same procedure as for scenario trees only that we use a different function as follows:

julia julia> using ScenTrees julia> rmlattice = lattice_approximation([1,2,3,4],running_maximum1D,100000,2,1); julia> plot_lattice(rmlattice) Scenario Lattice

  1. We also provide the conditional density estimation of trajectories given data. Given an NxT dataframe, we use the kernel_scenarios() function to generate a new and similar trajectory with length equal to T. This function can thus be used to generated trajectories for creating a scenario tree and a scenario lattice. Consider a Gaussian random walk data which can be generated by calling the function gaussian_path1D() many times and saving the result in a matrix form. We can use this data and the kernel density estimation method to generate new and similar trajectories as follows:

julia julia> using ScenTrees julia> using Distributions julia> gsdata = Array{Float64}(undef,1000,4) julia> for i = 1:1000 gsdata[i,:] = gaussian_path1D() end julia> gsGen = kernel_scenarios(gsdata,Logistic; Markovian = true)() 4-element Array{Float64,1}: 6.3183e-16 -1.8681 -3.7719 -3.5241

To use the above samples for scenario trees or scenario lattice generation:

julia julia> kerneltree = tree_approximation!(Tree([1,2,2,2],1),kernel_scenarios(gsdata,Logistic;Markovian=false),100000,2,2); julia> tree_plot(kerneltree) julia> kernelLattice = lattice_approximation([1,3,4,5],kernel_scenarios(gsdata,Logistic;Markovian=true),100000,2,1); julia> plot_lattice(kernelLattice)

| Kernel Tree | Kernel Lattice | |:---:|:---:| |Kernel Scenario Tree | Kernel Scenario Lattice |

Contributing to ScenTrees.jl

As in CONTRIBUTING.md, if you believe that you have found any bugs or if you need help or any questions regarding the library and any suggestions, please feel free to file a new GitHub issue. You can also raise an issue or a pull request which fixes the issue as long as it doesn't affect performance.

Citing ScenTrees.jl

We ask that you please cite the following paper if you use ScenTrees.jl: @article{Kirui2020, author = {Kirui, Kipngeno and Pichler, Alois and Pflug, Georg {\relax Ch}.}, title = {ScenTrees.jl: A {J}ulia Package for Generating Scenario Trees and Scenario Lattices for Multistage Stochastic Programming}, journal = {Journal of Open Source Software}, publisher = {The Open Journal}, year = {2020}, volume = {5}, number = {46}, pages = {1912}, doi = {10.21105/joss.01912}, url = {https://doi.org/10.21105/joss.01912} }

References

  • Pflug, Georg Ch., and Alois Pichler, 2012. A Distance for Multistage Stochastic Optimization Models. SIAM Journal on Optimization 22(1) Doi: https://doi.org/10.1137/110825054

  • Pflug, Georg Ch., and Alois Pichler,2015. Dynamic Generation of Scenario Trees. Computational Optimization and Applications 62(3): Doi: https://doi.org/10.1007/s10589-015-9758-0

  • Pflug, Georg Ch., and Alois Pichler,2016. From Empirical Observations to Tree Models for Stochastic Optimization : Convergence Properties : Convergence of the Smoothed Empirical Process in Nested Distance. SIAM Journal on Optimization 26(3). Society for Industrial and Applied Mathematics (SIAM). Doi: https://doi.org/10.1137/15M1043376.

Owner

  • Name: Kipngeno Kirui
  • Login: kirui93
  • Kind: user
  • Location: Nairobi

Data Scientist, Data Analyst, Big Data Analyst, Programming using Python, R, Julia, SPSS & SAS.

JOSS Publication

ScenTrees.jl: A Julia Package for Generating Scenario Trees and Scenario Lattices for Multistage Stochastic Programming
Published
February 19, 2020
Volume 5, Issue 46, Page 1912
Authors
Kipngeno Benard Kirui ORCID
University of Technology, Chemnitz, Germany
Alois Pichler ORCID
University of Technology, Chemnitz, Germany
Georg Ch. Pflug
University of Vienna
Editor
Melissa Weber Mendonça ORCID
Tags
Multistage stochastic programming Scenario trees Scenario lattices Stochastic processes

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 411
  • Total Committers: 5
  • Avg Commits per committer: 82.2
  • Development Distribution Score (DDS): 0.012
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Kipngeno Kirui 3****3 406
Oscar Dowson o****w 2
aloispichler 4****r 1
Júlio Hoffimann j****n@g****m 1
Julia TagBot 5****t 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 16
  • Total pull requests: 4
  • Average time to close issues: 16 days
  • Average time to close pull requests: about 3 hours
  • Total issue authors: 6
  • Total pull request authors: 4
  • Average comments per issue: 9.75
  • Average comments per pull request: 0.25
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • matbesancon (7)
  • odow (3)
  • juliohm (3)
  • rachaelalfant (1)
  • JuliaTagBot (1)
  • wrx1990 (1)
Pull Request Authors
  • aloispichler (1)
  • odow (1)
  • JuliaTagBot (1)
  • juliohm (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 16
juliahub.com: ScenTrees

Julia Package for Generating Scenario Trees and Scenario Lattices for Multistage Stochastic Optimization

  • Versions: 16
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 9.9%
Forks count: 19.4%
Average: 23.1%
Stargazers count: 24.1%
Dependent packages count: 38.9%
Last synced: 4 months ago

Dependencies

.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite