Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Name ______________________ Exercise 13 Joins Count Objective: Get familiar with Joints Count Statistics Task: You will examine how Joints Count Statistics is constructed step by step in Microsoft Excel. Steps: 1. From the instructor’s folder copy, “Ex13.xls” to your own folder. 2. Open “Ex13.xls”. Notice that there are three worksheets. Each worksheet contains the calculation of Joints Count Statistics for a pattern of positive, negative or zero autocorrelation. 3. Click on worksheet “Sheet 1”. You will notice that there are two matrices. What is the size of both matrices? ________ by _________. 4. The values of both matrices are either 1 or -1. You also notice at the right side of the worksheet, there is a chart. Each cell of the chart actually corresponds to the value of a cell in the 1st matrix (above). Black (B) for 1 and grey (W) for -1. This chart basically shows the pattern of a binary value (1 or -1) over the space. What is your best guess of the distribution of the values? Positive, negative or zero autocorrelation? ____________________________ 5. Click on worksheet “Sheet 2”. You will notice that it is very similar to Sheet 1 but with only one matrix. What is your best guess of the distribution of the values? Positive, negative or zero autocorrelation? ____________________________ 6. Click on worksheet “Sheet 3”. You will notice that it is very similar to Sheet 1 and 2. What is your best guess of the distribution of the values? Positive, negative or zero autocorrelation? ____________________________ 7. Switch back to worksheet “Sheet 1”. In Cell M2, type in =IF(AND(B2=-1,C2=-1),"WW",IF(AND(B2=1,C2=1),"BB","BW")). This equation is used to compare the values in Cells B2 and C2 (two neighboring cells in the same row). If both B2 and C2 are -1, fill M2 with “WW”; if both are 1, fill with “BB”; otherwise (B2 = 1 and C2 = -1; or B2 = -1 and C2 = 1), fill with “BW”. Does the order of the combination (1 & -1 or -1 & 1) matter? _____________________ 8. Copy Cell M2. Paste it to Cells M2:U11. This 10 by 9 matrix contains all the cases of two neighboring cells along each row (basically, joins along East-West direction). Why 10 by 9? __________________________________ 9. In Cell M14, type in =IF(AND(B2=-1,B3=1),"WW",IF(AND(B2=1,B3=1),"BB","BW")). This equation is used to compare the values in Cells B2 and B3 (two neighboring cells in the same column). If both B2 and B3 are -1, fill M14 with “WW”; if both are 1, fill with “BB”; otherwise (B2 = 1 and B3 = -1; or B2 = -1 and B3 = 1), fill with “BW”. 10. Copy Cell M14. Paste it to Cells M14:V22. This 9 by 10 matrix contains all the cases of two neighboring cells along each column (basically, joins along North-South direction). Why 9 by 10 this time? __________________________________ 11. So you have just listed all the possible join cases for a 10 by 10 matrix. What neighbor function is used? Queen, Rook, or bishop? ________ How many join cases are there totally? ______________________ 12. Next step is to count the number of cases for BB, WW, and BW respectively. In Cell N25, type =COUNTIF(M2:V22,"BB"). This equation counts the number of “BB” cases. What equation should be used for “WW”? ___________________ What equation should be used for “BW”? ___________________ 13. Apply the above equations to Cell N26 and N27 respectively. JBB? ________________________ JWW? _______________________ JBW? ________________________ 14. In Cell N29, type equation =SUM(N25:N27). This is the total number of join cases (disregard the join type) Result? ___________________ 15. Cell N30 is for calculating m, which is given by: 1 n m ki (ki 1) 2 i 1 Where ki is the number of joins to the ith area. 16. Since we consider only the Rook-case neighbors, k is very easy to calculate. Just break all the cells down into 3 groups: cells at corners, at edges, at centers). How many corner cells? ________ How many neighbors for each corner cell? ______ How many edge cells? ________ How many neighbors for each edge cell? ______ How many center cells? ________ How many neighbors for each center cell? ______ 17. Following the example in your textbook (Equation 7.27), fill N30 with =0.5*(4*2+32*3*2+64*4*3). 18. In order to get the expected values for JBB, JWW, JBW, you also need to know the probability (pB) of a cell being coded B (1) and the probability (pW) of a cell being coded W (-1). What is the probability for a cell being coded B? ________ What is the probability for a cell being coded W? ________ 19. Fill =COUNTIF(B2:K11,"1")/100 in Cell V25. This is the probability for a cell being coded B (1). What should be the equation used for the probability for a cell being coded W (-1)? ________________________ 20. Apply the above equation in V26. This is the probability for a cell being coded W (-1). 21. Next step is to calculate the expected values for JBB, JWW, JBW using the equations given in your textbook (Equation 7.24). 22. Fill =N29*V25^2 in Q25, =N29*V26^2 in Q26; and =2*N29*V25*V26 in Q27. E(JBB)? ________________________ E(JWW)? _______________________ E(JBW)? ________________________ Comparing the expected joins counts with the observed (actual) joins counts, positive, negative or zero autocorrelation? _______________ Why? ______________________________________ 23. Next step is to construct z-scores (through standardization, we can compare cases with different number of cells). 24. We need the expected standard deviation for calculating z-scores. To calculate the expected standard deviation for BB, WW, BW by simply replaces the actual values in the equations given in your textbook (Equation 7.25). 25. Fill =SQRT(N29*V25^2+2*N30*V25^3-(N29+2*N30)*V25^4) in S25; 26. Fill =SQRT(N29*V26^2+2*N30*V26^3-(N29+2*N30)*V26^4) in S26; 27. Fill =SQRT(2*(N29+N30)*V25*V264*(N29+2*N30)*V25^2*V26^2) in S27. E(SBB)? ________________________ E(SWW)? _______________________ E(SBW)? ________________________ 28. Following the equation in your textbook (Equation A.15, p. 389), zscores can be rather easily calculated. 29. Fill =(N25-Q25)/S25 in Cell X3. This is the z-score for BB case. 30. Fill =(N26-Q26)/S26 in Cell X4. This is the z-score for WW case. 31. Fill =(N27-Q27)/S27 in Cell X5. This is the z-score for BW case. z-score for BB? ________________________ z-score for WW? ________________________ z-score for BW? ________________________ Positive, negative or zero autocorrelation? ______________________ Why? ______________________________________ 32. Select cells M1:X30. Copy and paste the entire selection to the same area in “Sheet 2” and “Sheet 3”. 33. For “Sheet 2”. z-score for BB? ________________________ z-score for WW? ________________________ z-score for BW? ________________________ Positive, negative or zero autocorrelation? ______________________ Why? ______________________________________ 34. For “Sheet 3”. z-score for BB? ________________________ z-score for WW? ________________________ z-score for BW? ________________________ Positive, negative or zero autocorrelation? ______________________ Why? ______________________________________ 35. Change the name of each worksheet to reflect your conclusions.