Is there a good tutorial for incorporating some of the MCMC code into a custom task in Simbiology?

조회 수: 2 (최근 30일)
I Am looking to add MCMC as a custom task and have no idea where to start in creating this - I Assume a custom task -but I am looking for a guid in how to even start writing this code.
Any direction is helpful.

채택된 답변

Fulden Buyukozturk
Fulden Buyukozturk 2019년 6월 4일
Hi Andrew,
You can implement this, or custom analyses in general, in SimBiology either by creating a custom task on SimBiology desktop as you've suggested or by using a MATLAB script. I would suggest using a MATLAB script at least initially because it will be easier to debug your code.
To help start with this, you can configure a task and then check out the MATLAB/SimBiology code behind that task in SImBiology. This could serve as a starting point for your custom analysis. You can see the code by clicking on Task Code -> View Task Code on any built-in task on task editor. Please see below.
Picture1.png
For example, to run a simple simulation, the programmatic workflow that you can run directly via a MATLAB script could look something like the following (you can run this example too since i'm using a shipped project):
% Load model from SimBiology project called AntibacterialPKPD
project = sbioloadproject('AntibacterialPKPD','m1');
model = project.m1
% Get model simulation settings and set stop time to 336
settings = getconfigset(model);
settings.StopTime = 336;
% Get the dosing schedule from the model
dose = getdose(model, '500 mg tid')
% Simulate with the dose
simdata = sbiosimulate(model, settings, dose);
% Plot all states
sbioplot(simdata)
For implementing MCMC specifically, I suggest you take a look at simfunction and Hamiltonian Monte Carlo sampler from the Statistics and Machine Learning Toolbox.
Does this help?
Fulden

추가 답변 (1개)

Andrew Heitman
Andrew Heitman 2019년 6월 4일
Yes, this is a great place to start. Thanks!

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by