主要内容

sbiosampleparameters

通过抽样协变量模型生成参数(需要统计和机器学习工具箱软件)

描述

例子

φ= sbiosampleparameters (covexprθωds生成一个矩阵φ使用由协变量表达式指定的协变量模型包含采样的参数值covexpr,固定效果θ,协方差矩阵ω,协变量数据ds

例子

φ= sbiosampleparameters (covexprθωn使用标量n它指定其中的行数φ当参数不依赖于任何协变量时。

例子

φcovmodel= sbiosampleparameters(_)返回一个矩阵φ和一个协变量模型对象covmodel使用以前语法中的任何输入参数。

例子

全部折叠

本例使用了在出生后16天内给予苯巴比妥的59名早产儿的数据。每个婴儿接受初始剂量,然后静脉注射一次或多次持续剂量。除剂量时间外,对每个婴儿总共进行了1至6次浓度测量,总共进行了155次测量。还记录了婴儿体重和APGAR评分(新生儿健康的衡量标准)。数据描述在[1]中,由NIH/NIBIB拨款P41-EB01975资助的一项研究。

加载数据。

负载pheno.matds

可视化数据。

T = sbiotrellis(ds,“ID”“时间”“浓缩的”“标记”“o”“markerfacecolor”,(。7 .7 .7],“markeredgecolor”“r”“线型”“没有”);t.plottitle =“国家与时间”

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

建立一个单室药室PK模型,采用丸量和线性间隙对这些数据进行建模。

pkmd = PKModelDesign;pkmd.addCompartment (“中央”“DosingType”“丸”“EliminationType”“linear-clearance”...“HasResponseVariable”,真的,“HasLag”、假);Onecomp = pkmd.construct;

假设中央隔室的体积(中央)和婴儿的体重。您可以使用协变量模型定义此参数-协变量关系,该协变量模型可以描述为

日志 V θ V + θ V W E G H T W E G H T + η V

在那里,每生一个婴儿,V体积,θs (theta)是固定效应,η (eta)是随机效应,和重量是协变量。

covM = CovariateModel;covM。Expression = {'Central = exp(theta1+theta2*WEIGHT+eta1)'};

定义固定和随机效果。每个表的列名必须分别具有固定效果和随机效果的名称。

theta =表(1.4,0.05,“VariableNames”, {“θ₁”“θ”});Eta1 = table(0.2,“VariableNames”, {“eta1”});

中将组标签ID修改为groupsbiosampleparameters函数。

ds.Properties.VariableNames {“ID”} =“集团”

根据数据集中所有婴儿的协变量模型,生成central compartments central体积的参数值。

phi = sbiosampleparameters(covM.Expression,theta,eta1,ds);

然后可以使用采样的参数值模拟模型。为方便起见,使用SimFunction对象提供的类函数接口。

首先,使用createSimFunction方法构造一个SimFunction对象,将体积(Central)指定为参数,将药室中的药物浓度(Drug_Central)指定为SimFunction对象的输出,并指定给药的种类。

f = createSimFunction(onecomp,covM. f)ParameterNames,“Drug_Central”“Drug_Central”);

数据集ds包含每个婴儿的剂量信息,groupedData对象提供了一种提取这种剂量信息的方便方法。将ds转换为groupedData对象并提取剂量信息。

grpData = groupedData(ds);剂量= createdose (grpData,“剂量”);

使用phi的采样参数值和提取的每个婴儿的给药信息模拟模型,并绘制结果。第i次运行使用phi中的第i个参数值和第i个婴儿的剂量信息。

t = sbiotrellis(f(phi,200,dose . gettable),[],“时间”“Drug_Central”);调整图形的大小。t.hFig.Position(:) = [100 100 1280 800];

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

输入参数

全部折叠

协变量表达式,指定为定义参数-协变量关系的字符向量或字符串向量的单元格数组。

如果模型组件名称或协变量名称不是有效的MATLAB®变量名,在表达式中引用时用方括号将其括起来。例如,如果一个物种的名称是DNA聚合酶+,写(DNA聚合酶+).如果协变量名称本身包含方括号,则不能在表达式中使用它。

看到CovariateModel对象了解更多协变量表达式。

固定效果,指定为包含协变量表达式中定义的固定效果参数值的表、数据集或数字向量covexpr.固定效果参数名称必须以“θ”

  • 如果θ是一张桌子,thetas.Properties.VariableNames必须与固定效果的名称匹配。

    例如,假设你有三个θthetaOne= 0.1θ= 0.2,1= 0.3.您可以创建相应的表。

    =表(0.1,0.2,0.3);thetas.Properties.VariableNames = {“thetaOne”“θ”“1”
    θ= 1×3表thetaOneθ1  ________ ______ ______ 0.1 0.2 0.3

  • 如果θ是一个数据集,thetas.Properties.VarNames必须与固定效果的名称匹配。

  • 如果θ是数值向量,向量中值的顺序必须与固定效果名称的升序ASCII字典顺序相同。

    使用排序函数对字符向量的单元格数组排序以查看顺序。

    排序({“thetaOne”“θ”“1”})
    ans = 1×3单元格数组{'theta2'} {'theta3'} {'thetaOne'}

    然后指定每一个的值θ同样的顺序。

    theta = [0.2 0.3 0.1];

随机效应的协方差矩阵,指定为表、数据集或矩阵。随机效果参数名称必须以“埃塔”

  • 如果ω是一张桌子,omega.Properties.VariableNames必须与随机效果的名称匹配。指定行名(RowNames)是可选的,但如果你这样做,它们也必须匹配随机效果的名称。

    假设你想定义一个有三个随机效应参数的对角线协方差矩阵eta1eta2,eta3用价值观0.10.2,0.3,分别。

    C o v η 1 η 1 C o v η 1 η 2 C o v η 1 η 3. C o v η 2 η 1 C o v η 2 η 2 C o v η 2 η 3. C o v η 3. η 1 C o v η 3. η 2 C o v η 3. η 3. e t 一个 1 0 0 0 e t 一个 2 0 0 0 e t 一个 3.

    您可以构造相应的表。

    Eta1 = [0.1;0;0];Eta2 = [0;0.2;0];Eta3 = [0;0;0.3];= table(eta1,eta2,eta3,“VariableNames”, {“eta1”“eta2”“eta3”})
    Omega = 3×3 table eta1 eta2 eta3 ____ ____ ____ 0.1 0 0 0 0.2 0 0 0 0.3

  • 如果ω是一个数据集,omega.Properties.VarNames必须与随机效果的名称匹配。指定行名(ObsNames)是可选的,但如果你这样做,它们也必须匹配随机效果的名称。

  • 如果ω为矩阵,行和列必须具有与随机效果名相同的升序ASCII字典顺序。

    使用排序函数对字符向量的单元格数组排序以查看顺序。

    排序({“eta1”“eta2”“eta3”})
    Ans = 1×3单元格数组{'eta1'} {'eta2'} {'eta3'}

协变量数据,指定为包含所有组的协变量数据的数据集或表。

ds必须有一个列命名“集团”“集团”为协变量模型中使用的所有协变量分别指定组标签和列。列名必须与协变量表达式中使用的相应协变量的名称匹配。

中的行数φ,指定为标量。

输出参数

全部折叠

采样的参数值,返回为大小为S-by-P的矩阵,其中年代中是否指定了组数ds或由n而且P参数的数量是否等于元素的数量covexpr

协变量模型,返回为CovariateModel对象哪个表示定义的模型covexpr

兼容性的考虑

全部展开

R2018b开始警告

参考文献

Grasela Jr, t.h., Donn, S.M.(1985)新生儿人群中苯巴比妥的药代动力学来源于常规临床数据。中国药物学杂志,8(6),374-83。

在R2014a中引入