The information you have provided is not enough. Please read the posting guide on how ask for help. Provide a reproducible example so we can help you.
Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: rvarad...@jhmi.edu Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html ---------------------------------------------------------------------------- -------- -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of dre968 Sent: Thursday, April 23, 2009 3:20 PM To: r-help@r-project.org Subject: [R] Stuck using constrOptim Trying to use constrOptim to minimize the sum of squared deviations. I put the objective function in as: sum((x %*% Y - Z)^2) so i'm trying to get values for x to minimize the sum of the squared deviations between the product of x and Y and Z. Anyways i have no problem using this when x is a 3x1 test variable. it works great with the constraints and everything. when i actually use it on my data x is 3x900 or so and it wont optimize it just gives me back my initial guess....this is the output i'm getting: $value [1] 22.7438 $counts function gradient 906 NA $convergence [1] 1 $message NULL $outer.iterations [1] 1 $barrier.value [1] 1.381551e-06 this is definitely not the right answer and it is just spitting back my initial guess back. Any ideas? are there limits as to how big the variables can be for this function? -- View this message in context: http://www.nabble.com/Stuck-using-constrOptim-tp23197912p23197912.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.