Learn R Programming

dMod (version 1.0.0)

datapointL2: L2 objective function for validation data point

Description

L2 objective function for validation data point

Usage

datapointL2(name, time, value, sigma = 1, attr.name = "validation",
  condition)

Arguments

name

character, the name of the prediction, e.g. a state name.

time

numeric, the time-point associated to the prediction

value

character, the name of the parameter which contains the prediction value.

sigma

numeric, the uncertainty of the introduced test data point

attr.name

character. The constraint value is additionally returned in an attributed with this name

condition

character, the condition for which the prediction is made.

Value

List of class objlist, 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
# NOT RUN {
prediction <- list(a = 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$a, "deriv") <- derivs
p0 <- c(A = 1, k1 = 2)

vali <- datapointL2(name = "A", time = 0, value = "newpoint", sigma = 1, condition = "a")
vali(pars = c(p0, newpoint = 1), env = .GlobalEnv)
# }

Run the code above in your browser using DataLab