search for: constraint2

Displaying 1 result from an estimated 1 matches for "constraint2".

Did you mean: constraints
2012 Sep 17
2
Constraint Optimization with constrOptim
...ction which should be minimized x <- matrixStartingEstimates fkt <- function(x) {t(x) %*% covarianceMatrix %*% x} #The constraints #The results should be greater 0 !DOES NOT WORK! constraint1 <- x[1:9] #The summ of the results should be between 0.999 and 1.001 constraint2 <- sum(matrixStartingEstimatesNegativ) constraint3 <- sum(x) constraintMatrix <- rbind(constraint1, constraint2, constraint3) constraintVektor <- c(0, -1.00001, 0.99999) #Optimization constrOptim(startingEstimates, fkt, NULL, ui = constraintMatrix, ci = constraintVektor) #----...