-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor differenced processes, random walks, and AR processes (#380)
* Checkpoint commit on differencedar * Checkpoint commit on differencedar * Add de-differencing helper and tests * Replace fori_loop with scan * Fix bugs and typos in integrator, add test * Fix name of StandardNormalRandomWalk * Try two random walk impelmentations * Fix bug in differenced process * Fix some tests, add dynamic versus static DistributionalRVs * Split distributional RVs into static and dynamic * Update DistributionalRV kwarg dist => distribution in all tests * update dist => distribution kwarg in DistributionalRV in all tutorials * Add tests for DistributionalRV factory and classes * Allow scalars to play better with scan, give more informative error messages for incompatible arrays in certain scan functions * Autoformat files * Rename infection_initialization tests to be consistent with name of tested classes, refactor all tests to work with new process module, ensure that DifferencedProcess samples the fundamental process n-1 times to account for inits, use pytest.mark.parametrize in rw sample distribution test * Fix typo * Refactor AR and update tests * Refactor RtPeriodicDiff to use DifferencedProcess and ARProcess; delete unused manual AR function * Default names for now * Fundamental process init passthrough for differencedprocess, update tutorials * Fix typo in IIDRandomSequence class name, add test for class * Apply suggestions from code review Co-authored-by: Damon Bayer <[email protected]> * Reintroduce test_rtperiodicdiff, removing manual reconstruction test that did not use the sampling method * Coerce to 1d in the appropriate place in infectionswithfeedback * Reintroduce padding * Coerce to array in tutorial * Fix tutorial bug * Update model/src/pyrenew/process/differencedprocess.py Co-authored-by: Damon Bayer <[email protected]> * Restore padding in test_model_basic_renewal * Restore padding in test in a couple other places * Apply suggestions from code review revert to using gen_int.size() method Co-authored-by: Damon Bayer <[email protected]> * Convert sds to scalars in test ar process * Rename PeriodicDiff classes to highlight that they are DiffAR processes * Move model up one level * Add expand method for distributional rvs * Mathtext and refs for differencedprocess class * Mathtext typo fixes and doc improvements for DifferencedProcess * More sphinx tweaks * More typos * Test for standard normal sequence * Float expectations * Add scipy to testing deps * Update pyproject for deptry * scipy allowed to be dev dep * Add test for vectorized sampling * Raise ValueError if noise sd not scalar * Fix expand_by() tests to use new syntax * Manual tests for integrator correctness, better documentation of output shape, revise sample method so that n is chosen properly * Fix distributional rv test * Raise eror for overly short DifferenceProcess samples; test for that error raise * Force differencedprocess to deal with 1D diffs and error otherwise, make it behave as expected for 0 < n < order * Fix scipy dep * Update test * Improve error message * Autoformat files * Update tutorials * More checks and clearer code for differencedprocess.py * Update src/pyrenew/process/differencedprocess.py Update link to Hyndman textbook Co-authored-by: Damon Bayer <[email protected]> * Update src/pyrenew/process/differencedprocess.py Fix out of date inaccurate docstring Co-authored-by: Damon Bayer <[email protected]> * Update src/pyrenew/process/differencedprocess.py Co-authored-by: Damon Bayer <[email protected]> * Remove names for DifferencedProcess * Change refs to expected shape * One missing edit in test * Restore incorrectly removed test * Update random walk tests * Make AR strict about 1d input arrays * Configurable AR process name in rtperiodicdiffar class * Added check comparing to first initial value to small sample test * Remove unused function * Remove required names and adjust tests and structure accordingly * replace :fun: sphinx directives * Fix one more :fun: * And yet one more :fun: --------- Co-authored-by: Damon Bayer <[email protected]>
- Loading branch information
1 parent
7ad81f1
commit a793417
Showing
38 changed files
with
1,500 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.