kirui93 / ScenTrees.jl

Julia Package for Generating Scenario Trees and Scenario Lattices for Multistage Stochastic Optimization
MIT License
23 stars 7 forks source link

Issue with lattice approximation #19

Closed rachaelalfant closed 2 years ago

rachaelalfant commented 2 years ago

Hello,

I'm attempting to follow the tutorial for scenario lattices, and am receiving an error after typing in the following command:

ExampleLattice = lattice_approximation([1,2,3,4,5],gaussian_path1D,1000000,2,1);

Screenshot from 2022-08-05 17-28-54

I obtained the command from this link: https://kirui93.github.io/ScenTrees.jl/stable/tutorial/tutorial3/. Am I doing something wrong? Any help would be greatly appreciated.

kirui93 commented 2 years ago

Hello @rachaelalfant ,

Thanks for pointing this out. There is a typo in the example. The function gaussian_path1D() returns a 4x1 matrix. Hence, we should give a vector of 4 dimension, i.e., bstructure = [1,2,3,4].

image

Will update with another function for length 5.

Additionally, you can write your own function that generates a vector with any dimension.

Thank you.

rachaelalfant commented 2 years ago

Thank you for your help!