bradbell / at_cascade

Cascading Dismod_at Analysis From Parent To Child Regions
https://at-cascade.readthedocs.io
4 stars 3 forks source link

Wish list: New item: Sum random effects to zero #24

Open garland-culbreth opened 2 months ago

garland-culbreth commented 2 months ago

Proposed changes

It would be good to have an option to require the random effects of a parent node's child nodes to sum to zero. I'm starting to look at how this might be implemented, but wanted to get it on the wish list to be tracked early.

Tests

Ran bin/run_xrst.sh in my virtual environment and it passed:

❯ bin/run_xrst.sh                          
xrst --local_toc --target html --html_theme sphinx_rtd_theme --index_page_name at_cascade
Using following input_files: git ls-files
sphinx-build -b html -j 1 build/rst build/html
rm -r build/html/_sources
cp -r build/rst/_sources build/html/_sources
xrst: OK
run_xrst.sh: OK

Other

I added .venv to the .gitignore so git wouldn't needlessly track everything in the virtual environment. I've also found this to be a common addition to many python project's .gitignore files.

garland-culbreth commented 2 months ago

Note: The long list of commits is because I did a rebase and merge on my fork to sync it with this upstream.

garland-culbreth commented 2 months ago

I'm having a go at building out this support and I've got a test built which runs without errors. but the summation isn't coming out right so I'm still working on it. Once it's passing and good to go I can put the changes here or on another branch and close this, whichever is simplest.

bradbell commented 2 months ago

Proposed changes

It would be good to have an option to require the random effects of a parent node's child nodes to sum to zero. I'm starting to look at how this might be implemented, but wanted to get it on the wish list to be tracked early.

Tests

Ran bin/run_xrst.sh in my virtual environment and it passed:

❯ bin/run_xrst.sh                          
xrst --local_toc --target html --html_theme sphinx_rtd_theme --index_page_name at_cascade
Using following input_files: git ls-files
sphinx-build -b html -j 1 build/rst build/html
rm -r build/html/_sources
cp -r build/rst/_sources build/html/_sources
xrst: OK
run_xrst.sh: OK

Other

I added .venv to the .gitignore so git wouldn't needlessly track everything in the virtual environment. I've also found this to be a common addition to many python project's .gitignore files.

See Zero Sum Child Rate in https://dismod-at.readthedocs.io/option_table.html#zero-sum-child-rate

This is non-trival; see Hessian of Random Constraints https://cppad-mixed.readthedocs.io/theory.html#hessian-of-random-constraints

It is not included in at_cascade because there is no good way to compute statistics when this option is used.

bradbell commented 2 months ago

I added .venv to the .gitignore so git wouldn't needlessly track everything in the virtual environment. I've also found this to be a common addition to many python project's .gitignore files.

Please do not mix wish list items because one will get hung up on the discussion about another.

garland-culbreth commented 2 months ago

See Zero Sum Child Rate in https://dismod-at.readthedocs.io/option_table.html#zero-sum-child-rate

This is non-trival; see Hessian of Random Constraints https://cppad-mixed.readthedocs.io/theory.html#hessian-of-random-constraints

It is not included in at_cascade because there is no good way to compute statistics when this option is used.

I see, that explains why my test wasn't passing too. I'll read through these llinks deeper into this.

Please do not mix wish list items because one will get hung up on the discussion about another.

I'll revert the .gitignore change to keep this better focused.

bradbell commented 2 months ago

Computing the statistics with a zero sum constraint should be possible, but it is not clear to me (right now) how to do it. I think it would require a different approach that taken in dismod_at and cppad_mixed.