[R] Optimize selected variables but not all - nloptr
Narendra Modi
bjpmodi2016 at gmail.com
Wed Oct 19 23:59:08 CEST 2016
Hello All,
I have a matrix with initial values as below and I need to optimize
the variables that are greater than 0.
TAU fij fij2
[1,] 14.33375 0.0000000 0.01449572
[2,] 14.33375 0.0000000 0.00000000
[3,] 14.33375 0.0000000 0.00000000
[4,] 14.33375 0.0000000 0.02206446
[5,] 14.33375 0.0000000 0.00000000
[6,] 14.33375 0.0000000 0.00000000
[7,] 14.33375 0.0000000 0.00000000
[8,] 14.33375 0.8279846 0.00000000
[9,] 14.33375 0.0000000 0.03695833
[10,] 14.33375 0.0000000 0.00000000
Or structure(c(14.3337481730129, 14.3337481730129, 14.3337481730129,
14.3337481730129, 14.3337481730129, 14.3337481730129, 14.3337481730129,
14.3337481730129, 14.3337481730129, 14.3337481730129, 0, 0, 0,
0, 0, 0, 0, 0.827984553120177, 0, 0, 0.0144957197835888, 0, 0,
0.0220644627842788, 0, 0, 0, 0, 0.0369583294835073, 0), .Dim = c(10L,
3L), .Dimnames = list(NULL, c("TAU", "fij", "fij2")))
Is it possible to provide lowerbound and upperbound as 0 for variables
(< 0 in the initial matrix) and nloptr will consider them "unchanged"
during optimization?
Rstudio crashes when I try to do that. Is this a bug or I should
approach it differently?
NM
More information about the R-help
mailing list