Bill Harris wrote:

NB. Calculate the consistency ratio
n =: # cr =: (ev - n) % <: @: n
Your cr is called the absolute consistency index (CI). What Coyle refers to is called relative consistency ratio (CR). From Coyle's paper on page 5:

"...the calculation of a Consistency Ratio (CR) to measure how consistent the judgements have been relative to large samples of purely random judgements. If the CR is much in excess of 0.1 the judgements are untrustworthy because they are too close for comfort to randomness..."

So you need to do
CR = CI % MACI, where MACI is a mean absolute consistency index of random matrices.
Saaty and others have MACI precomputed for matrices up to size 10.
NB. MACI based on 1 000 000 random matrices
3 4 5 6 7 8 9 10
0.524500 0.884133 1.10857 1.24902 1.34039 1.40437 1.45050 1.48607
The 0.5245 for 3x3 matrices is exact.

One can use Roger's code for generating random matrices (I had to put back the dot behind y, since I still use J5.04):
st1=: 3 : 0
i=. 1+(,~y.) [EMAIL PROTECTED] #saaty_scale
b=. >/~i.y.
((b*i) + |:b*i+#saaty_scale) { 1,(,%) saaty_scale
)
Thanks Roger for the speedup!


Then you can use something like
am =: +/ % #      NB. arithmetic mean
maci =: 13 : 'am cr"2 st1"0 (x. # y.)'      NB. cr =: (ev - n) % <: @: n
maci_precomputed =: 1000 maci"0 (3+i.8) NB. larger x. will obviously give a more precise answer (cr exp) % (<:<:#exp) {maci_precomputed NB. relative consistency ratio for exp

NB. Results for all 4 of Coyle's 3x3 matrices
  cr exp
0.014531883  NB. Coyle: 0.072
I think Coyle's CR=0.072 is a typo and it should be 0.0145319 % 0.5425 = 0.027 (actually 0.0277062).

  cr und
0.014531883  NB. Coyle: 0.026
It should also be 0.0277062

  cr rod
_4.4408921e_16 NB. Coyle: 0
0 considering rounding errors.

  cr pod
0.00061677663  NB. Coyle: 0
0.00061677 % 0.5425
0.0011369

Bill Harris wrote:

If I get a moment, would anyone object if I pick some of the best code,
add the eigenvalue calculation, and put it on the Wiki as a Saaty
framework in J?

I don't mind. I might have some ideas to add but it is past midnight already.

Cheers,
Tarmo

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to