, method="L-BFGS-B" . , .
library(optimx); library(dplyr)
cap <- capture.output(optimx(runif(2), f, gr, method="L-BFGS-B",
control=list(trace=6, REPORT=1)))
temp <- cap[grep("X =|X0 =", cap)]
d <- gsub("X0 = |X = |Cauchy X = ", "", temp) %>% strsplit(" ") %>%
unlist() %>% as.numeric() %>% matrix(ncol=2, byrow=T)
plot(-2:2,-2:2, type="n", ann=F)
for(i in c(1,2,4)) polygon(c(-0.5,0,0.5,0, -0.5)*i, c(0, 0.5, 0, -0.5, 0)*i)
points(d, pch=letters[1:nrow(d)])
[]
, (opt/lbfgs_bcm.shar) (@ , !). method="L-BFGS-B", , control=list(trace=6, REPORT=1) .
