主要内容

sbiofitmixed

拟合非线性混合效应模型(要求统计和机器学习工具箱软件)

描述

例子

fitResults= sbiofitmixed (smgrpDataResponseMapcovEstiminfo使用SimBiology进行非线性混合效应估计®模型sm并返回一个NLMEResults对象fitResults

grpData是一个groupedData对象指定要匹配的数据。ResponseMap中定义模型组件和响应数据之间的映射grpDatacovEstiminfo是一个CovariateModel对象或者一个数组estimatedInfo对象,该对象定义要估计的参数。

如果模型包含活性剂量和变体,则在模拟过程中应用它们。

例子

fitResults= sbiofitmixed (smgrpDataResponseMapcovEstiminfo剂量使用SimBiology剂量对象矩阵指定的剂量信息剂量而不是使用模型中的活性剂量sm如果有的话。

例子

fitResults= sbiofitmixed (smgrpDataResponseMapcovEstiminfo剂量functionName使用指定的估计函数functionName那必须是“nlmefit”“nlmefitsa”

例子

fitResults= sbiofitmixed (smgrpDataResponseMapcovEstiminfo剂量functionName选择使用指定的附加选项选择对于估计函数functionName

例子

fitResults= sbiofitmixed (smgrpDataResponseMapcovEstiminfo剂量functionName选择变体应用指定为的变量对象变体而不是使用模型的任何活动变体。

fitResults= sbiofitmixed (___名称,值使用由一个或多个名称-值参数指定的附加选项。

fitResultssimDataIsimDataP] = sbiofitmixed (_)返回一个由结果对象组成的向量fitResults,表示仿真结果的向量simDataI利用个体特有的参数估计,并得到矢量仿真结果simDataP使用总体参数估计。

请注意

  • sbiofitmixed结合sbionlmefitsbionlmefitsa估计函数。使用sbiofitmixed进行非线性混合效应建模和估计。

  • sbiofitmixed使用a来模拟模型SimFunction对象,默认情况下自动加速模拟。因此,它没有必要跑sbioaccelerate之前你叫sbiofitmixed

例子

全部折叠

本例使用了59名早产儿在出生后16天内给予苯巴比妥的数据。每名婴儿接受一次初始剂量,随后进行一次或多次静脉滴注维持剂量。对每名婴儿进行了总共1至6次浓度测量,而不是在剂量时间,共进行了155次测量。研究人员还记录了婴儿体重和新生儿健康指数(APGAR)。

加载数据。

负载pheno.matds

将数据集转换为groupedData对象,用于保存分组的表格数据的容器。可以自动识别常用变量名为分组变量或自变量(时间)。显示数据的属性并确认GroupVariableNameIndependentVariableName被正确地识别为“ID”“时间”,分别。

data = groupedData (ds);数据。属性
ans =结构体字段:描述:“UserData: [] DimensionNames: {'Observations' 'Variables'} VariableNames: {'ID' '' TIME' 'DOSE' 'WEIGHT' 'APGAR' 'CONC'} VariableDescriptions: {} VariableUnits: {} variableccontinuity: [] RowNames: {} CustomProperties: [1x1 matlab.tabular. properties .]CustomProperties] GroupVariableName: 'ID' IndependentVariableName: 'TIME'

建立一个简单的单室药代动力学模型,用大剂量和线性间隙来拟合这些数据。使用PKModelDesign对象来构造模型。每个间隔由名称、剂量类型、间隙类型以及剂量是否需要滞后参数来定义。在构建模型之后,您还可以得到PKModelMap对象地图列出了物种的名称和模型中与拟合最相关的参数。

pkmd = PKModelDesign;addCompartment (pkmd“中央”“DosingType”“丸”...“EliminationType”“linear-clearance”...'hasresponseVariable',真的,“HasLag”、假);[onecomp, map] = pkmd.construct;

通过将适当的模型分量映射到响应变量来描述实验测量的响应。换句话说,表明模型中的物种对应于数据中的响应变量。的PKModelMap财产观察到的表示模型中相关物种为Drug_Central,表示系统中的药物浓度。相关数据变量为浓缩的,这是你之前想象的。

地图。观察到的
ans =1 x1单元阵列{' Drug_Central '}

映射Drug_Central物种浓缩的变量。

responseMap =“Drug_Central =浓缩的”

在这个模型中估计的参数是中央隔间的体积中央清除率Cl_Central.的PKModelMap财产估计列出这些相关参数。的底层算法sbiofit假设参数是正态分布的,但对于限制为正的生物参数,如体积和间隙,这个假设可能不成立。为估计参数指定一个对数转换,以便转换后的参数遵循正态分布。使用一个estimatedInfo对象来定义此类转换和初始值(可选)。

地图。估计
ans =2 x1细胞{'central'} {'cl_central'}

定义这些估计参数、适当的转换和初始值。

estimatedParams = estimatedInfo ({“日志(中央)”“日志(Cl_Central)”},“InitialValue”[1]);

每个婴儿都接受了不同的剂量计划。药物用量列在数据变量中剂量.要在拟合期间指定这些剂量,请从数据中创建剂量对象。这些对象使用该属性TargetName以指定模型中哪些物种接受了剂量。在这个例子中,目标物种是Drug_Central,列于PKModelMap财产

地图。给
ans =1 x1单元阵列{' Drug_Central '}

使用此目标名称创建样本剂量,然后使用createDoses的方法groupedData对象数据根据剂量数据为每个婴儿生成剂量剂量

sampleDose = sbiodose (“样本”“TargetName”“Drug_Central”);剂量= createDoses(数据,“剂量”'', sampleDose);

合适的模型。

[nlmeResults,思米,笨人]= sbiofitmixed (onecomp、数据responseMap estimatedParams,剂量,“nlmefit”);

使用个别特定参数估计可视化拟合结果。

情节(nlmeResults“ParameterType”“个人”);

图中包含64个轴对象。Axes对象1是空的。Axes对象2是空的。坐标轴对象3是空的。坐标轴对象4是空的。Axes对象5是空的。标题59的axis对象6包含2个类型为line的对象。标题为58的axis对象7包含2个类型为line的对象。标题为57的轴对象8包含2个类型为line的对象。标题56的轴对象9包含2个类型为line的对象。 Axes object 10 with title 55 contains 2 objects of type line. Axes object 11 with title 54 contains 2 objects of type line. Axes object 12 with title 53 contains 2 objects of type line. Axes object 13 with title 52 contains 2 objects of type line. Axes object 14 with title 51 contains 2 objects of type line. Axes object 15 with title 50 contains 2 objects of type line. Axes object 16 with title 49 contains 2 objects of type line. Axes object 17 with title 48 contains 2 objects of type line. Axes object 18 with title 47 contains 2 objects of type line. Axes object 19 with title 46 contains 2 objects of type line. Axes object 20 with title 45 contains 2 objects of type line. Axes object 21 with title 44 contains 2 objects of type line. Axes object 22 with title 43 contains 2 objects of type line. Axes object 23 with title 42 contains 2 objects of type line. Axes object 24 with title 41 contains 2 objects of type line. Axes object 25 with title 40 contains 2 objects of type line. Axes object 26 with title 39 contains 2 objects of type line. Axes object 27 with title 38 contains 2 objects of type line. Axes object 28 with title 37 contains 2 objects of type line. Axes object 29 with title 36 contains 2 objects of type line. Axes object 30 with title 35 contains 2 objects of type line. Axes object 31 with title 34 contains 2 objects of type line. Axes object 32 with title 33 contains 2 objects of type line. Axes object 33 with title 32 contains 2 objects of type line. Axes object 34 with title 31 contains 2 objects of type line. Axes object 35 with title 30 contains 2 objects of type line. Axes object 36 with title 29 contains 2 objects of type line. Axes object 37 with title 28 contains 2 objects of type line. Axes object 38 with title 27 contains 2 objects of type line. Axes object 39 with title 26 contains 2 objects of type line. Axes object 40 with title 25 contains 2 objects of type line. Axes object 41 with title 24 contains 2 objects of type line. Axes object 42 with title 23 contains 2 objects of type line. Axes object 43 with title 22 contains 2 objects of type line. Axes object 44 with title 21 contains 2 objects of type line. Axes object 45 with title 20 contains 2 objects of type line. Axes object 46 with title 19 contains 2 objects of type line. Axes object 47 with title 18 contains 2 objects of type line. Axes object 48 with title 17 contains 2 objects of type line. Axes object 49 with title 16 contains 2 objects of type line. Axes object 50 with title 15 contains 2 objects of type line. Axes object 51 with title 14 contains 2 objects of type line. Axes object 52 with title 13 contains 2 objects of type line. Axes object 53 with title 12 contains 2 objects of type line. Axes object 54 with title 11 contains 2 objects of type line. Axes object 55 with title 10 contains 2 objects of type line. Axes object 56 with title 9 contains 2 objects of type line. Axes object 57 with title 8 contains 2 objects of type line. Axes object 58 with title 7 contains 2 objects of type line. Axes object 59 with title 6 contains 2 objects of type line. Axes object 60 with title 5 contains 2 objects of type line. Axes object 61 with title 4 contains 2 objects of type line. Axes object 62 with title 3 contains 2 objects of type line. Axes object 63 with title 2 contains 2 objects of type line. Axes object 64 with title 1 contains 2 objects of type line.

使用总体参数估计可视化拟合结果。

情节(nlmeResults“ParameterType”“人口”);

图中包含64个轴对象。Axes对象1是空的。Axes对象2是空的。坐标轴对象3是空的。坐标轴对象4是空的。Axes对象5是空的。标题59的axis对象6包含2个类型为line的对象。标题为58的axis对象7包含2个类型为line的对象。标题为57的轴对象8包含2个类型为line的对象。标题56的轴对象9包含2个类型为line的对象。 Axes object 10 with title 55 contains 2 objects of type line. Axes object 11 with title 54 contains 2 objects of type line. Axes object 12 with title 53 contains 2 objects of type line. Axes object 13 with title 52 contains 2 objects of type line. Axes object 14 with title 51 contains 2 objects of type line. Axes object 15 with title 50 contains 2 objects of type line. Axes object 16 with title 49 contains 2 objects of type line. Axes object 17 with title 48 contains 2 objects of type line. Axes object 18 with title 47 contains 2 objects of type line. Axes object 19 with title 46 contains 2 objects of type line. Axes object 20 with title 45 contains 2 objects of type line. Axes object 21 with title 44 contains 2 objects of type line. Axes object 22 with title 43 contains 2 objects of type line. Axes object 23 with title 42 contains 2 objects of type line. Axes object 24 with title 41 contains 2 objects of type line. Axes object 25 with title 40 contains 2 objects of type line. Axes object 26 with title 39 contains 2 objects of type line. Axes object 27 with title 38 contains 2 objects of type line. Axes object 28 with title 37 contains 2 objects of type line. Axes object 29 with title 36 contains 2 objects of type line. Axes object 30 with title 35 contains 2 objects of type line. Axes object 31 with title 34 contains 2 objects of type line. Axes object 32 with title 33 contains 2 objects of type line. Axes object 33 with title 32 contains 2 objects of type line. Axes object 34 with title 31 contains 2 objects of type line. Axes object 35 with title 30 contains 2 objects of type line. Axes object 36 with title 29 contains 2 objects of type line. Axes object 37 with title 28 contains 2 objects of type line. Axes object 38 with title 27 contains 2 objects of type line. Axes object 39 with title 26 contains 2 objects of type line. Axes object 40 with title 25 contains 2 objects of type line. Axes object 41 with title 24 contains 2 objects of type line. Axes object 42 with title 23 contains 2 objects of type line. Axes object 43 with title 22 contains 2 objects of type line. Axes object 44 with title 21 contains 2 objects of type line. Axes object 45 with title 20 contains 2 objects of type line. Axes object 46 with title 19 contains 2 objects of type line. Axes object 47 with title 18 contains 2 objects of type line. Axes object 48 with title 17 contains 2 objects of type line. Axes object 49 with title 16 contains 2 objects of type line. Axes object 50 with title 15 contains 2 objects of type line. Axes object 51 with title 14 contains 2 objects of type line. Axes object 52 with title 13 contains 2 objects of type line. Axes object 53 with title 12 contains 2 objects of type line. Axes object 54 with title 11 contains 2 objects of type line. Axes object 55 with title 10 contains 2 objects of type line. Axes object 56 with title 9 contains 2 objects of type line. Axes object 57 with title 8 contains 2 objects of type line. Axes object 58 with title 7 contains 2 objects of type line. Axes object 59 with title 6 contains 2 objects of type line. Axes object 60 with title 5 contains 2 objects of type line. Axes object 61 with title 4 contains 2 objects of type line. Axes object 62 with title 3 contains 2 objects of type line. Axes object 63 with title 2 contains 2 objects of type line. Axes object 64 with title 1 contains 2 objects of type line.

使用箱线图显示估计参数的变化。

箱线图(nlmeResults)

图中包含一个轴对象。axis对象包含14个类型为line的对象。

将模型预测与实际数据进行比较。

plotActualVersusPredicted (nlmeResults)

图中包含一个轴对象。轴对象包含3个类型为line的对象。

画出残差的分布。

plotResidualDistribution (nlmeResults)

图中包含4个轴对象。坐标轴对象1包含两个类型为bar, line的对象。坐标轴对象2包含两个类型为bar, line的对象。标题为IWRES的轴对象3包含3个类型为line的对象。标题为CWRES的轴对象4包含3个类型为line的对象。

使用上的模型预测绘制每个响应的残差x设在。

plotResiduals (nlmeResults'预测'

图中包含一个轴对象。轴对象包含3个类型为line的对象。

输入参数

全部折叠

SimBiology模型,指定为SimBiology模型对象.活动configset对象的模型包含仿真求解器设置。任何活性剂量和变异均适用于模拟期间的模型,除非使用剂量变体分别输入参数。

数据拟合,指定为groupedData对象

时间变量的名称必须定义在IndependentVariableName的属性grpData.例如,如果时间变量的名称是“时间”,然后指定如下。

grpData.Properties.IndependentVariableName =“时间”

grpData必须至少有两个组,且分组变量name的名称必须在GroupVariableName的属性grpData.例如,如果分组变量的名称为“集团”,然后指定如下。

grpData.Properties.GroupVariableName =“集团”
一组通常是指代表一个单一时间过程的一组测量,通常对应于一个特定的个人或实验条件。

请注意

sbiofitmixed使用分类识别组的功能。如果任何组值被转换为相同的值分类,那么这些观察结果就被视为属于同一组。例如,如果一些观察没有组信息(即空字符向量),则分类将空字符向量转换为<定义>,这些观察结果被视为一组。

将模型组件的信息映射到grpData,指定为字符向量、字符串、字符串向量或字符向量的单元格数组。

每个字符向量或字符串都是类似等式的表达式,类似于SimBiology中的赋值规则。它包含数量(品种、分格或参数)的名称(或限定名称)或可观测的模型中的对象sm,后面跟着字符“=”变量名grpData.为清晰起见,名称和之间允许有空格“=”

例如,如果你有浓度数据“浓缩的”grpData为一个物种“Drug_Central”,您可以如下指定它。

ResponseMap =“Drug_Central =浓缩的”

要毫不含糊地命名物种,请使用限定名称,其中包含隔间名称。要命名反作用范围的参数,请使用反应名称限定参数。

如果模型组件名或grpData变量名不是一个有效的MATLAB®变量名,用方括号括起来,例如:

ResponseMap =”[1]中部。[Central 1 Conc]'

如果变量名本身包含方括号,则不能在表达式中使用方括号来定义映射信息。

如果任何(限定的)名称匹配同一类型的两个组件,则会发出错误。但是,您可以使用匹配不同类型的两个组件的(限定)名称,函数首先查找给定名称的物种,然后是区域和参数。

的估计参数,指定为向量estimatedInfo对象或一个CovariateModel对象它定义了模型中估计的参数sm,他们的初始估计(可选),以及他们与包括在内的群体特定协变量的关系grpData(可选)。如果这是向量estimatedInfo对象,则不使用协变量,所有参数估计与群体特定的随机效应。

如果需要,还可以指定参数转换。万博1manbetx支持转换是日志分对数,probit.有关详细信息,请参见EstimatedInfo对象CovariateModel对象

如果covEstiminfo是向量estimatedInfo对象,呢CategoryVariableName属性的值将被忽略。

剂量信息,指定为空数组([]{})、剂量对象的二维矩阵或细胞载体(ScheduleDose对象RepeatDose对象).

如果省略剂量输入时,该函数应用模型的活性剂量(如果有的话)。

如果您指定输入为空[]{},在模拟过程中不施加剂量,即使模型有活性剂量。

对于剂量对象矩阵,输入数据中必须有一行或每组一行。如果它只有一行,则在模拟过程中对所有组应用相同的剂量。如果它有多行,则每一行应用于一个单独的组,其顺序与组在输入数据中出现的顺序相同。允许使用多个列,以便可以将多个剂量对象应用到每组。

请注意

从R2021b开始,列中的剂量不再需要具有相同的配置。如果您先前创建了默认(虚拟)剂量来填充列,则这些默认剂量没有作用,并表示没有剂量。

对于剂量的细胞向量,输入数据中必须有一个或每个组一个元素。每个元素必须是[]或者是剂量的载体。单元格的每个元素应用于一个单独的组,其顺序与组在输入数据中出现的顺序相同。

除了使用sbiodose,如果输入groupedData物体有剂量信息,你可以使用createDoses构造剂量的方法。

估计函数名,指定为字符向量或字符串。的选择是“nlmefit”“nlmefitsa”.有关所支持的方法和适合的选项,请万博1manbetx参见万博1manbetxSimBiology中支持的参数估计方法

特定于评估函数的选项,指定为一个结构。

该结构可以包含字段和默认值,它们是被接受的名称-值参数nlmefit(统计学和机器学习工具箱)nlmefitsa(统计学和机器学习工具箱),但以下内容不受支持。万博1manbetx

  • “FEConstDesign”

  • “FEGroupDesign

  • “FEObsDesign”

  • “FEParamsSelect”

  • “ParamTransform”

  • “REConstDesign”

  • “REGroupDesign”

  • “REObsDesign”

  • 向量化的

“REParamsSelect”仅当您提供的向量万博1manbetx为estimatedInfo对象时指定估计参数。

使用statset(统计学和机器学习工具箱)函数仅用于设置“选项”结构域(选择),如下所示。

opt.Options = statset (“显示”“通路”“TolX”1 e - 3,“TolFun”1 e - 3);

有关其他受支持的名称万博1manbetx-值参数(请参阅nlmefit(统计学和机器学习工具箱)nlmefitsa(统计学和机器学习工具箱)),设置如下。

opt.ErrorModel =“比例”;opt.ApproximationType =LME的

变量,指定为空数组([]{})或变量对象的向量。

如果你

  • 省略此输入参数,函数将应用模型的活动变体(如果有的话)。

  • 将此输入指定为空,即使模型有活动的变体,也不会使用任何变体。

  • 将此输入指定为变量向量,该函数将指定的变量应用于所有模拟,且不使用模型活动变量。

  • 将此输入指定为变量向量,并指定变体参数Name-value时,函数先应用此输入参数中指定的变量,然后再应用Name-value参数中指定的变量。

名称-值参数

指定可选的逗号分隔的对名称,值参数。的名字参数名和价值为对应值。的名字必须出现在引号内。可以以任意顺序指定多个名称和值对参数Name1, Value1,…,的家

例子:“UseParallel”,没错,‘ProgressPlot’,真的指定并行运行模拟并显示参数估计的进度。

启用并行化的标志,指定为数字或逻辑1真正的)或0).如果真正的和Parallel Computing Toolbox™可用时,该函数并行执行参数估计。

标志,显示参数估计的进度,以数字或逻辑形式指定1真正的)或0).如果真正的,将打开包含情节的新图形。

情节显示固定效果参数的值(θ),方差参数的估计,即随机效应协方差矩阵(Ψ)的对角元素,以及对数似然。有关详细信息,请参见情节进展

组特定的变量,指定为空数组([]{}),不同对象的二维矩阵或细胞向量。这些变体允许您在拟合期间为特定组指定参数值。该软件应用这些群体特定的变种后,活动变种或变体输入参数。如果值为空([]{}),没有特定群体的变异应用。

对于变量对象的矩阵,行数必须为1或必须与输入数据中的组数匹配。的对第一行变量对象进行了仿真集团。变量按从第一列到最后一列的顺序应用。如果这个矩阵只有一行变量,那么它们将应用于所有的模拟。

对于变体对象的单元格向量,单元格的数量必须为一个或必须与输入数据中的组的数量相匹配。每个元素必须是[]或者是一个变量向量。如果这个单元格向量有一个包含变异向量的单元格,则将它们应用于所有模拟。如果细胞载体有多个细胞,则将该单元应用于仿真集团。

除了使用手动构造变量对象sbiovariant,如果输入groupedData对象具有变体信息,可以使用createVariants构建变体。

输出参数

全部折叠

估算结果,返回为nlmeresults对象

仿真结果,返回为向量SimData对象代表每个组(或个人)的模拟结果,使用固定效应和随机效应估计(个人特定参数估计)。

报告的州simDataI这些州包括在ResponseMap属性中列出的任何其他状态StatesToLog属性(RuntimeOptions)的SimBiology模型sm

仿真结果,返回为向量SimData对象代表每个组(或个人)的模拟结果,仅使用固定效应估计(总体参数估计)。

报告的州simDataP这些州包括在ResponseMap属性中列出的任何其他状态StatesToLog属性(RuntimeOptions)的SimBiology模型sm

参考

Grasela Jr, T.H., Donn, S.M.(1985)常规临床数据衍生的苯巴比妥新生儿人群药代动力学。医药科学8(6),374-83。

扩展功能

介绍了R2014a