exponenta event banner

sbiosampleparameters

Создание параметров путем выборки ковариатной модели (требуется программное обеспечение Statistics and Machine Learning Toolbox)

Описание

пример

phi = sbiosampleparameters(covexpr,thetas,omega,ds) генерирует матрицу phi содержащий выборочные значения параметров, используя ковариатную модель, заданную ковариатным выражением covexpr, фиксированные эффекты thetas, ковариационная матрица omegaи ковариатные данные ds.

пример

phi = sbiosampleparameters(covexpr,thetas,omega,n) использует скаляр n количество строк в phi когда параметры не зависят от какого-либо ковариата.

пример

[phi,covmodel] = sbiosampleparameters(_) возвращает матрицу phi и объект ковариатной модели covmodel с использованием любого из входных аргументов из предыдущих синтаксисов.

Примеры

свернуть все

В этом примере используются данные, собранные о 59 недоношенных детях, получавших фенобарбитал в течение первых 16 дней после рождения. Каждый ребенок получал начальную дозу с последующей одной или несколькими поддерживающими дозами путем внутривенного введения болюса. Всего от 1 до 6 измерений концентрации получали от каждого младенца в моменты времени, отличные от времени дозы, для общего количества 155 измерений. Вес младенцев и баллы APGAR (показатель здоровья новорожденных) также были зарегистрированы. Данные были описаны в [1], исследовании, финансируемом грантовым P41-EB01975 NIH/NIBIB.

Загрузите данные.

load pheno.mat ds

Визуализация данных.

t = sbiotrellis(ds,'ID','TIME','CONC','marker','o','markerfacecolor',[.7 .7 .7],'markeredgecolor','r','linestyle','none');
t.plottitle = 'States versus Time';

Figure contains 64 axes. Axes 1 with title ID 1 contains an object of type line. This object represents CONC. Axes 2 with title ID 9 contains an object of type line. Axes 3 with title ID 17 contains an object of type line. Axes 4 with title ID 25 contains an object of type line. Axes 5 with title ID 33 contains an object of type line. Axes 6 with title ID 41 contains an object of type line. Axes 7 with title ID 49 contains an object of type line. Axes 8 with title ID 57 contains an object of type line. Axes 9 with title ID 2 contains an object of type line. Axes 10 with title ID 10 contains an object of type line. Axes 11 with title ID 18 contains an object of type line. Axes 12 with title ID 26 contains an object of type line. Axes 13 with title ID 34 contains an object of type line. Axes 14 with title ID 42 contains an object of type line. Axes 15 with title ID 50 contains an object of type line. Axes 16 with title ID 58 contains an object of type line. Axes 17 with title ID 3 contains an object of type line. Axes 18 with title ID 11 contains an object of type line. Axes 19 with title ID 19 contains an object of type line. Axes 20 with title ID 27 contains an object of type line. Axes 21 with title ID 35 contains an object of type line. Axes 22 with title ID 43 contains an object of type line. Axes 23 with title ID 51 contains an object of type line. Axes 24 with title ID 59 contains an object of type line. Axes 25 with title ID 4 contains an object of type line. Axes 26 with title ID 12 contains an object of type line. Axes 27 with title ID 20 contains an object of type line. Axes 28 with title ID 28 contains an object of type line. Axes 29 with title ID 36 contains an object of type line. Axes 30 with title ID 44 contains an object of type line. Axes 31 with title ID 52 contains an object of type line. Axes 32 is empty. Axes 33 with title ID 5 contains an object of type line. Axes 34 with title ID 13 contains an object of type line. Axes 35 with title ID 21 contains an object of type line. Axes 36 with title ID 29 contains an object of type line. Axes 37 with title ID 37 contains an object of type line. Axes 38 with title ID 45 contains an object of type line. Axes 39 with title ID 53 contains an object of type line. Axes 40 is empty. Axes 41 with title ID 6 contains an object of type line. Axes 42 with title ID 14 contains an object of type line. Axes 43 with title ID 22 contains an object of type line. Axes 44 with title ID 30 contains an object of type line. Axes 45 with title ID 38 contains an object of type line. Axes 46 with title ID 46 contains an object of type line. Axes 47 with title ID 54 contains an object of type line. Axes 48 is empty. Axes 49 with title ID 7 contains an object of type line. Axes 50 with title ID 15 contains an object of type line. Axes 51 with title ID 23 contains an object of type line. Axes 52 with title ID 31 contains an object of type line. Axes 53 with title ID 39 contains an object of type line. Axes 54 with title ID 47 contains an object of type line. Axes 55 with title ID 55 contains an object of type line. Axes 56 is empty. Axes 57 with title ID 8 contains an object of type line. Axes 58 with title ID 16 contains an object of type line. Axes 59 with title ID 24 contains an object of type line. Axes 60 with title ID 32 contains an object of type line. Axes 61 with title ID 40 contains an object of type line. Axes 62 with title ID 48 contains an object of type line. Axes 63 with title ID 56 contains an object of type line. Axes 64 is empty.

