我有大约70家公司,我想根据三个时间序列变量使用SAS将它们集群到更小的组中。 数据标准化和堆叠。它看起来像这样: Day Company Var1 Var2 Var3
1 A 0.01 0.015 0.14
2 A ...
3 A ...
...
99 Z ...
100 Z ...
这里是我的想法: 我的三个变量组合成一个变量,通过计算其欧氏距离VAR4 然
我使用修改后的Lloyd算法来获得k = 2的k均值的相同簇大小输出。 以下是伪代码: - Randomly choose 2 points as initialization for the 2 clusters (denoted as c1, c2)
- Repeat below steps until convergence
- Sort all points xi accord