Comments (5)
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Can you think about when we would want common indexing, and when we wouldn't? I am not sure.
By common indexing, I mean that we create one RNG that creates an index, and we select that column from every presample package array. I could imagine that we would want every presample package to have the same index, but I can equally well imagine that we wouldn't want this behaviour if presample packages should be considered independent. We can stack arrays in a single package relatively easily, so we could go with option two.
Another alternative would be to use a consistent sampler only if we were inside a campaign.
from brightway2-calc.
Original comment by Pascal Lesage (Bitbucket: MPa, ).
Common indexing occurs when the same seed
is passed when creating the presamples package. If common indexing is required, the same seed value is passed. If different indexing is needed, different seed values is passed. If it doesn't matter, then the default (random) seed value is used.
from brightway2-calc.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
OK, now you have opened another door of confusion :)
We know that:
- IrregularPresamplesArray is a subclass of RandomState, and only draws from the RNG to get an index.
- MatrixPresamples creates a seeded IrregularPresamplesArray for each presamples package.
- LCA (and its subclasses) create one instance of MatrixPresamples if needed on instantiation.
BTW, we might want to change the name of IrregularPresamplesArray, as we now ensure that presamples packages are regular.
So, I think my concern was unfounded; we get consistent sampling within presamples packages automatically with IrregularPresamplesArray, regardless of whether the RNG was seeded; we get consistent sampling across presample packages if a seed value is passed. Obviously, this should be documented and thoroughly tested.
"Common indexing occurs when the same seed is passed when creating the presamples package." I am not sure this is true, but probably we have to be more precise about what we mean here; for example, as the values from the first package be used to generate values from the second? If not, I don't think the seed matters; for example, using the same seed for two different versions of ecoinvent wouldn't lead to any correlation.
from brightway2-calc.
Original comment by Pascal Lesage (Bitbucket: MPa, ).
I think the simplest and quite logical solution is this: Seed values from the LCA object should not be passed to matrix_presamples in the LCA (here). Presamples seeds should be specific to the presamples package, and should not be overwritten during use of presamples.
As to "Common indexing occurs when the same seed is passed when creating the presamples package." This should be true for presamples with the same number of columns. This is ensured for parameter_presamples and matrix_presamples jointly created.
from brightway2-calc.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Fixed in upstream presamples code. Can access presamples.parameters to get all requested data.
from brightway2-calc.
Related Issues (20)
- fail to import brightway HOT 1
- PyPardisoError: The Pardiso solver failed with error code -3. See Pardiso documentation for details. HOT 2
- Incorrect score using Mac with ARM CPU HOT 9
- Investigate `scipy`/Apple Accelerate (for Sparse Solvers) HOT 7
- Remove `psutil` HOT 1
- Poor error message when no LCIA data is supplied
- Missing ability to create RNGs for Monte Carlo in Brightway 2.5? HOT 3
- Fail to install activity browser (Windows x64) HOT 1
- Install brightway error HOT 1
- Use the expected value to parametrize lognormal distributions HOT 2
- Prevent multiple ``remap_inventory_dicts``
- Allow for selective use of distributions or arrays depending on matrix label
- `MappedMatrixDict` should support `__mul__` HOT 1
- Dependency Dashboard
- MultiLCA: Check that `method_config` resources are present in data objects
- MultiLCA: Filter data objects to those referred to in `method_config`
- Add tests for `scikit-umfpack` and `sparselu` solvers HOT 5
- Prepare for switch to sparse arrays
- MultiLCA checklist
- Document/Clarify Removal of GraphTraversal Functionality HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brightway2-calc.