I am trying to follow along in this post here .
I am stuck trying to get the probability that a 1 will follow a 1 or a 2 follow a 1 etc. from the cluster given by kmeans.
model<-kmeans(euFlat[,2:4], centers=8,iter.max=100,nstart=20)
euCluster<-euOrig
euCluster$Cluster<-model$cluster
The chart from the post below is what they used in the post. However, I have no clue on how to generate this easily in R.
My data currently looks like:
Open High Low Close Volume Cluster
2008-06-25 18:00:00 1.5570 1.5587 1.5570 1.5585 191 8
2008-06-25 22:00:00 1.5584 1.5686 1.5539 1.5664 2141 7
2008-06-26 02:00:00 1.5663 1.5677 1.5661 1.5663 321 8
2008-06-26 06:00:00 1.5744 1.5749 1.5741 1.5747 131 8
2008-06-26 10:00:00 1.5748 1.5764 1.5723 1.5758 721 8
2008-06-26 14:00:00 1.5757 1.5767 1.5746 1.5750 351 8
With the cluster on the end.
Is there an easy way to do this in R without having to write a custom function?