Создайте однокамерную модель ПК с болюсным дозированием и линейным зазором для моделирования таких данных.

pkmd = PKModelDesign;
pkmd.addCompartment('Central','DosingType','Bolus','EliminationType','linear-clearance',...
                    'HasResponseVariable',true,'HasLag',false);
onecomp = pkmd.construct;

Предположим, существует корреляция между объёмом центрального отсека (Central) и вес младенцев. Вы можете определить этот параметр-ковариатное отношение, используя ковариатную модель, которая может быть описана как

log (Vi) =θV+θVWEIGHT∗WEIGHTi+ηV,i ,

где, для каждого i-го младенца, V - объём, starts (thetas) являются фиксированными эффектами, start( eta) представляет случайные эффекты, и WEIGHT - ковариата.

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

Определите фиксированные и случайные эффекты. Имена столбцов каждой таблицы должны иметь имена фиксированных эффектов и случайных эффектов соответственно.

thetas = table(1.4,0.05,'VariableNames',{'theta1','theta2'});
eta1 = table(0.2,'VariableNames',{'eta1'});

Измените идентификатор метки группы на GROUP в соответствии с требованиями sbiosampleparameters функция.

ds.Properties.VariableNames{'ID'} = 'GROUP';

Создайте значения параметров для объемов центральных отделений Central на основе ковариатной модели для всех младенцев в наборе данных.

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

Затем можно смоделировать модель, используя значения параметров выборки. Для удобства используйте функциональный интерфейс, предоставляемый объектом SimFunction.

Сначала создайте объект SimFunction с помощью метода createSimFunction, указав объем (Central) в качестве параметра и концентрацию лекарственного средства в отсеке (Drug_Central) в качестве выхода объекта SimFunction и дозированные виды.

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

Набор данных ds содержит информацию о дозировании для каждого младенца, и объект groupedData обеспечивает удобный способ извлечь такую информацию о дозировании. Преобразуйте ds в объект groupedData и извлечение, дозирующее информацию.

grpData = groupedData(ds);
doses = createDoses(grpData,'DOSE');

Смоделировать модель, используя отобранные значения параметров из phi и извлеченную информацию о дозировке каждого ребенка, и построить график результатов. i-й прогон использует значение i-го параметра в фи и дозирующей информации i-го младенца.

t = sbiotrellis(f(phi,200,doses.getTable),[],'TIME','Drug_Central');
% Resize the figure.
t.hFig.Position(:) = [100 100 1280 800];

