Skip to contents

Modify Observation class in PML models

Usage

modify_Observation(
  PMLParametersSets,
  ObservationName,
  SigmasChosen,
  BQL,
  BQLValue,
  Frozen,
  ResetObs,
  Covariates,
  PMLStructures = NULL
)

Arguments

PMLParametersSets

A list of PML parameters sets (PMLModels class instance).

ObservationName

A character string giving the name of the Observation.

SigmasChosen

a Sigmas class instance or a list specifying the chosen sigma values for different error models. 0s are treated as no values. Inside Observation class it is transormed and kept as Sigmas class. The list could contain the following error models:

  • Additive The additive error sigma value.

  • LogAdditive The log-additive error sigma value.

  • Proportional The proportional error sigma value.

  • AdditiveMultiplicative A numeric vector specifying the additive and multiplicative parts for the additive-multiplicative error model. The vector should have names PropPart and AddPart.

  • MixRatio A numeric vector specifying the proportional and additive parts for the mix-ratio error model. The vector should have names PropPart and AddPart.

  • Power A numeric vector specifying the standard deviation and power parts for the power error model. The vector should have names StdevPart and PowerPart.

BQL

A logical value indicating whether the dataset contains BQL values and they should be taken into account (M3 method).

BQLValue

An optional numeric positive value of static LLOQ. Applicable only when BQL argument is TRUE. Any observed value less than or equal to that LLOQ value is treated as censored.

Frozen

A logical value indicating if the standard deviation (Stdev) is frozen.

ResetObs

A logical value indicating if the Observation variable should be reset to 0 after observation (doafter={A0=0;}). Applicable for elimination compartment.

Covariates

A list of covariates (Covariate instances) that should be included in the model, but not linked to any of structural parameters. Used with "Emax" PD models ('C' covariate is added automatically when creating a new model, but should be added manually when modifying the model).

PMLStructures

Character or character vector specifying names of PML structures in which the observation will be modified. For the naming convention of PMLStructures, see Details section of create_ModelPK() for PK models and create_ModelPD() for PD models.

Value

An updated list of PML models (PMLModels class instance) matching the specified options.

Details

This function can only be used to modify the structural parameters in the built-in models (i.e., created using either create_ModelEmax() or create_ModelPK()).

See also

list_Observations()

Functions used for Observation specification: Observation(), ObservationCustom(), Sigmas(), create_ModelPD(), create_ModelPK(), remove_Observation()

Examples

PMLParametersSets <-
  create_ModelPK(CompartmentsNumber = c(1, 2, 3))
# update structural paramter type
PMLParametersSetsVMod <-
 modify_Observation(
   PMLParametersSets,
   ObservationName = "CObs",
   SigmasChosen = Sigmas(Proportional = 0,
                         AdditiveMultiplicative =
                           list(PropPart = 0.1, AddPart = 10)))

print(PMLParametersSetsVMod)
#> PK1IVC 
#>  test() {
#> 	cfMicro(A1, Cl / V)
#> 	C = A1 / V
#> 	dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
#> 	error(CEps = 10)
#> 	observe(CObs = C + CEps*sqrt(1 + C*C*(CMultStdev/sigma())^2))
#> 	stparm(CMultStdev = tvCMultStdev )
#> 	fixef(tvCMultStdev= c(, 0.1, ))
#> 	
#> 	
#> 	stparm(Cl = tvCl * exp( nCl ))
#> 	fixef(tvCl= c(, 1, ))
#> 	ranef(diag(nCl) = c(1))
#> 	stparm(V = tvV * exp( nV ))
#> 	fixef(tvV= c(, 1, ))
#> 	ranef(diag(nV) = c(1))
#> 
#> } 
#> PK2IVC 
#>  test() {
#> 	cfMicro(A1, Cl / V, Cl2 / V, Cl2 / V2)
#> C = A1 / V
#> 	dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
#> 	error(CEps = 10)
#> 	observe(CObs = C + CEps*sqrt(1 + C*C*(CMultStdev/sigma())^2))
#> 	stparm(CMultStdev = tvCMultStdev )
#> 	fixef(tvCMultStdev= c(, 0.1, ))
#> 	
#> 	
#> 	stparm(Cl = tvCl * exp( nCl ))
#> 	fixef(tvCl= c(, 1, ))
#> 	ranef(diag(nCl) = c(1))
#> 	stparm(V = tvV * exp( nV ))
#> 	fixef(tvV= c(, 1, ))
#> 	ranef(diag(nV) = c(1))
#> 	stparm(Cl2 = tvCl2 * exp( nCl2 ))
#> 	fixef(tvCl2= c(, 1, ))
#> 	ranef(diag(nCl2) = c(1))
#> 	stparm(V2 = tvV2 * exp( nV2 ))
#> 	fixef(tvV2= c(, 1, ))
#> 	ranef(diag(nV2) = c(1))
#> 
#> } 
#> PK3IVC 
#>  test() {
#> 	cfMicro(A1, Cl / V, Cl2 / V, Cl2 / V2, Cl3 / V, Cl3 / V3)
#> 	C = A1 / V
#> 	dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
#> 	error(CEps = 10)
#> 	observe(CObs = C + CEps*sqrt(1 + C*C*(CMultStdev/sigma())^2))
#> 	stparm(CMultStdev = tvCMultStdev )
#> 	fixef(tvCMultStdev= c(, 0.1, ))
#> 	
#> 	
#> 	stparm(Cl = tvCl * exp( nCl ))
#> 	fixef(tvCl= c(, 1, ))
#> 	ranef(diag(nCl) = c(1))
#> 	stparm(V = tvV * exp( nV ))
#> 	fixef(tvV= c(, 1, ))
#> 	ranef(diag(nV) = c(1))
#> 	stparm(Cl2 = tvCl2 * exp( nCl2 ))
#> 	fixef(tvCl2= c(, 1, ))
#> 	ranef(diag(nCl2) = c(1))
#> 	stparm(V2 = tvV2 * exp( nV2 ))
#> 	fixef(tvV2= c(, 1, ))
#> 	ranef(diag(nV2) = c(1))
#> 	stparm(Cl3 = tvCl3 * exp( nCl3 ))
#> 	fixef(tvCl3= c(, 1, ))
#> 	ranef(diag(nCl3) = c(1))
#> 	stparm(V3 = tvV3 * exp( nV3 ))
#> 	fixef(tvV3= c(, 1, ))
#> 	ranef(diag(nV3) = c(1))
#> 
#> }