-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* walter's IOV examples * re-enable the iov example. Remove non-needed bench * re-write examples using the new settings * using new version of pharmsol. New debugging tools when having zero likelihoods for a subject * working on vanco * Clean dataset * Fix data * using new version of pharmsol * Update main.rs * remove files not needed on the main repo * rename examples and some data files --------- Co-authored-by: Markus <markushh@uio.no>
- Loading branch information
Showing
14 changed files
with
4,100 additions
and
80 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
use anyhow::Ok; | ||
use pmcore::prelude::{ | ||
settings::{Parameters, Prior, Settings}, | ||
*, | ||
}; | ||
fn main() -> Result<()> { | ||
let sde = equation::SDE::new( | ||
|x, p, _t, dx, _rateiv, _cov| { | ||
// automatically defined | ||
fetch_params!(p, ke0); | ||
// let ke0 = 1.2; | ||
dx[1] = -x[1] + ke0; | ||
let ke = x[1]; | ||
// user defined | ||
dx[0] = -ke * x[0]; | ||
}, | ||
|p, d| { | ||
fetch_params!(p, _ke0); | ||
d[1] = 0.1; | ||
}, | ||
|_p| lag! {}, | ||
|_p| fa! {}, | ||
|p, _t, _cov, x| { | ||
fetch_params!(p, ke0); | ||
x[1] = ke0; | ||
}, | ||
|x, p, _t, _cov, y| { | ||
fetch_params!(p, _ke0); | ||
y[0] = x[0] / 50.0; | ||
}, | ||
(2, 1), | ||
10000, | ||
); | ||
|
||
let mut settings = Settings::new(); | ||
|
||
let params = Parameters::builder() | ||
.add("ke0", 0.001, 2.0, false) | ||
.build() | ||
.unwrap(); | ||
settings.set_parameters(params); | ||
settings.set_cycles(100000); | ||
settings.set_error_poly((0.0, 0.0, 0.0, 0.0)); | ||
settings.set_error_type(ErrorType::Add); | ||
settings.set_error_value(0.0000757575757576); | ||
settings.set_output_path("examples/iov/output"); | ||
settings.set_prior(Prior { | ||
sampler: "sobol".to_string(), | ||
points: 100, | ||
seed: 347, | ||
file: None, | ||
}); | ||
settings.set_output_write(true); | ||
|
||
setup_log(&settings)?; | ||
|
||
let data = data::read_pmetrics("examples/iov/test.csv").unwrap(); | ||
let mut algorithm = dispatch_algorithm(settings, sde, data).unwrap(); | ||
algorithm.initialize().unwrap(); | ||
while !algorithm.next_cycle().unwrap() {} | ||
let result = algorithm.into_npresult(); | ||
result.write_outputs().unwrap(); | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.