Making better use of the cache is important for the modern computer programs and systems. One key step is understanding the data locality. In this article, we investigate one effective and important model of data locality---reference affinity. This model is superior to previous ones because it can express whole-scale locality in a more accurate and flexible way. Traces collected from different applications are a rich source for the analysis of reference affinity. In this article, we extend strict reference affinity to weak reference affinity and prove their properties. We propose a sampling method to find reference affinity groups and present experimental results based on synthetic data showing that the new method is more scalable and accurate than the state-of-art method proposed by Zhong~\etal~\cite{Yutao04:array}.