Displaying 1 result from an estimated 1 matches for "linearcomb".
2008 May 15
1
logistic transformation using nlminb
...for the minimisation
mat <- rmvnorm(10000, mean=c(3, 2.75, 2.8, 3, 2.9), sd=c(0.1,
0.1,0.12, 0.15, 0.10), cov=corr)
# here is the simple optimisation function that allows the 5th
element to be potentially negative
obj.funA <- function(opt, mat) {
opt <- c(opt, 1-sum(opt))
LinearComb <- mat%*%opt
obj <- -min(LinearComb)
obj
}
# I want to put an upper boundary constraint on the first variable -
not being greater than 0.35 and the rest being between 0 and 1
opt <- nlminb(rep(0,4), lower=rep(0,4), upper=c(0.35, 1, 1, 1) ,
obj.funA, mat=mat)
opt.x <- opt$parameters...