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

Fix transformations between normal and lognormal parameters #1076

Merged
merged 3 commits into from
Nov 4, 2021

Conversation

alanlujan91
Copy link
Member

@alanlujan91 alanlujan91 commented Nov 2, 2021

Fixes a math error in calc_normal_style_pars_from_lognormal_pars.

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • Update CHANGELOG.md with major/minor changes.

fix `calc_normal_style_pars_from_lognormal_pars` where sqrt was not needed; other changes to avoid repeated calculations
add test to ensure transformation methods work as expected
Comment on lines -913 to +915
varNormal = math.sqrt(math.log(1 + varLognormal / avg_lognormal ** 2))
varNormal = math.log(1 + varLognormal / avg_lognormal ** 2)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sqrt is not needed since this is the variance.

@codecov-commenter
Copy link

Codecov Report

Merging #1076 (acdb2c1) into master (b36b8f8) will increase coverage by 0.07%.
The diff coverage is 90.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1076      +/-   ##
==========================================
+ Coverage   73.60%   73.68%   +0.07%     
==========================================
  Files          68       68              
  Lines       10477    10487      +10     
==========================================
+ Hits         7712     7727      +15     
+ Misses       2765     2760       -5     
Impacted Files Coverage Δ
HARK/distribution.py 82.98% <82.75%> (+1.21%) ⬆️
HARK/tests/test_distribution.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b36b8f8...acdb2c1. Read the comment docs.

@sbenthall sbenthall merged commit f6a6b52 into econ-ark:master Nov 4, 2021
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.

3 participants