Figure contains 64 axes. Axes 1 with title Run 1 contains an object of type line. This object represents Drug_Central. Axes 2 with title Run 9 contains an object of type line. Axes 3 with title Run 17 contains an object of type line. Axes 4 with title Run 25 contains an object of type line. Axes 5 with title Run 33 contains an object of type line. Axes 6 with title Run 41 contains an object of type line. Axes 7 with title Run 49 contains an object of type line. Axes 8 with title Run 57 contains an object of type line. Axes 9 with title Run 2 contains an object of type line. Axes 10 with title Run 10 contains an object of type line. Axes 11 with title Run 18 contains an object of type line. Axes 12 with title Run 26 contains an object of type line. Axes 13 with title Run 34 contains an object of type line. Axes 14 with title Run 42 contains an object of type line. Axes 15 with title Run 50 contains an object of type line. Axes 16 with title Run 58 contains an object of type line. Axes 17 with title Run 3 contains an object of type line. Axes 18 with title Run 11 contains an object of type line. Axes 19 with title Run 19 contains an object of type line. Axes 20 with title Run 27 contains an object of type line. Axes 21 with title Run 35 contains an object of type line. Axes 22 with title Run 43 contains an object of type line. Axes 23 with title Run 51 contains an object of type line. Axes 24 with title Run 59 contains an object of type line. Axes 25 with title Run 4 contains an object of type line. Axes 26 with title Run 12 contains an object of type line. Axes 27 with title Run 20 contains an object of type line. Axes 28 with title Run 28 contains an object of type line. Axes 29 with title Run 36 contains an object of type line. Axes 30 with title Run 44 contains an object of type line. Axes 31 with title Run 52 contains an object of type line. Axes 32 is empty. Axes 33 with title Run 5 contains an object of type line. Axes 34 with title Run 13 contains an object of type line. Axes 35 with title Run 21 contains an object of type line. Axes 36 with title Run 29 contains an object of type line. Axes 37 with title Run 37 contains an object of type line. Axes 38 with title Run 45 contains an object of type line. Axes 39 with title Run 53 contains an object of type line. Axes 40 is empty. Axes 41 with title Run 6 contains an object of type line. Axes 42 with title Run 14 contains an object of type line. Axes 43 with title Run 22 contains an object of type line. Axes 44 with title Run 30 contains an object of type line. Axes 45 with title Run 38 contains an object of type line. Axes 46 with title Run 46 contains an object of type line. Axes 47 with title Run 54 contains an object of type line. Axes 48 is empty. Axes 49 with title Run 7 contains an object of type line. Axes 50 with title Run 15 contains an object of type line. Axes 51 with title Run 23 contains an object of type line. Axes 52 with title Run 31 contains an object of type line. Axes 53 with title Run 39 contains an object of type line. Axes 54 with title Run 47 contains an object of type line. Axes 55 with title Run 55 contains an object of type line. Axes 56 is empty. Axes 57 with title Run 8 contains an object of type line. Axes 58 with title Run 16 contains an object of type line. Axes 59 with title Run 24 contains an object of type line. Axes 60 with title Run 32 contains an object of type line. Axes 61 with title Run 40 contains an object of type line. Axes 62 with title Run 48 contains an object of type line. Axes 63 with title Run 56 contains an object of type line. Axes 64 is empty.

Входные аргументы

свернуть все

Ковариатные выражения, задаваемые как клеточный массив символьных векторов или строкового вектора, который определяет отношения параметр-ковариата.

Если имя компонента модели или ковариатное имя не является допустимым именем переменной MATLAB ®, заключите его в квадратные скобки при ссылке на него в выражении. Например, если именем вида является ДНК-полимераза +, напишите[DNA polymerase+]. Если само ковариатное имя содержит квадратные скобки, его нельзя использовать в выражении.

Посмотрите CovariateModel object чтобы узнать больше о ковариатных выражениях.

