[R] Stuck using constrOptim
Ravi Varadhan
RVaradhan at jhmi.edu
Thu Apr 23 22:05:18 CEST 2009
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: rvaradhan at jhmi.edu
Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html
----------------------------------------------------------------------------
--------
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of dre968
Sent: Thursday, April 23, 2009 3:20 PM
To: r-help at 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 at 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.
More information about the R-help
mailing list