//¤³¤Î¥Ú¡¼¥¸¤¬É½¼¨¤µ¤ì¤ëÊý¤Ï¡¢URL¤«¤é¡Öaction=SOURCE&¡×¤òºï½ü¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤ [[donlp2¤Î½ÐÎϤòÆɤ߲ò¤¯ - µ­»ö°ìÍ÷]] !!!¤È¤ê¤¢¤¨¤º¡ÖRosenbrock Banana function¡×¤Î·ë²Ì¤ò *Åê¹Æ¼Ô¡§ ¤ß¤å *¥«¥Æ¥´¥ê¡§ ¤Ê¤· *Í¥ÀèÅÙ¡§ ÉáÄÌ *¾õÂÖ¡§ Ãå¼ê *Æü»þ¡§ 2008ǯ07·î25Æü 17»þ10ʬ21Éà //{{bugstate}} !!ÆâÍÆ ¡ÖRosenbrock Banana function¡×¤òÂêºà¤Ë¡¢½ÐÎÏ·ë²Ì¤ò¸«¤Æ¤ß¤ë¡¥·ë²Ì¤¢¤ï¤»¤ÏR¤Ç¡¥ fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } grr <- function(x) { ## Gradient of 'fr' x1 <- x[1] x2 <- x[2] c(-400 * x1 * (x2 - x1 * x1) - 2 * (1 - x1), 200 * (x2 - x1 * x1)) } # x<=0.9, y-x>0.1 constrOptim(c(.5,0), fr, grr, ui=rbind(c(-1,0),c(1,-1)), ci=c(-0.9,0.1)) ¾å¤ÎÀ©Ìó¾ò·ï¤Ï¸í¤ê *x<=0.9, x-y>0.1 ¤¬Àµ²ò ¤Á¤Ê¤ß¤Ë¡¢ÉÔÅù¼°À©Ìó¤òÆþ¤ì¤Æ¡¢¼ý«¤·¤Ë¤¯¤¯¤·¤Æ¤¢¤ë ÆþÎϥѥé¥á¡¼¥¿¤Ï¤È¤ê¤¢¤¨¤º¤¢¤È¤ÇÎóµó¤¹¤ë¤È¤·¤Æ¡¢¤È¤ê¤¢¤¨¤º·ë²Ì¤ò¸«¤Æ¤ß¤ë ¤½¤ì¤â¡¢½çÎ󤬡֣± £²¡×¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡¢£¸²óÌܤΥ¤¥¿¥ì¡¼¥·¥ç¥ó¤ò¡¥ !!!·ë²Ì 8-th iteration step scf= 1.0000e+000 psist= 0.0000e+000 psi= 0.0000e+000 upsi= 0.0000e+000 fxst= 6.5000e+000 fx= 1.6483e-001 x= 6.4929e-002 4.0113e-002 --- ­¡ valid permutation of x 1 2 *scf **ÌÜŪ´Ø¿ô¤Î¥¹¥±¡¼¥ê¥ó¥° *psist **scaled penalty term at x_init *psi **scaled penalty term *upsi **unscaled l1-penalty term *fxst **½é´üÃͤÎÌÜŪ´Ø¿ô¤ÎÃÍ **½é´üÃͤϡʣ°¡¥£µ £°¡¥£°¡Ë R¤Ç³Îǧ > fr(c(0.5, 0)) [1] 6.5 *fx **¤¤¤Þ¤Î£ø¤Ç¤ÎÌÜŪ´Ø¿ô¤ÎÃÍ **¤¤¤Þ£ø¤Î¥¹¥±¡¼¥ê¥ó¥°¤ò£±£°¤Ë¤·¤Æ¤¤¤ë¤Î¤Çɾ²Á¤¹¤ëÃͤϭ¡¤Î£±£°ÇÜ R¤Ç³Îǧ > fr(c(6.4929e-001, 4.0113e-001)) [1] 0.1648075 *£ø **¤Ï¤â¤Á¤í¤ó¤¤¤Þ¤Î£ø¤ÎÃÍ *valid permutation of x **£ø¤Î½çÈÖ¡¢Æþ¤ìÂؤï¤Ã¤Æ¤ë¾ì¹ç¤¬¤¢¤ë¡¢¤Ê¤¼¡©¡© del= 6.00000e-002 b2n0= 2.86041e-001 b2n= 6.16332e+001 gfn= 6.16332e+001 *del **bound for currently active constraints¡Ê¦Äk¡Ë *b2n0 **l2-norm of projected gradient *b2n **weighted norm of projected gradient *gfn **Èù·¸¿ô¤Î¥Î¥ë¥à **¤³¤Î¥±¡¼¥¹¤À¤È¥¹¥±¡¼¥ê¥ó¥°¤¬£±£°¤Ê¤Î¤Ç°Ê²¼¤Î·×»»ÊýË¡ R¤Ç³Îǧ > sum((10 * grr(c(6.4929e-001, 4.0113e-001)))^2)^0.5 [1] 61.61821 ¿ô¼°¤Ç¤Ï *f(x) ¡á f(10x') *[f(x)]' ¡á [f(10x')]' * ¡á 10 £ø [f(x)]' * ¡á 10 £ø £ç£ò£ò(x) values of restrictions ( 1 1.4816e-001 1.0000e+001) ( 2 2.5071e-001 1.0000e+001) *values of restrictions **list of values of binding constraints and gradient norm R¤Ç³Îǧ > 6.4929e-001 - 4.0113e-001 - 0.1 [1] 0.14816 > - 6.4929e-001 + 0.9 [1] 0.25071 **Èù·¸¿ô¤ÏÀ©Ìó¾ò·ï¤ÎÄêµÁ¤«¤éÌÀ¤é¤« switch(i) { case 1: gradgi[1] = 1.e0; gradgi[2] = -1.e0; case 2: gradgi[1] = -1.e0; gradgi[2] = 0.e0; default: **¤¢¡¼¤ì¡¼¡©¤¿¤·¤«¡¢¤³¤ì¤Ï½ÐÎϤΥХ°¤À¤Ã¤¿¤Ê¡¦¡¦¡¦ !!¥³¥á¥ó¥È //{{comment}}