Main Content

verify

Check covariate model for errors

Description

example

verify(CovModel) verifies that the following are true about the Expression property of the CovariateModel object, CovModel:

  • The expressions are valid MATLAB® code.

  • Each expression is linear with a transformation.

  • There is exactly one expression for each parameter.

  • In each expression, a covariate is used in at most one term.

  • In each expression, there is at most one random effect (eta)

  • Fixed effect (theta) and random effect (eta) names are unique within and across expressions. That is, each covariate has its own fixed effect.

Examples

collapse all

Create an empty CovariateModel object.

covModel = CovariateModel;

Set its Expression property to define the relationships between parameters (Cl, V, and k) and covariate (w). You must use theta as a prefix for all fixed effects and eta for random effects.

covModel.Expression = ["Cl = theta1 + theta2*w + eta1","V = theta3 + eta2","k = theta4 + eta3"];

Display the names of fixed effects.

covModel.FixedEffectNames
ans = 4x1 cell
    {'theta1'}
    {'theta3'}
    {'theta4'}
    {'theta2'}

The FixedEffectDescription property displays which fixed effects correspond to which parameter. For instance, theta1 is the fixed effect for the Cl parameter, and theta2 is the fixed effect for the weight covariate that has a correlation with Cl parameter, denoted as Cl/w.

covModel.FixedEffectDescription
ans = 4x1 cell
    {'Cl'  }
    {'V'   }
    {'k'   }
    {'Cl/w'}

Specify initial estimates for the fixed effects. Create a default structure containing initial estimates using the constructDefaultFixedEffectValues function.

initialEstimates = constructDefaultFixedEffectValues(covModel)
initialEstimates = struct with fields:
    theta1: 0
    theta3: 0
    theta4: 0
    theta2: 0

Update the initial estimate value of each fixed effects.

initialEstimates.theta1 = 1.20;
initialEstimates.theta2 = 0.30;
initialEstimates.theta3 = 0.90;
initialEstimates.theta4 = 0.10;

Update the FixedEffectValues property to use the updated initial estimates.

covModel.FixedEffectValues = initialEstimates;

Check the covariate model for errors.

verify(covModel)

Input Arguments

collapse all

Covariate model, specified as a CovariateModel object.

Version History

Introduced in R2011b