50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

dMod (version 0.1)

datapointL2: L2 objective function for validation data point

Description

L2 objective function for validation data point

Usage

datapointL2(p, prediction, mu, time = 0, sigma = 1, fixed = NULL)

Arguments

p
Namec numeric, the parameter values
prediction
Matrix with first column "time" and one column per predicted state. Can have an attribute deriv, the matrix of sensitivities. If present, derivatives of the objective function with respect to the parameters are returned.
mu
Named character of length one. Has the structure mu = c(parname = statename), where statename is one of the column names of prediction and parname is one of the names of p, allowing to treat
time
Numeric of length one. An existing time point in prediction.
sigma
Numeric of length one. The uncertainty assumed for the validation data point.
fixed
Named numeric with fixed parameter values (contribute to the prior value but not to gradient and Hessian)

Value

  • List of class obj, i.e. objective value, gradient and Hessian as list.

Details

Computes the constraint value $$\left(\frac{x(t)-\mu}{\sigma}\right)^2$$ and its derivatives with respect to p.

See Also

wrss, constraintL2

Examples

Run this code
prediction <- matrix(c(0, 1), nrow = 1, dimnames = list(NULL, c("time", "A")))
derivs <- matrix(c(0, 1, 0.1), nrow = 1, dimnames = list(NULL, c("time", "A.A", "A.k1")))
attr(prediction, "deriv") <- derivs
p0 <- c(A = 1, k1 = 2)
mu <- c(newpoint = "A")
timepoint <- 0

datapointL2(p = c(p, newpoint = 2), prediction, mu, timepoint)
datapointL2(p = c(p, newpoint = 1), prediction, mu, timepoint)
datapointL2(p = c(p, newpoint = 0), prediction, mu, timepoint)

Run the code above in your browser using DataLab