Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined variable in out-of-sample-sampling documentation #691

Closed
HenriDeh opened this issue Sep 29, 2023 · 1 comment · Fixed by #692
Closed

Undefined variable in out-of-sample-sampling documentation #691

HenriDeh opened this issue Sep 29, 2023 · 1 comment · Fixed by #692

Comments

@HenriDeh
Copy link

HenriDeh commented Sep 29, 2023

The documentation at https://sddp.dev/stable/guides/simulate_using_a_different_sampling_scheme/#Out-of-sample-Monte-Carlo-simulation uses an Omega that does not appear to be defined. Specifically:

sampling_scheme = SDDP.OutOfSampleMonteCarlo(model) do node
    stage, markov_state = node
    if stage == 0
        return [SDDP.Noise((1, 1), 1.0)]
    elseif stage == 3
        children = SDDP.Noise[]
        noise_terms = [SDDP.Noise((inflow = 75.0, fuel_multiplier = 1.2), 1.0)]
        return children, noise_terms
    else
        probability = markov_state == 1 ? [1/6, 1/3, 1/2] : [1/2, 1/3, 1/6]
        noise_terms = [SDDP.Noise(ω, p) for (ω, p) in zip(Ω, probability)] # the Omega in the zip
        children = [
            SDDP.Noise((stage + 1, 1), 0.5), SDDP.Noise((stage + 1, 2), 0.5)
        ]
        return children, noise_terms
    end
end

The same is true for other examples on the same page.

PS: big fan of the package, it's so simple.

@odow
Copy link
Owner

odow commented Sep 29, 2023

Omega is defined at the top of the page
image

but you're right that it is confusing if you look lower down the page.

I'll change the docs to make it more explicit.

big fan of the package, it's so simple.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants