This document presents a combined cosine-linear regression model for calculating similarity between handwritten word images. It first provides an overview of various commonly used similarity and distance measures such as Euclidean, Manhattan, Minkowski, Cosine, Jaccard, and Chebyshev distances. It then compares the performance of these measures on a handwritten Arabic document dataset, finding that cosine distance performs best. However, cosine distance is affected by the size of the visual codebook used. The document proposes a floating threshold based on a linear regression model that considers both the codebook size and number of image features, in order to better measure similarity between word images. Experiments on a historical Arabic document collection demonstrate the effectiveness of this combined cosine-linear regression