Code covered by the BSD License  

Highlights from
Using SimBiology for Mechanism-Based PK/PD Modeling in Preclinical & Discovery

image thumbnail

Using SimBiology for Mechanism-Based PK/PD Modeling in Preclinical & Discovery

by

 

Examples used in the March 2012 webinar: Using SimBiology for Mechanism-Based PK/PD Modeling

fitDose(dose, PD)
function fitResult = fitDose(dose, PD)
% Function fits PD to Dose using a sigmoidal model
% dose = vector of PKPD index values (nx1)
% PD   = vector of log10_CFU_at_24hour values (nx1)

% Copyright 2011 - 2012 MathWorks, Inc.

%% Fit
x = dose(:) ; % convert into a single vector
y = PD(:)        ; % convert into a single vector

[xData, yData] = prepareCurveData( x, y );

% Set up fittype and options.
ft = fittype( 'E0 - (PDmax*x^n)/(x^n + EX50^n)', 'independent', 'x', 'dependent', 'y' );

% Fitting options
opts = fitoptions( ft );
opts.Display = 'Off';
opts.Lower = [0 0 0 0];
opts.StartPoint = [4 0.035 0.84 0.93];
opts.Upper = [Inf Inf Inf Inf];

% Fit model to data.
[model, gof] = fit(xData, yData, ft, opts );
   
% save results  
fitResult           = struct;
fitResult.model     = model ; 
fitResult.rsquare   = gof.rsquare ; 
fitResult.bcid      = fsolve(@(xi) model(xi)- 3, median(x), optimset('disp', 'off')) ;
fitResult.bstat     = fsolve(@(xi) model(xi)- 6,  median(x), optimset('disp', 'off'));





Contact us