âå°å ¥ã®è¨äºã¯ãã¡ã http://d.hatena.ne.jp/teramonagi/20091217/1261048574 ç°¡åãªä¾é¡ãéãã¦åä½ã確ãããã¨ãã library(Rsolnp) #(x,y)=(1,2)ã§æå°å¤ãã¨ããããªå¸é¢æ° objectiveFunc <- function(x_) { return(sum((x_-c(1,2))^2)) } #決å®å¤æ°ã®ã¹ã¿ã¼ãå¤ x0 <- c(100,100) #æé©å solution <- solnp(x0,fun = objectiveFunc) #çµæåºå print(solution) ãããèµ°ãããã¨æå¾ã®printåãã > print(solution) $pars [1] 1 2 $convergence [1] 0 $values [1] 1.940500e+04 4.909325e-11 1.1498
{{#tags}}- {{label}}
{{/tags}}