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

Reparametrize lognormals for ecospold2 imports #213

Merged
merged 3 commits into from
Sep 17, 2023

Conversation

Loisel
Copy link
Contributor

@Loisel Loisel commented Sep 16, 2023

By the definition of the ecospold2 format, the mean of a lognormal distribution of an exchange is not equal to the amount specified for that exchange, see issue brightway-lca/brightway2-calc#76.

This PR adds a strategy which sets loc for lognormal distributions on imported databases such that the expected value (mean) of the resulting distribution is equal to the (static) amount specified for that exchange. More precisely,

$$ \mu = \log a - \frac {\sigma^2} 2 $$

where $a$ is the (static) amount and $\sigma$ is scale, i.e., the standard deviation of the underlying normal distribution.

The strategy is not applied by default but only if a specific flag (reparametrize_lognormals=True) is provided when initializing an instance of SingleOutputEcospold2Importer.

@cmutel cmutel merged commit 0d7da86 into brightway-lca:main Sep 17, 2023
1 check passed
cmutel added a commit that referenced this pull request Sep 17, 2023
Reparametrize lognormals for ecospold2 imports
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 this pull request may close these issues.

None yet

2 participants