-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
update Documentation, readme and docstrings #79
Changes from all commits
94074e5
7e28387
6636045
555fdb3
9419cd8
52ce627
96f9172
2ef4cf1
5aaaa3e
9503a58
90ad028
b25d2df
d5d0250
80d0fac
0367f73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/dev/ | ||
|
||
.vscode/ | ||
docs/Manifest.toml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
[deps] | ||
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | ||
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
|
||
[compat] | ||
Documenter = "0.27" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ pages = [ | |
"Home" => "index.md", | ||
"samplers.md", | ||
"randomization.md", | ||
"design_matrix.md", | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
# [Design Matrices](@id DesignMatrices) | ||
|
||
## API | ||
|
||
It is often convenient to generate multiple independent sequence, for error estimation (uncertainty quantification). | ||
The resulting sequences can be stored in what is often called a design matrix. | ||
In this package, this is achieved with the `generate_design_matrices(n, d, ::DeterministicSamplingAlgorithm), ::RandomizationMethod, num_mats)` function. `num_mats` is the number of independent realization. The resulting design matrix is a vector of matrix of length `num_mats`. | ||
|
||
```@docs | ||
QuasiMonteCarlo.generate_design_matrices | ||
``` | ||
|
||
!!! warning | ||
The method `generate_design_matrices(n, d, sampler, R::NoRand, num_mats, T = Float64)` is an ad hoc way to produce a Design Matrix. Indeed, it creates a deterministic point set in dimension `d × num_mats` and splits it into `num_mats` point set of dimension `d`. The resulting sequences have no QMC guarantees. | ||
This seems to have been proposed in Section 5.1 of [*Saltelli, A. et al. (2010)*](https://d1wqtxts1xzle7.cloudfront.net/76482087/PUBLISHED_PAPER-libre.pdf?1639660270=&response-content-disposition=inline%3B+filename%3DVariance_based_sensitivity_analysis_of_m.pdf&Expires=1685981169&Signature=aim5tHldlkb0ewZ9-gSMZsW2F1b88tLvV8euV1FpD61UYrE1mLR3RDERut0BsHNbcibjKQnF1JlsZ8mtEx~E1~eI3A~SOSySbpQllIpbhu556pFGUvD3GV5M6ghwa-5QMDP3-aQczBzflR721N4PCVJgqfmV-y94pkijQYvHSvZaPKb-tsoS8TVxE6H31Ptk4u662H61ofKzXR5JCHv0740qkQ0hORH~GqXOt8s7yQMVWYswZT4pWGSkJ9EehEQHCLo2uDVW-YSopwlSaaMRz~~0O~hkGAVE8sC~TAB7b5KnUgtNXl0jYTfGNTYO4GNJo1XhmHwj~Og~sBLDIXDxsg__&Key-Pair-Id=APKAJLOHF5GGSLRBV4ZA)[^1] to do uncertainty quantification. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that is the source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am very puzzled on why this is so much used in the UQ community. Some notations are not up-to-date with the current QMC community, and the review cited dates from 1988. IMO, these practices should be progressively removed from QMC software. For example, in #75 something similar to Saltelli is proposed (+ the dropping zero story). To nuance my words, for the use case |
||
|
||
[^1]: Saltelli, A., Annoni, P., Azzini, I., Campolongo, F., Ratto, M., & Tarantola, S. (2010). Variance based sensitivity analysis of model output. Design and estimator for the total sensitivity index. Computer physics communications, 181(2), 259-270. | ||
|
||
## Example | ||
|
||
```@example 2 | ||
using QuasiMonteCarlo, Random | ||
Random.seed!(1234) | ||
m = 4 | ||
d = 3 | ||
b = QuasiMonteCarlo.nextprime(d) | ||
N = b^m # Number of points | ||
pad = m # Can also choose something as `2m` to get "better" randomization | ||
|
||
# 5 independent Randomized Faure sequences | ||
QuasiMonteCarlo.generate_design_matrices(N, d, FaureSample(R = OwenScramble(base = b, pad = m)), 5) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Is there a better way to do this which guarantees the good properties for QMC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! That is the point of all the randomization methods (RQMC).
I thought of adding this illustration to the
design_matrices
page.Even with a relatively small case
d = 6
and a nice functionF_test,
one can observe that sometime the method proposed by Saltelli and implemented withNoRand()
produce from time to time very far away estimate. WithM=500
realizations one can observe that the distribution of estimate from Saltelli has heavy tails while you would hope for something looking like a Normal distribution.On the other hand, RQMC is a theoretically grounded way to do (but it can be more computationally expensive)