search for: perm_function

Displaying 1 result from an estimated 1 matches for "perm_function".

Did you mean: aperm_function
2000 May 03
0
Combinatorics for nonparametric tests
...is and Spearman's rank correlation. I have written a function all.perm which delivers all permutations of 1,2,...,n and which works reasonably well. This can be used to generate P(R=r) of Spearman's rank correlation: n_6;plot(table(apply(all.perm(n),1,cor,y=1:n)),type="h") all.perm_function(n){ p_matrix(1,ncol=1) for(i in 2:n){p_pp_cbind(p,i) v_c(1:i,1:(i-1)) for(j in 2:i){v_v[-1] p_rbind(p,pp[,v[1:i]])}} p} Until now I hesitated to dwell on writing functions to generate all n!/(k!(n-k)!) k-combinations of an n-element set or more generally all n!/(k_1!k_2!...n_k!) choices of placi...