I'm very interested. If you wouldn't mind I would love to see it.
Thank you for the help.
dre968 wrote:
>
> 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 s
Sent: Thursday, April 23, 2009 5:23 PM
To: r-help@r-project.org
Subject: Re: [R] Stuck using constrOptim
if i run the same program with
constrOptim(p0,minsquare,keys=keys,benKeys=benKeys,NULL,ui=A,ci=B,method="BF
GS")
i get the following error:
Error in dR(theta, theta.old, ...) : coul
so i set gr=Null:
> constrOptim(p0,minsquare,Y=Y,Z=Z,NULL,gr=NULL,ui=A,ci=B,method="BFGS")
and i recieved the following error:
Error in optim(theta.old, fun, gradient, control = control, method = method,
:
objective function in optim evaluates to length 0 not 1
--
View this message in context
if i run the same program with
constrOptim(p0,minsquare,keys=keys,benKeys=benKeys,NULL,ui=A,ci=B,method="BFGS")
i get the following error:
Error in dR(theta, theta.old, ...) : could not find function "grad"
i'm not very mathematically inclined, i dont even know what a gradient is.
any suggesti
ent: Thursday, April 23, 2009 4:22 PM
To: r-help@r-project.org
Subject: Re: [R] Stuck using constrOptim
Sorry for the not enough info. the code seems to work for 10 or so
variables but stops optimizing if i give it anymore than that.
#Load data
Data <- read.table..csv',head=TRUE,sep=
Sorry for the not enough info. the code seems to work for 10 or so variables
but stops optimizing if i give it anymore than that.
#Load data
Data <- read.table..csv',head=TRUE,sep=",",stringsAsFactors = FALSE)
#Load goal variables. this is what i'm trying to minimize to
Z<-read.tablecsv
-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
Sorry i Mean 900x1 not 3x900 below
dre968 wrote:
>
> 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
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 3
9 matches
Mail list logo