Фиксированные эффекты, указанные как таблица, набор данных или числовой вектор, содержащий значения параметров фиксированного эффекта, определенных в ковариатных выражениях covexpr. Имена параметров фиксированного эффекта должны начинаться с 'theta'.

  • Если thetas является таблицей, thetas.Properties.VariableNames должны соответствовать именам фиксированных эффектов.

    Например, предположим, что у вас есть три тета: thetaOne = 0.1, theta2 = 0.2, и theta3 = 0.3. Можно создать соответствующую таблицу.

    thetas = table(0.1,0.2,0.3);
    thetas.Properties.VariableNames = {'thetaOne','theta2','theta3'}
    thetas =
    
      1×3 table
    
        thetaOne    theta2    theta3
        ________    ______    ______
    
          0.1        0.2       0.3  

  • Если thetas является набором данных, thetas.Properties.VarNames должны соответствовать именам фиксированных эффектов.

  • Если thetas - числовой вектор, порядок значений в векторе должен совпадать с порядком возрастания словаря ASCII в именах фиксированных эффектов.

    Используйте sort функция для сортировки массива ячеек символьных векторов для просмотра порядка.

    sort({'thetaOne','theta2','theta3'})
    ans =
    
      1×3 cell array
    
        {'theta2'}    {'theta3'}    {'thetaOne'}

    Затем укажите значение каждой тета в том же порядке.

    thetas = [0.2 0.3 0.1];

Ковариационная матрица случайных эффектов, заданная как таблица, набор данных или матрица. Имена параметров случайного эффекта должны начинаться с 'eta'.

  • Если omega является таблицей, omega.Properties.VariableNames должны соответствовать именам случайных эффектов. Указание имен строк (RowNames) является необязательным, но в этом случае они также должны совпадать с именами случайных эффектов.

    Предположим, что требуется определить диагональную ковариационную матрицу с тремя параметрами случайного эффекта eta1, eta2, и eta3 со значениями 0.1, 0.2, и 0.3соответственно.

    [Cov (η1, η1) ​​​​ Cov (η, 1η2) Cov (η1, η3) Cov (η2, η1) Cov (η2, η2) Cov (η2, η3) Cov (η3, η1) Cov (η3, η2) Cov (η3, η3)] = [eta1 0 00 eta2 00 0 eta3]

    Можно создать соответствующую таблицу.

    eta1 = [0.1;0;0];
    eta2 = [0;0.2;0];
    eta3 = [0;0;0.3];
    omega = 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 является набором данных, omega.Properties.VarNames должны соответствовать именам случайных эффектов. Указание имен строк (ObsNames) является необязательным, но в этом случае они также должны совпадать с именами случайных эффектов.

  • Если omega является матрицей, строки и столбцы должны иметь тот же восходящий порядок словаря ASCII, что и имена случайных эффектов.

    Используйте sort функция для сортировки массива ячеек символьных векторов для просмотра порядка.

    sort({'eta1','eta2','eta3'})
    ans =
    
      1×3 cell array
    
        {'eta1'}    {'eta2'}    {'eta3'}

Ковариатные данные, указанные как набор данных или таблица, содержащая ковариатные данные для всех групп.

ds должен иметь столбец с именем 'Group' или 'GROUP' указание меток групп, а также столбцов для всех ковариат, используемых в ковариатной модели. Имена столбцов должны совпадать с именами соответствующих ковариат, используемых в ковариатных выражениях.

Количество строк в phi, указывается как скаляр.

Выходные аргументы

свернуть все

Выборочные значения параметров, возвращаемые в виде матрицы размера S-by-P, где S - количество групп, указанное в ds или указано n и P - количество параметров, равное количеству элементов в covexpr.

Ковариатная модель, возвращенная как CovariateModel object которая представляет модель, определенную covexpr.

Вопросы совместимости

развернуть все

Предупреждает, начиная с R2018b

Ссылки

[1] Grasela Jr, T.H., Donn, S.M. (1985) Фармакокинетика фенобарбитала неонатальной популяции, полученная из обычных клинических данных. Дев Фармакол Тер. 8(6), 374–83.

Представлен в R2014a