surface fitting to biopharmaceutical data
curve fitting toolbox™ software provides some example data for an anesthesia drug interaction study. you can use the curve fitter app to fit response surfaces to this data to analyze drug interaction effects. response surface models provide a good method for understanding the pharmacodynamic interaction behavior of drug combinations. this data is based on the results in [1].
anesthesia is typically at least a two-drug process, consisting of an opioid and a sedative hypnotic. this example uses propofol and reminfentanil as drug class prototypes. their interaction is measured by four different measures of the analgesic and sedative response to the drug combination. algometry, tetany, sedation, and laryingoscopy comprise the four measures of surrogate drug effects at various concentration combinations of propofol and reminfentanil.
to interactively create response surfaces for this drug combination:
use the current folder browser to locate and view the folder
matlab\toolbox\curvefit\curvefit
.right-click the file
opioidhypnoticsynergy.txt
, and select import data. the import tool appears.on the import tab, in the delimiters section, leave the default column delimiters value as
tab
.review the six variables selected for import:
propofol
,reminfentanil
,algometry
,tetany
,sedation
, andlaryingoscopy
.in the import section, click import selection and select import data to import the dose-response data into the matlab® workspace. close the import tool.
alternatively, you can import the data programmatically. enter the following code to read the dose-response data from the file into the matlab workspace.
data = importdata("opioidhypnoticsynergy.txt"); opioidhypnoticsynergy = array2table(data.data, ... "variablenames",data.textdata);
to create response surfaces, you must select two drugs as x and y inputs, and one of the four effects as the z output. after you load the variables into your workspace, you open the curve fitter app and then select variables interactively. alternatively, you can specify the initial fit variables when using the
curvefitter
function.for this example, open the curve fitter app.
curvefitter
in the curve fitter app, on the curve fitter tab, in the data section, click select data. in the select fitting data dialog box, first select the
opioidhypnoticsynergy
table from the x data, y data, and z data drop-down lists. then select thepropofol
,remifentanil
, andalgometry
variables from the new drop-down lists.the app creates a new response surface for the
algometry
data. the default fit is an interpolating surface that passes through the data points.create a copy of the current surface fit by either:
selecting the duplicate button in the file section of the curve fitter tab.
right-clicking a fit in the table of fits pane, and selecting duplicate "untitled fit 1".
define your own equation to fit the data. on the curve fitter tab, in the fit type section, click the arrow to open the gallery. in the gallery, click custom equation in the custom group.
in the fit options pane, select and delete the example custom equation text in the edit box.
you can use the custom equation edit box to enter matlab code to define your model. the equation that defines the model must depend on the data variables
x
andy
and a list of fixed parameters, estimable parameters, or both.the model from the paper is:
where ca and cb are the drug concentrations, and ic50a, ic50b, alpha, and n are the coefficients to be estimated.
you can define this in matlab code as:
effect = emax*(ca/ic50a cb/ic50b ... alpha*(ca/ic50a).*(cb/ic50b)).^n ./ ... (1 (ca/ic50a cb/ic50b ... alpha*(ca/ic50a ).*(cb/ic50b)).^n);
telling the app which variables to fit and which parameters to estimate requires rewriting the variable names
ca
andcb
asx
, andy
. you must includex
andy
when you enter a custom equation in the edit box. assumeemax = 1
because the effect output is normalized.enter the following text in the custom equation edit box.
(x/ic50a y/ic50b alpha*(x/ic50a).*(y/ic50b)).^n ./ (1 (x/ic50a y/ic50b alpha*(x/ic50a).*(y/ic50b)).^n)
the curve fitter app fits a surface to the data using the custom equation model.
in the fit options pane, change some of the fit options. click advanced options to expand the section.
set the robust value to
lar
.in the coefficient constraints table, for the alpha coefficient, set the startpoint value to
1
and the lower bound to–5
.the app updates the fit with your new options.
review the results pane. view any of these results:
the model equation
the values of the estimated coefficients
the goodness-of-fit statistics
display the residuals plot to check the distribution of points relative to the surface. on the curve fitter tab, in the visualization section, click residuals plot.
generate code for the currently selected fit and its open plots in your curve fitter app session. on the curve fitter tab, in the export section, click export and select generate code.
the curve fitter app generates code from your session and displays the file in the matlab editor. the file includes the fit selected in your current session and its open plots.
save the file with the default name,
createfit.m
.you can recreate your fit and its plots by calling the file from the command line with your original data or new data as input arguments.
in this case, because your original data still appears in the workspace, you can run the function with the original data variables.
[fitresult,gof] = createfit(opioidhypnoticsynergy.propofol, ... opioidhypnoticsynergy.remifentanil, ... opioidhypnoticsynergy.algometry)
the function creates a figure window for the fit you selected in your session. the custom fit figure shows both the surface and residuals plots that you created interactively in the curve fitter app.
create a new fit to the
tetany
response instead ofalgometry
.[fitresult,gof] = createfit(opioidhypnoticsynergy.propofol, ... opioidhypnoticsynergy.remifentanil, ... opioidhypnoticsynergy.tetany)
you need to edit the file if you want the new response label on the plots. you can use the generated code as a starting point to change the surface fits and plots to meet your needs. for a list of methods you can use, see .
to see how to programmatically fit surfaces to the same example problem, see .
references
[1] kern, steven e., guoming xie, julia l. white, and talmage d. egan. “a response surface analysis of propofol–remifentanil pharmacodynamic interaction in volunteers.” anesthesiology 100, no. 6 (june 1, 2004): 1373–81. https://doi.org/10.1097/00000542-200406000-00007.