Adding an Error Model to a Nonlinear Mixed Effects Model

조회 수: 1 (최근 30일)
Yulan
Yulan 2025년 3월 20일
댓글: Yulan 2025년 3월 20일
Hello all,
First, I used SimBiology Model Builder to restore the PPK model that had been established in NONMEM. Since SimBiology Model Builder cannot add parameters for inter-individual variation and error models, I added them using code. But I found that the exponential error model has not been added to the model.
I would like to ask how to add the exponential error model to the following code and how to optimize the simulation process code? Thank you for your help!
opts = spreadsheetImportOptions("NumVariables", 3);
opts.Sheet = "Sheet1";
opts.DataRange = "A2:C237";
opts.VariableNames = ["ID", "TIME", "DV"];
opts.VariableTypes = ["double", "double", "double"];
Dose = readtable("Dose.xls", opts, "UseExcel", false)
data = groupedData(Dose);
sbiotrellis(data,@semilogy,"ID","TIME","DV",Marker="+",LineStyle="--");%%@semilogy
% Extract the model overall model file
s = sbioloadproject("Version-2-20241218.sbproj");
model = s.m1;
covModel = CovariateModel;
covModel.Expression = {'V1 = exp(theta1 + eta1)',' V2 = exp(theta2 + eta2)','F1 = exp(theta3 + eta3)','CL = exp(theta4 + eta4)'};
covModel.FixedEffectNames
covModel.FixedEffectDescription
options.ErrorModel = 'exponential';
options.ErrorModelParameters = struct('sigma', 1.0928)
thetas = table(4.0056,-20.3634,-7.9054,7.0873,'VariableNames',["theta1","theta2","theta3","theta4"])
omega = table([2.4432;0;0;0],[0;0.0534;0;0],[0;0;9.4391;0],[0;0;0;0.0729],'VariableNames',["eta1","eta2","eta3","eta4"])
phi = sbiosampleparameters(covModel.Expression,thetas,omega,Dose)
f = createSimFunction(model,covModel.ParameterNames,'Drug_Central',[])
simresults = f(phi,24)
t = sbiotrellis(simresults,[],'Time',' Drug_Central');
t.hFig.Position(3:4) = [800 500];
set(t.plots,'XGrid','on','YGrid','on');
set(t.plots,'YScale','log');
lh = findobj(t.plots,'Type','line');
set(lh,'LineWidth',2);

채택된 답변

Jeremy Huard
Jeremy Huard 2025년 3월 20일
Assuming you want to add noise to the simulation data based on the exponential error model, you could use sbiosampleerror:
noisysimresults = sbiosampleerror(simresults, 'exponential', 1.0928);

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Import Data에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by