3.29 mmvsim - Sliding Windows Similarity Meausre

Compute the similarity measure (bivariate statistics) using settings of sliding window. This is the sliding windows version of the msim command. The main difference between the two is that msim can only carry out similarity calculation for 1 target object, whereas mmvsim quantifies similarity between two objects.

Format

mmvsim [s=] [k=] f= c= a= [t=] [skip=] [i=] [o=] [-nfn] [-nfno] [-x] [-q] [precision=] [--help] [--version]

Parameters

s=

After the specified field is sorted (multiple fields can be specified), a variety of similarity computation is carried out.

 

s= parameter is required if -q is not specified.

k=

Aggregate records using the specified field name(s) (multiple fields can be specified).

f=

Field name(s) (multiple fields can be specified) for computation .

t=

Integer intervals that is greater than 1.

c=

Define measures of similarity (one from the following).

 

covar|ucovar|pearson|spearman|kendall|euclid|

 

cosine|cityblock|hamming|chi|phi|jaccard|support|lift

 

Refer to msim command for detailed definition.

skip=

Specify the number of rows to hide from the top in the output [default value:skip=(value of t= -1)]

Example

Example 1: Basic Example

Calculate the Pearson product-moment correlation coefficient for 3 window intervals for fields x,y.

$ more dat1.csv
t,x,y
1,14,0.17
2,11,0.2
3,32,0.15
4,13,0.33
5,8,0.1
6,19,0.56
$ mmvsim s=t t=3 c=pearson f=x,y a=sim i=dat1.csv o=rsl1.csv
#END# kgmvsim a=sim c=pearson f=x,y i=dat1.csv o=rsl1.csv s=t t=3
$ more rsl1.csv
t%0,x,y,sim
3,32,0.15,-0.8746392857
4,13,0.33,-0.6515529194
5,8,0.1,-0.1164257338
6,19,0.56,0.9986254289

Related Commands

msim : Find out the degree of similarity without setting sliding window.

mwindow : Create sliding window data for use with mmvstats for the computation of statistics.

mmvavg : This command only computes moving average.