i'm trying to use the BB package to minimize the sum of the squared
deviations for 2 vectors. The only thing am having trouble with is defining
the project constraint. I got the upper and lower bounds to work but i am
not sure how to create a constraint that the sum of x must be 1. Any help
wou
I read in a CSV file with Data <-
read.csv(file="FileName.csv",head=TRUE,sep=",")
the file containts strings in the 2nd and 3rd columns and each has about
1000 rows. I need to either loop through the strings there looking for
strings that would trigger other logic or remove those rows and put th
I have a loop and an if statement in the loop. once the if statement is true
for 1 value in the loop i'd like to exit the loop. is there a command to do
this? i know its going to be something like exit and i feel stupid asking
this question
--
View this message in context:
http://www.nabble.c
Nevermind i got it
dre968 wrote:
>
> I have a loop and an if statement in the loop. once the if statement is
> true for 1 value in the loop i'd like to exit the loop. is there a
> command to do this? i know its going to be something like exit and i feel
> stupid
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
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
&
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
what a gradient is.
any suggestions?
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
> pr
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
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 v
10 matches
Mail list logo