powered by
Soft L2 constraint on parameters
constraintL2(mu, sigma = 1, attr.name = "prior", condition = NULL)
named numeric, the prior values
named numeric of length of mu or numeric of length one.
character. The constraint value is additionally returned in an attributed with this name
character, the condition for which the constraint should apply. If NULL, applies to any condition.
NULL
object of class objfn
objfn
Computes the constraint value $$\left(\frac{p-\mu}{\sigma}\right)^2$$ and its derivatives with respect to p.
wrss
# NOT RUN { mu <- c(A = 0, B = 0) sigma <- c(A = 0.1, B = 1) myfn <- constraintL2(mu, sigma) myfn(pars = c(A = 1, B = -1)) # }
Run the code above in your browser using DataLab