Add run_sim_with_uncertainty() — PsN vpc uncertainty sampling wrapper#51
Open
roninsightrx wants to merge 1 commit intomainfrom
Open
Add run_sim_with_uncertainty() — PsN vpc uncertainty sampling wrapper#51roninsightrx wants to merge 1 commit intomainfrom
roninsightrx wants to merge 1 commit intomainfrom
Conversation
Wraps PsN's `vpc --uncertainty_sample=N` to simulate from a NONMEM model while incorporating parameter uncertainty from the covariance step. Samples N parameter vectors from MVN(estimates, cov_matrix), runs one simulation per draw via PsN, and returns all results in a single data.frame with a `sample_id` column. Includes 26 tests (20 run without NONMEM; 6 skip unless Pharmpy configured). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_sim_with_uncertainty()which wraps PsN'svpc --uncertainty_sample=Nto simulate from a NONMEM model while incorporating parameter uncertainty from the covariance stepdata.framewith asample_idcolumnextract_fit_folder()(resolves run folder from afitobject) andread_vpc_sim_tables()(parses PsN vpc output directory structure)0.0.0.9029Usage
Test plan
test-run_sim_with_uncertainty.Rcall_psn()to test end-to-end pipeline without actually running PsNFAIL 0 | WARN 0withdevtools::test(filter = "run_sim_with_uncertainty")🤖 Generated with Claude Code