Frequency-based similarity for parameterized sequences: Formal framework, algorithms, and applications