I am trying to repost what I have posted as a question
some time ago. I am still trying to find the optimal
grouping for my data using objective function.
Special thanks to Patrick Burns who suggested to use
"genopt" function from S+Poetry.
I am running Splus6.0 Relese 2 on NT4.0
# data frame
#col1 col2 col3
A1 25 12
A2 12 11
A3 10 21
A4 -16 1
A5 -18 3
B1 -21 5
B2 -25 8
B3 -9 8
B4 15 8
B5 22 15
. . .
. . .
. . .
I want to group the data into "optimized groups" using
this objective function.
= (Sum[1 to G] [ Ng*CORg*STDEVg]) / (SUM[1 to G]Ng)
Where
Ng Number of Names in Group g
CORg is the correlation between col2 and col3 in Group
G
STDEVg is the Standard deviation in group G
SUM[1 to G][ Ng*CORg*STDEVg]) means sum the product
Ng*CORg*STDEVg for all the groups - SUMMATION OPERATOR
SUM[1 to G]Ng mean sum the Ng for all the groups -
SUMMATION OPERATOR.
I am starting with assuming all the names are in 1
group and then algorithm examines each names
sequentially and considers moving it into the other
group, which starts out empty. Names are moved only if
the move produces an increase in the objective
function.
It is possible that each names is moved from group A
to group B and then returned to group A on a
subsequent pass through the data. The process is
repeated until no further movement of a single name
improves the objective. Something like CART method.
Anybody know any kind of implementaion in splus that
can be done for this kind of problem.
Any help is highly appreciated.
Thanks
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
|