diff --git a/vignettes/Custom_Wts.txt b/vignettes/Custom_Wts.txt deleted file mode 100644 index 3fd1e0b..0000000 --- a/vignettes/Custom_Wts.txt +++ /dev/null @@ -1,1000 +0,0 @@ -A51 A25 0.8770 -A51 A26 0.0010 -A51 A38 0.2687 -A51 A51 1.0000 -A51 A61 0.4703 -A51 A66 0.0011 -A51 A74 0.0075 -A51 A88 0.0068 -A51 A98 0.1575 -A51 A99 0.0008 -A87 A32 0.1150 -A87 A4 0.0019 -A87 A49 0.6561 -A87 A54 0.0011 -A87 A61 0.0019 -A87 A62 0.0013 -A87 A70 0.0214 -A87 A78 0.4546 -A87 A87 1.0000 -A87 A88 0.1623 -A56 A19 0.0013 -A56 A32 0.1001 -A56 A45 0.0161 -A56 A50 0.0187 -A56 A56 1.0000 -A56 A62 0.4229 -A56 A74 0.0153 -A56 A84 0.0464 -A56 A89 0.1178 -A56 A95 0.2774 -A28 A22 0.0214 -A28 A24 0.0000 -A28 A25 0.2687 -A28 A28 1.0000 -A28 A35 0.0835 -A28 A46 0.2274 -A28 A65 0.0041 -A28 A66 0.0025 -A28 A70 0.1425 -A28 A78 0.0010 -A77 A10 0.0003 -A77 A19 0.0187 -A77 A27 0.0001 -A77 A32 0.0084 -A77 A52 0.0618 -A77 A61 0.5695 -A77 A66 0.0001 -A77 A77 1.0000 -A77 A82 0.0004 -A77 A91 0.4229 -A48 A12 0.0214 -A48 A25 0.0161 -A48 A30 0.0000 -A48 A31 0.0004 -A48 A46 0.0166 -A48 A48 1.0000 -A48 A51 0.4229 -A48 A73 0.4783 -A48 A76 0.1532 -A48 A81 0.2170 -A59 A13 0.1623 -A59 A21 0.0061 -A59 A24 0.0000 -A59 A32 0.4546 -A59 A38 0.0130 -A59 A59 1.0000 -A59 A62 0.1575 -A59 A66 0.0004 -A59 A88 0.0011 -A59 A94 0.3886 -A68 A13 0.7214 -A68 A18 0.0019 -A68 A19 0.3846 -A68 A2 0.0013 -A68 A55 0.1623 -A68 A57 0.0009 -A68 A68 1.0000 -A68 A88 0.0995 -A68 A92 0.0153 -A68 A94 0.0075 -A91 A14 0.2952 -A91 A2 0.0115 -A91 A41 0.1425 -A91 A51 0.0011 -A91 A53 0.0005 -A91 A80 0.0000 -A91 A82 0.0116 -A91 A91 1.0000 -A91 A94 0.1425 -A91 A99 0.9227 -A81 A10 0.0187 -A81 A40 0.0004 -A81 A43 0.0053 -A81 A48 0.4546 -A81 A49 0.0068 -A81 A63 0.1150 -A81 A78 0.0001 -A81 A81 1.0000 -A81 A84 0.0013 -A81 A89 0.8159 -A85 A27 0.1150 -A85 A34 0.0650 -A85 A42 0.0003 -A85 A49 0.1280 -A85 A5 0.1425 -A85 A63 0.0009 -A85 A75 0.0153 -A85 A76 0.3846 -A85 A78 0.0401 -A85 A85 1.0000 -A76 A13 0.9227 -A76 A51 0.0531 -A76 A55 0.8409 -A76 A6 0.0041 -A76 A65 0.0040 -A76 A66 0.0011 -A76 A76 1.0000 -A76 A80 0.0554 -A76 A82 0.0008 -A76 A99 0.0531 -A72 A28 0.0650 -A72 A42 0.0001 -A72 A58 0.0030 -A72 A72 1.0000 -A72 A73 0.0281 -A72 A76 0.0000 -A72 A81 0.1001 -A72 A84 0.8409 -A72 A96 0.0019 -A72 A98 0.3414 -A78 A4 0.1661 -A78 A48 0.0019 -A78 A50 0.2274 -A78 A51 0.0011 -A78 A56 0.0084 -A78 A58 0.0337 -A78 A75 0.7754 -A78 A78 1.0000 -A78 A82 0.0115 -A78 A96 0.0000 -A47 A25 0.0835 -A47 A31 0.0046 -A47 A42 0.0001 -A47 A47 1.0000 -A47 A48 0.2889 -A47 A58 0.0115 -A47 A66 0.0010 -A47 A68 0.0311 -A47 A91 0.4229 -A47 A94 0.0053 -A36 A17 0.0001 -A36 A26 0.7754 -A36 A34 0.0114 -A36 A36 1.0000 -A36 A51 0.4229 -A36 A57 0.0749 -A36 A74 0.0464 -A36 A76 0.7420 -A36 A88 0.0009 -A36 A9 0.0006 -A82 A2 0.0012 -A82 A27 0.9227 -A82 A53 0.5297 -A82 A57 0.0274 -A82 A59 0.0114 -A82 A76 0.0019 -A82 A80 0.0084 -A82 A82 1.0000 -A82 A86 0.7214 -A82 A89 0.3414 -A63 A10 0.0061 -A63 A12 0.8159 -A63 A18 0.0011 -A63 A2 0.0337 -A63 A52 0.0003 -A63 A63 1.0000 -A63 A64 0.0115 -A63 A65 0.4929 -A63 A68 0.0531 -A63 A81 0.0011 -A79 A28 0.0749 -A79 A33 0.2952 -A79 A36 0.0130 -A79 A51 0.0009 -A79 A56 0.0187 -A79 A61 0.5824 -A79 A79 1.0000 -A79 A83 0.0002 -A79 A89 0.0274 -A79 A9 0.3039 -A84 A1 0.5824 -A84 A11 0.0650 -A84 A37 0.0006 -A84 A48 0.0000 -A84 A51 0.4066 -A84 A66 0.0025 -A84 A70 0.4929 -A84 A74 0.0019 -A84 A83 0.0531 -A84 A84 1.0000 -A38 A2 0.0575 -A38 A22 0.0143 -A38 A29 0.0352 -A38 A33 0.0835 -A38 A38 1.0000 -A38 A5 0.3846 -A38 A53 0.0000 -A38 A77 0.2274 -A38 A79 0.0650 -A38 A91 0.2170 -A73 A26 0.0114 -A73 A3 0.9227 -A73 A41 0.5036 -A73 A43 0.0000 -A73 A50 0.0019 -A73 A6 0.0166 -A73 A63 0.0531 -A73 A7 0.4546 -A73 A73 1.0000 -A73 A81 0.5297 -A96 A27 0.0010 -A96 A34 0.0160 -A96 A43 0.4783 -A96 A55 0.0182 -A96 A60 0.0028 -A96 A64 0.6587 -A96 A78 0.2170 -A96 A81 0.0000 -A96 A9 0.0575 -A96 A96 1.0000 -A5 A13 0.0000 -A5 A48 0.0008 -A5 A49 0.7420 -A5 A5 1.0000 -A5 A74 0.0114 -A5 A75 0.0161 -A5 A86 0.0575 -A5 A88 0.0010 -A5 A9 0.1623 -A5 A93 0.0084 -A74 A18 0.0084 -A74 A25 0.0575 -A74 A34 0.2952 -A74 A4 0.0000 -A74 A41 0.0002 -A74 A51 0.0763 -A74 A52 0.0114 -A74 A53 0.2170 -A74 A74 1.0000 -A74 A81 0.0352 -A10 A10 1.0000 -A10 A14 0.0143 -A10 A43 0.5695 -A10 A51 0.0281 -A10 A59 0.0130 -A10 A6 0.2014 -A10 A76 0.2170 -A10 A82 0.0464 -A10 A87 0.0025 -A10 A94 0.0003 -A15 A14 0.0002 -A15 A15 1.0000 -A15 A16 0.0000 -A15 A20 0.0650 -A15 A25 0.3414 -A15 A28 0.2889 -A15 A52 0.1425 -A15 A68 0.0763 -A15 A84 0.0011 -A15 A92 0.0130 -A34 A12 0.0281 -A34 A26 0.0001 -A34 A34 1.0000 -A34 A43 0.3133 -A34 A55 0.3886 -A34 A63 0.0041 -A34 A7 0.4783 -A34 A70 0.0575 -A34 A85 0.6561 -A34 A86 0.0000 -A53 A32 0.0001 -A53 A47 0.0084 -A53 A51 0.9510 -A53 A52 0.0182 -A53 A53 1.0000 -A53 A58 0.0679 -A53 A65 0.4703 -A53 A66 0.2444 -A53 A69 0.0001 -A53 A93 0.0004 -A19 A14 0.0025 -A19 A16 0.0000 -A19 A19 1.0000 -A19 A26 0.0000 -A19 A48 0.3886 -A19 A68 0.0337 -A19 A74 0.4066 -A19 A76 0.2444 -A19 A77 0.0153 -A19 A82 0.0945 -A22 A100 0.1068 -A22 A13 0.0000 -A22 A2 0.0531 -A22 A22 1.0000 -A22 A30 0.0001 -A22 A48 0.1532 -A22 A61 0.0182 -A22 A72 0.0001 -A22 A84 0.0650 -A22 A99 0.0143 -A42 A12 0.1876 -A42 A2 0.5824 -A42 A34 0.0010 -A42 A4 0.0004 -A42 A42 1.0000 -A42 A53 0.1612 -A42 A57 0.4929 -A42 A69 0.0115 -A42 A74 0.0001 -A42 A86 0.0075 -A83 A27 0.0670 -A83 A32 0.1575 -A83 A40 0.0013 -A83 A44 0.6261 -A83 A60 0.0028 -A83 A65 0.0030 -A83 A78 0.7214 -A83 A8 0.3886 -A83 A83 1.0000 -A83 A95 0.0028 -A35 A27 0.0019 -A35 A28 0.0650 -A35 A3 0.0187 -A35 A31 0.0028 -A35 A35 1.0000 -A35 A47 0.0274 -A35 A51 0.0251 -A35 A52 0.0011 -A35 A84 0.3414 -A35 A92 0.0011 -A43 A26 0.0010 -A43 A43 1.0000 -A43 A60 0.0012 -A43 A63 0.3436 -A43 A64 0.6587 -A43 A70 0.0166 -A43 A78 0.0337 -A43 A83 0.2444 -A43 A85 0.0011 -A43 A86 0.3414 -A98 A1 0.0835 -A98 A19 0.0010 -A98 A2 0.0337 -A98 A22 0.0010 -A98 A23 0.0650 -A98 A33 0.0001 -A98 A41 0.2687 -A98 A70 0.0311 -A98 A76 0.0053 -A98 A98 1.0000 -A45 A27 0.0010 -A45 A39 0.0575 -A45 A4 0.9510 -A45 A45 1.0000 -A45 A59 0.0115 -A45 A61 0.3039 -A45 A62 0.2952 -A45 A65 0.0464 -A45 A89 0.3436 -A45 A90 0.0028 -A60 A29 0.0130 -A60 A40 0.0050 -A60 A48 0.6587 -A60 A53 0.0160 -A60 A60 1.0000 -A60 A7 0.0835 -A60 A82 0.4066 -A60 A86 0.0000 -A60 A92 0.1001 -A60 A96 0.0000 -A93 A12 0.5824 -A93 A19 0.2687 -A93 A29 0.0000 -A93 A3 0.0013 -A93 A32 0.0000 -A93 A47 0.0679 -A93 A53 0.0003 -A93 A64 0.0554 -A93 A92 0.2170 -A93 A93 1.0000 -A66 A22 0.0050 -A66 A23 0.0464 -A66 A26 0.1612 -A66 A28 0.0161 -A66 A6 0.0182 -A66 A64 0.1532 -A66 A66 1.0000 -A66 A68 0.0352 -A66 A84 0.0160 -A66 A96 0.0006 -A62 A21 0.0160 -A62 A39 0.0006 -A62 A45 0.7214 -A62 A51 0.1150 -A62 A62 1.0000 -A62 A69 0.0650 -A62 A80 0.0053 -A62 A84 0.0002 -A62 A88 0.0116 -A62 A95 0.6261 -A100 A100 1.0000 -A100 A24 0.7420 -A100 A31 0.0214 -A100 A39 0.0995 -A100 A53 0.1150 -A100 A62 0.1178 -A100 A74 0.0006 -A100 A76 0.0011 -A100 A95 0.0019 -A100 A98 0.0311 -A12 A12 1.0000 -A12 A34 0.2444 -A12 A48 0.0311 -A12 A55 0.0161 -A12 A63 0.0001 -A12 A73 0.0337 -A12 A75 0.1425 -A12 A8 0.2170 -A12 A82 0.2952 -A12 A83 0.0001 -A90 A17 0.1068 -A90 A24 0.5297 -A90 A46 0.0531 -A90 A52 0.0464 -A90 A53 0.0001 -A90 A72 0.1612 -A90 A77 0.0013 -A90 A82 0.2014 -A90 A84 0.0053 -A90 A90 1.0000 -A99 A22 0.0100 -A99 A32 0.1150 -A99 A48 0.0003 -A99 A51 0.0006 -A99 A6 0.5297 -A99 A66 0.0050 -A99 A77 0.9510 -A99 A80 0.1001 -A99 A86 0.0025 -A99 A99 1.0000 -A64 A14 0.0650 -A64 A26 0.4929 -A64 A27 0.6587 -A64 A38 0.0001 -A64 A43 0.5824 -A64 A58 0.0000 -A64 A6 0.0143 -A64 A64 1.0000 -A64 A80 0.0531 -A64 A81 0.0010 -A25 A13 0.0028 -A25 A19 0.8159 -A25 A24 0.0004 -A25 A25 1.0000 -A25 A27 0.2010 -A25 A28 0.0274 -A25 A61 0.0041 -A25 A64 0.0028 -A25 A77 0.0001 -A25 A8 0.1575 -A17 A17 1.0000 -A17 A20 0.0000 -A17 A24 0.1612 -A17 A37 0.6561 -A17 A42 0.0068 -A17 A45 0.4703 -A17 A60 0.0004 -A17 A65 0.0337 -A17 A78 0.0013 -A17 A92 0.0749 -A92 A18 0.0011 -A92 A19 0.5297 -A92 A25 0.3436 -A92 A44 0.0013 -A92 A51 0.0000 -A92 A72 0.0650 -A92 A74 0.5695 -A92 A78 0.4546 -A92 A89 0.0187 -A92 A92 1.0000 -A49 A14 0.0013 -A49 A49 1.0000 -A49 A51 0.0046 -A49 A65 0.1575 -A49 A70 0.2952 -A49 A78 0.0130 -A49 A81 0.0004 -A49 A83 0.1532 -A49 A86 0.0001 -A49 A88 0.0763 -A50 A25 0.0116 -A50 A27 0.0000 -A50 A40 0.0835 -A50 A45 0.4783 -A50 A50 1.0000 -A50 A56 0.6261 -A50 A63 0.0187 -A50 A69 0.0401 -A50 A84 0.7214 -A50 A96 0.0004 -A70 A10 0.0337 -A70 A13 0.8409 -A70 A21 0.0000 -A70 A25 0.0187 -A70 A28 0.0618 -A70 A43 0.1575 -A70 A51 0.2274 -A70 A6 0.0000 -A70 A70 1.0000 -A70 A86 0.2774 -A26 A16 0.0068 -A26 A26 1.0000 -A26 A27 0.4546 -A26 A46 0.0000 -A26 A48 0.0114 -A26 A51 0.3414 -A26 A76 0.0013 -A26 A8 0.0053 -A26 A81 0.0214 -A26 A91 0.2010 -A69 A13 0.0114 -A69 A46 0.1661 -A69 A58 0.2774 -A69 A6 0.0001 -A69 A61 0.8159 -A69 A69 1.0000 -A69 A72 0.0011 -A69 A73 0.1876 -A69 A84 0.0337 -A69 A90 0.4783 -A94 A25 0.0008 -A94 A27 0.1150 -A94 A32 0.2889 -A94 A38 0.2274 -A94 A43 0.0046 -A94 A5 0.0006 -A94 A51 0.1296 -A94 A64 0.2014 -A94 A82 0.4229 -A94 A94 1.0000 -A80 A26 0.0650 -A80 A32 0.0337 -A80 A39 0.0053 -A80 A57 0.0013 -A80 A59 0.0084 -A80 A64 0.5824 -A80 A80 1.0000 -A80 A86 0.0011 -A80 A91 0.0749 -A80 A99 0.0010 -A97 A16 0.0130 -A97 A43 0.0187 -A97 A47 0.0116 -A97 A5 0.0575 -A97 A58 0.2170 -A97 A72 0.0006 -A97 A74 0.5036 -A97 A84 0.0001 -A97 A93 0.8770 -A97 A97 1.0000 -A89 A11 0.0001 -A89 A19 0.0009 -A89 A48 0.3039 -A89 A58 0.0274 -A89 A61 0.0100 -A89 A69 0.0114 -A89 A81 0.7754 -A89 A83 0.1623 -A89 A89 1.0000 -A89 A95 0.0182 -A52 A14 0.0945 -A52 A2 0.3886 -A52 A3 0.1296 -A52 A32 0.1575 -A52 A38 0.0160 -A52 A52 1.0000 -A52 A59 0.0053 -A52 A64 0.0041 -A52 A7 0.0008 -A52 A86 0.4783 -A44 A24 0.0116 -A44 A32 0.4229 -A44 A4 0.0013 -A44 A41 0.0053 -A44 A44 1.0000 -A44 A60 0.0281 -A44 A73 0.0013 -A44 A8 0.0001 -A44 A82 0.4546 -A44 A86 0.0575 -A67 A16 0.5695 -A67 A3 0.0835 -A67 A30 0.2774 -A67 A43 0.0001 -A67 A58 0.7754 -A67 A64 0.0003 -A67 A67 1.0000 -A67 A68 0.0337 -A67 A82 0.2170 -A67 A86 0.0214 -A54 A100 0.0311 -A54 A28 0.0650 -A54 A41 0.0835 -A54 A44 0.0531 -A54 A45 0.0749 -A54 A54 1.0000 -A54 A56 0.0130 -A54 A73 0.0005 -A54 A82 0.0337 -A54 A95 0.0115 -A75 A14 0.0000 -A75 A27 0.1661 -A75 A40 0.0010 -A75 A5 0.0337 -A75 A64 0.5824 -A75 A75 1.0000 -A75 A81 0.8770 -A75 A82 0.0749 -A75 A93 0.4783 -A75 A96 0.5036 -A41 A14 0.1280 -A41 A38 0.5297 -A41 A41 1.0000 -A41 A60 0.0002 -A41 A65 0.0650 -A41 A68 0.1425 -A41 A73 0.0053 -A41 A78 0.0000 -A41 A80 0.0464 -A41 A93 0.4929 -A23 A100 0.4546 -A23 A23 1.0000 -A23 A25 0.0002 -A23 A29 0.0003 -A23 A33 0.0945 -A23 A34 0.0401 -A23 A66 0.5297 -A23 A72 0.0000 -A23 A80 0.0011 -A23 A98 0.6587 -A18 A13 0.0004 -A18 A18 1.0000 -A18 A27 0.3436 -A18 A40 0.0337 -A18 A65 0.0003 -A18 A67 0.0001 -A18 A73 0.6261 -A18 A78 0.0053 -A18 A8 0.0114 -A18 A94 0.0835 -A40 A30 0.1612 -A40 A32 0.0075 -A40 A4 0.0001 -A40 A40 1.0000 -A40 A42 0.3846 -A40 A48 0.1612 -A40 A50 0.0116 -A40 A54 0.0115 -A40 A58 0.0050 -A40 A75 0.0006 -A57 A16 0.0161 -A57 A25 0.1150 -A57 A47 0.0464 -A57 A52 0.0001 -A57 A57 1.0000 -A57 A64 0.0618 -A57 A65 0.0040 -A57 A76 0.0182 -A57 A83 0.0004 -A57 A90 0.0008 -A24 A100 0.0013 -A24 A17 0.0143 -A24 A24 1.0000 -A24 A25 0.0670 -A24 A31 0.0000 -A24 A4 0.6261 -A24 A45 0.0995 -A24 A51 0.0006 -A24 A56 0.0749 -A24 A90 0.3846 -A58 A13 0.0006 -A58 A18 0.0352 -A58 A3 0.1178 -A58 A58 1.0000 -A58 A69 0.0004 -A58 A74 0.0013 -A58 A76 0.0068 -A58 A8 0.1150 -A58 A82 0.7754 -A58 A91 0.0061 -A65 A12 0.0010 -A65 A25 0.0057 -A65 A43 0.0000 -A65 A48 0.0945 -A65 A65 1.0000 -A65 A66 0.0053 -A65 A7 0.1661 -A65 A74 0.6261 -A65 A8 0.0116 -A65 A89 0.1178 -A32 A32 1.0000 -A32 A38 0.0046 -A32 A41 0.8409 -A32 A46 0.0763 -A32 A50 0.0397 -A32 A52 0.0006 -A32 A59 0.2952 -A32 A82 0.7420 -A32 A91 0.0000 -A32 A93 0.0000 -A39 A14 0.0115 -A39 A26 0.3414 -A39 A31 0.1425 -A39 A32 0.8409 -A39 A38 0.0749 -A39 A39 1.0000 -A39 A4 0.0000 -A39 A59 0.0000 -A39 A60 0.0274 -A39 A79 0.0352 -A88 A13 0.8770 -A88 A32 0.2170 -A88 A44 0.0130 -A88 A46 0.0006 -A88 A49 0.2010 -A88 A76 0.2774 -A88 A82 0.0002 -A88 A88 1.0000 -A88 A9 0.0401 -A88 A94 0.4783 -A61 A13 0.2170 -A61 A39 0.0531 -A61 A48 0.0161 -A61 A52 0.0000 -A61 A61 1.0000 -A61 A66 0.3436 -A61 A70 0.0618 -A61 A77 0.0352 -A61 A88 0.0001 -A61 A99 0.0835 -A33 A1 0.6561 -A33 A15 0.6261 -A33 A2 0.0084 -A33 A25 0.1575 -A33 A3 0.0464 -A33 A33 1.0000 -A33 A53 0.0531 -A33 A6 0.0028 -A33 A70 0.1068 -A33 A74 0.0000 -A8 A10 0.0002 -A8 A4 0.1280 -A8 A48 0.0835 -A8 A50 0.5824 -A8 A58 0.1623 -A8 A69 0.0670 -A8 A78 0.4783 -A8 A8 1.0000 -A8 A86 0.0006 -A8 A93 0.0000 -A13 A13 1.0000 -A13 A29 0.0337 -A13 A3 0.0011 -A13 A30 0.0006 -A13 A42 0.1661 -A13 A51 0.0749 -A13 A57 0.6587 -A13 A6 0.3886 -A13 A64 0.0011 -A13 A82 0.1575 -A95 A19 0.0650 -A95 A25 0.0143 -A95 A35 0.0000 -A95 A37 0.3886 -A95 A59 0.0000 -A95 A72 0.1575 -A95 A74 0.0114 -A95 A90 0.4703 -A95 A92 0.0352 -A95 A95 1.0000 -A1 A1 1.0000 -A1 A32 0.1150 -A1 A50 0.0011 -A1 A61 0.4783 -A1 A74 0.0084 -A1 A77 0.0001 -A1 A80 0.0214 -A1 A87 0.0000 -A1 A89 0.8409 -A1 A9 0.3886 -A86 A10 0.7420 -A86 A29 0.1575 -A86 A43 0.0050 -A86 A5 0.1612 -A86 A59 0.0100 -A86 A77 0.0214 -A86 A8 0.0575 -A86 A81 0.0013 -A86 A86 1.0000 -A86 A94 0.2774 -A16 A13 0.2014 -A16 A16 1.0000 -A16 A34 0.0004 -A16 A40 0.0000 -A16 A42 0.0352 -A16 A57 0.4703 -A16 A58 0.8409 -A16 A6 0.0281 -A16 A81 0.0003 -A16 A93 0.0618 -A46 A19 0.0337 -A46 A23 0.0041 -A46 A24 0.0061 -A46 A32 0.0011 -A46 A38 0.0401 -A46 A46 1.0000 -A46 A53 0.0053 -A46 A64 0.0003 -A46 A88 0.0000 -A46 A98 0.3039 -A37 A18 0.0670 -A37 A37 1.0000 -A37 A42 0.0214 -A37 A57 0.0000 -A37 A64 0.0040 -A37 A74 0.1150 -A37 A75 0.1575 -A37 A78 0.1068 -A37 A81 0.3436 -A37 A91 0.1150 -A11 A11 1.0000 -A11 A28 0.4229 -A11 A4 0.0995 -A11 A48 0.0002 -A11 A50 0.0000 -A11 A60 0.0013 -A11 A70 0.0006 -A11 A71 0.3436 -A11 A75 0.0115 -A11 A83 0.0650 -A31 A17 0.0010 -A31 A31 1.0000 -A31 A4 0.3886 -A31 A48 0.2952 -A31 A58 0.0011 -A31 A60 0.0749 -A31 A75 0.0002 -A31 A77 0.0161 -A31 A78 0.4703 -A31 A86 0.0046 -A6 A21 0.2687 -A6 A25 0.0575 -A6 A29 0.0000 -A6 A31 0.0005 -A6 A42 0.0000 -A6 A43 0.1296 -A6 A52 0.4703 -A6 A6 1.0000 -A6 A76 0.1612 -A6 A82 0.0030 -A27 A19 0.9227 -A27 A27 1.0000 -A27 A30 0.0575 -A27 A32 0.1575 -A27 A40 0.1296 -A27 A51 0.0182 -A27 A60 0.0001 -A27 A63 0.0040 -A27 A64 0.0143 -A27 A93 0.2170 -A29 A13 0.0084 -A29 A29 1.0000 -A29 A3 0.0251 -A29 A34 0.0575 -A29 A48 0.0010 -A29 A49 0.0161 -A29 A68 0.0004 -A29 A78 0.1425 -A29 A85 0.0030 -A29 A93 0.0160 -A20 A20 1.0000 -A20 A21 0.2014 -A20 A23 0.0001 -A20 A36 0.2010 -A20 A41 0.0251 -A20 A42 0.1001 -A20 A46 0.0187 -A20 A80 0.0010 -A20 A82 0.0003 -A20 A99 0.6587 -A55 A12 0.0100 -A55 A13 0.0670 -A55 A3 0.0030 -A55 A34 0.7754 -A55 A49 0.2687 -A55 A5 0.0013 -A55 A55 1.0000 -A55 A64 0.6587 -A55 A70 0.0835 -A55 A81 0.0001 -A2 A19 0.0835 -A2 A2 1.0000 -A2 A29 0.0575 -A2 A49 0.0000 -A2 A53 0.0004 -A2 A68 0.2010 -A2 A76 0.5695 -A2 A80 0.0003 -A2 A91 0.0009 -A2 A99 0.1661 -A9 A21 0.0000 -A9 A28 0.0075 -A9 A33 0.0004 -A9 A39 0.2687 -A9 A61 0.0397 -A9 A63 0.4929 -A9 A77 0.0001 -A9 A81 0.2774 -A9 A84 0.8159 -A9 A9 1.0000 -A71 A29 0.0116 -A71 A32 0.0160 -A71 A45 0.0995 -A71 A50 0.0030 -A71 A61 0.0009 -A71 A71 1.0000 -A71 A79 0.4783 -A71 A89 0.2170 -A71 A96 0.8409 -A71 A98 0.0011 -A30 A13 0.0401 -A30 A16 0.7754 -A30 A30 1.0000 -A30 A31 0.1001 -A30 A48 0.0835 -A30 A51 0.0013 -A30 A59 0.0019 -A30 A68 0.0028 -A30 A73 0.3886 -A30 A82 0.5824 -A14 A10 0.6789 -A14 A14 1.0000 -A14 A6 0.8159 -A14 A66 0.3039 -A14 A75 0.0004 -A14 A8 0.0046 -A14 A81 0.0995 -A14 A85 0.0040 -A14 A91 0.1425 -A14 A96 0.3414 -A3 A25 0.0679 -A3 A3 1.0000 -A3 A40 0.1876 -A3 A42 0.0000 -A3 A5 0.1150 -A3 A55 0.2687 -A3 A58 0.0650 -A3 A73 0.0130 -A3 A85 0.0006 -A3 A86 0.0000 -A4 A24 0.2010 -A4 A4 1.0000 -A4 A41 0.0003 -A4 A48 0.0009 -A4 A50 0.8770 -A4 A62 0.1575 -A4 A73 0.0401 -A4 A74 0.1296 -A4 A81 0.2170 -A4 A93 0.0013 -A7 A40 0.0084 -A7 A48 0.2010 -A7 A53 0.5824 -A7 A54 0.3039 -A7 A7 1.0000 -A7 A70 0.0084 -A7 A72 0.9510 -A7 A73 0.0002 -A7 A76 0.0995 -A7 A89 0.0046 -A21 A10 0.3039 -A21 A2 0.0061 -A21 A21 1.0000 -A21 A22 0.0000 -A21 A38 0.0013 -A21 A52 0.0075 -A21 A6 0.4229 -A21 A62 0.0030 -A21 A79 0.0115 -A21 A8 0.0012 diff --git a/vignettes/vignette.R b/vignettes/vignette.R new file mode 100644 index 0000000..1b6a3a5 --- /dev/null +++ b/vignettes/vignette.R @@ -0,0 +1,444 @@ +## ----eval=FALSE--------------------------------------------------------------- +# # Install the package from CRAN +# # THIS WILL WORK ONLY AFTER THE PACKAGE IS PUBLISHED +# # install.packages('sparta') +# +# # Or install the development version from GitHub +# library(devtools) +# # install_github('biologicalrecordscentre/sparta') + +## ----------------------------------------------------------------------------- +# Once installed, load the package +library(sparta) + +## ----------------------------------------------------------------------------- +# Create data +n <- 8000 # size of dataset +nyr <- 50 # number of years in data +nSamples <- 200 # set number of dates +nSites <- 100 # set number of sites +set.seed(125) # set a random seed + +# Create somes dates +first <- as.Date(strptime("1950/01/01", "%Y/%m/%d")) +last <- as.Date(strptime(paste(1950+(nyr-1),"/12/31", sep=''), "%Y/%m/%d")) +dt <- last-first +rDates <- first + (runif(nSamples)*dt) + +# taxa are set semi-randomly +taxa_probabilities <- seq(from = 0.1, to = 0.7, length.out = 26) +taxa <- sample(letters, size = n, TRUE, prob = taxa_probabilities) + +# sites are visited semi-randomly +site_probabilities <- seq(from = 0.1, to = 0.7, length.out = nSites) +site <- sample(paste('A', 1:nSites, sep=''), size = n, TRUE, prob = site_probabilities) + +# the date of visit is selected semi-randomly from those created earlier +time_probabilities <- seq(from = 0.1, to = 0.7, length.out = nSamples) +time_period <- sample(rDates, size = n, TRUE, prob = time_probabilities) + +myData <- data.frame(taxa, site, time_period) + +# Let's have a look at the my example data +head(myData) + +## ----cache = TRUE------------------------------------------------------------- +# Run some data diagnostics on our data +results <- dataDiagnostics(taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + progress_bar = FALSE) + +## ----cache = TRUE------------------------------------------------------------- +# Run some data diagnostics on our data, now time_period +# is set to be a year +results <- dataDiagnostics(taxa = myData$taxa, + site = myData$site, + time_period = as.numeric(format(myData$time_period, '%Y')), + progress_bar = FALSE) + +## ----------------------------------------------------------------------------- +# See what is in results.. +names(results) + +# Let's have a look at the details +head(results$RecordsPerYear) +head(results$VisitListLength) +summary(results$modelRecs) +summary(results$modelList) + +## ----cache = TRUE------------------------------------------------------------- +## Create a new column for the time period +# First define my time periods +time_periods <- data.frame(start = c(1950, 1960, 1970, 1980, 1990), + end = c(1959, 1969, 1979, 1989, 1999)) + +time_periods + +# Now use these to assign my dates to time periods +myData$tp <- date2timeperiod(myData$time_period, time_periods) + +head(myData) + +## ----cache = TRUE------------------------------------------------------------- +## Create a dataset where we have date ranges +Date_range <- data.frame(startdate = myData$time_period, + enddate = (myData$time_period + 600)) + +head(Date_range) + +# Now assign my date ranges to time periods +Date_range$time_period <- date2timeperiod(Date_range, time_periods) + +head(Date_range) + +## ----cache = TRUE------------------------------------------------------------- +# Here is our data +head(myData) + +telfer_results <- telfer(taxa = myData$taxa, + site = myData$site, + time_period = myData$tp, + minSite = 2) + +## ----------------------------------------------------------------------------- +head(telfer_results) + +## ----cache = TRUE------------------------------------------------------------- +# Select only records which occur on lists of length 2 or more +myDataL <- siteSelectionMinL(taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + minL = 2) + +head(myDataL) + +# We now have a much smaller dataset after subsetting +nrow(myData) +nrow(myDataL) + +## ----cache = TRUE------------------------------------------------------------- +# Select only data from sites sampled in at least 10 years +myDataTP <- siteSelectionMinTP(taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + minTP = 10) + +head(myDataTP) + +# Here we have only lost a small number rows, this is because +# many sites in our data are visited in a lot of years. Those +# rows that have been removed are duplicates +nrow(myData) +nrow(myDataTP) + +## ----cache = TRUE------------------------------------------------------------- +# We need to create a new column to represent unique months +# this could also be any unit of time you wanted (week, decade, etc.) + +# This line returns a unique character for each month +unique_Months <- format(myData$time_period, "%B_%Y") +head(unique_Months) + +# Week could be done like this, see ?strptime for more details +unique_Weeks <- format(myData$time_period, "%U_%Y") +head(unique_Weeks) + +# Now lets subset to records found on 60 months or more +myData60Months <- siteSelectionMinTP(taxa = myData$taxa, + site = myData$site, + time_period = unique_Months, + minTP = 60) + +head(myData60Months) + +# We could merge this back with our original data if +# we need to retain the full dates +myData60Months <- merge(myData60Months, myData$time_period, + all.x = TRUE, all.y = FALSE, + by = "row.names") +head(myData60Months) + +nrow(myData) +nrow(myData60Months) + +## ----cache = TRUE------------------------------------------------------------- +# Subset our data as above but in one go +myDataSubset <- siteSelection(taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + minL = 2, + minTP = 10, + LFirst = TRUE) + +head(myDataSubset) +nrow(myDataSubset) + +## ----cache = TRUE------------------------------------------------------------- +# Run the reporting rate model using list length as a fixed effect and +# site as a random effect. Here we only model a few species. +system.time({ +RR_out <- reportingRateModel(taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + list_length = TRUE, + site_effect = TRUE, + species_to_include = c('e','u','r','o','t','a','s'), + overdispersion = FALSE, + family = 'Bernoulli', + print_progress = TRUE) +}) + +# Let's have a look at the data that is returned +str(RR_out) + +# We could plot these to see the species trends +with(RR_out, + # Plot graph + {plot(x = 1:7, y = year.estimate, + ylim = range(c(year.estimate - year.stderror, + year.estimate + year.stderror)), + ylab = 'Year effect (+/- Std Dev)', + xlab = 'Species', + xaxt = "n") + # Add x-axis with species names + axis(1, at = 1:7, labels = species_name) + # Add the error bars + arrows(1:7, year.estimate - year.stderror, + 1:7, year.estimate + year.stderror, + length = 0.05, angle = 90, code = 3)} + ) + +## ----cache = TRUE------------------------------------------------------------- +# Load in snowfall +library(snowfall) + +# I have 4 cpus on my PC so I set cpus to 4 +# when I initialise the cluster +sfInit(parallel = TRUE, cpus = 4) + +# Export my data to the cluster +sfExport('myData') + +# I create a function that takes a species name and runs my models +RR_mod_function <- function(taxa_name){ + + library(sparta) + + RR_out <- reportingRateModel(species_to_include = taxa_name, + taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + list_length = TRUE, + site_effect = TRUE, + overdispersion = FALSE, + family = 'Bernoulli', + print_progress = FALSE) +} + +# I then run this in parallel +system.time({ +para_out <- sfClusterApplyLB(c('e','u','r','o','t','a','s'), RR_mod_function) +}) + +# Name each element of this output by the species +RR_out_combined <- do.call(rbind, para_out) + +# Stop the cluster +sfStop() + +# You'll see the output is the same as when we did it serially but the +# time taken is shorter. Using a cluster computer with many more than +# 4 cores can greatly reduce run time. +str(RR_out_combined) + +## ----cache = TRUE------------------------------------------------------------- +# Run our data through the well-sampled sites function +# This time we run all species +WSS_out <- WSS(taxa = myData$taxa, + site = myData$site, + time_period = myData$time_period, + minL = 2, + minTP = 10, + print_progress = FALSE) + +# The data is returned in the same format as from reportingRateModel +str(WSS_out) + +# We can plot these and see that we get different results to our +# previous analysis since this time the method includes subsetting +with(WSS_out[1:10,], + # Plot graph + {plot(x = 1:10, y = year.estimate, + ylim = range(c(year.estimate - year.stderror, + year.estimate + year.stderror)), + ylab = 'Year effect (+/- Std Dev)', + xlab = 'Species', + xaxt="n") + # Add x-axis with species names + axis(1, at=1:10, labels = species_name[1:10]) + # Add the error bars + arrows(1:10, year.estimate - year.stderror, + 1:10, year.estimate + year.stderror, + length=0.05, angle=90, code=3)} + ) + +## ----cache = TRUE------------------------------------------------------------- +# Here is our data +str(myData) + +# Run an occupancy model for three species +# Here we use very small number of iterations +# to avoid a long run time +system.time({ +occ_out <- occDetModel(taxa = myData$taxa, + site = myData$site, + survey = myData$time_period, + species_list = c('a','b','c','d'), + write_results = FALSE, + n_iterations = 200, + burnin = 15, + n_chains = 3, + thinning = 3, + seed = 123) +}) + +# Lets look at the results +## The object returned is a list with one element for each species +names(occ_out) + +# Each of these is an object of class 'occDet' +class(occ_out$a) + +# Inside these elements is the information of interest +names(occ_out$a) + +# Of particular interest to many users will be the summary +# data in the BUGSoutput +head(occ_out$a$BUGSoutput$summary) + +# We have included a plotting feature for objects of class +# occDet which provides a useful visualisation of the trend +# in occupancy over time +plot(occ_out$a) + +## ----cache = TRUE------------------------------------------------------------- +# First format our data +formattedOccData <- formatOccData(taxa = myData$taxa, + site = myData$site, + survey = myData$time_period) +# This is a list of two elements +names(formattedOccData) + +## ----------------------------------------------------------------------------- +# Lets have a look at spp_vis +head(formattedOccData$spp_vis[,1:5]) + +## ----------------------------------------------------------------------------- +# Lets have a look at occDetData +head(formattedOccData$occDetdata) + +## ----cache = TRUE------------------------------------------------------------- +# Use the occupancy modelling function to parrellise the process +# Here we are going to use the package snowfall +library(snowfall) + +# I have 4 cpus on my PC so I set cpus to 4 +# when I initialise the cluster +sfInit(parallel = TRUE, cpus = 4) + +# Export my data to the cluster +sfExport('formattedOccData') + +# I create a function that takes a species name and runs my model +occ_mod_function <- function(taxa_name){ + + library(sparta) + + occ_out <- occDetFunc(taxa_name = taxa_name, + n_iterations = 200, + burnin = 15, + occDetdata = formattedOccData$occDetdata, + spp_vis = formattedOccData$spp_vis, + write_results = FALSE, + seed = 123) +} + +# I then run this in parallel +system.time({ +para_out <- sfClusterApplyLB(c('a','b','c','d'), occ_mod_function) +}) + +# Name each element of this output by the species +for(i in 1:length(para_out)) names(para_out)[i] <- para_out[[i]]$SPP_NAM + +# Stop the cluster +sfStop() + +# This takes about half the time of the +# serial version we ran earlier, and the resulting object +# is the same (since we set the random seed to be the same +# in each) +head(para_out$a$BUGSoutput$summary) +plot(para_out$a) + +## ----------------------------------------------------------------------------- +head(myData) + +## ----------------------------------------------------------------------------- +# Add a year column +myData$year <- as.numeric(format(myData$time_period, '%Y')) +head(myData) + +## ----echo=FALSE--------------------------------------------------------------- +# I'm going to create some made up data +mySites <- unique(myData$site) + +# Build a table of distances +myDistances <- merge(mySites, mySites) + +# add random distances +myDistances$dist <- runif(n = nrow(myDistances), min = 10, max = 10000) + +# to be realistic the distance from a site to itself should be 0 +myDistances$dist[myDistances$x == myDistances$y] <- 0 + + +# Build a table of attributes +# This can be done in numerous ways, here is one example +# Lets say I have habitat data for all my sites +myHabitatData <- data.frame(site = mySites, + grassland = runif(length(mySites), 0, 1), + woodland = runif(length(mySites), 0, 1), + heathland = runif(length(mySites), 0, 1), + urban = runif(length(mySites), 0, 1), + freshwater = runif(length(mySites), 0, 1)) + +# This pretend data is supposed to be proportional cover so lets +# make sure each row sums to 1 +multiples <- apply(myHabitatData[,2:6], 1, sum) + +for(i in 1:length(mySites)){ + + myHabitatData[i,2:6] <- myHabitatData[i,2:6]/multiples[i] + +} + +## ----cache = TRUE------------------------------------------------------------- +# Here is the distance table +head(myDistances) + +# Here is our habitat data +head(myHabitatData) + +# With our distance and habitat tables in hand we can +# use the createWeights function to build our weights file +# I have changed the defualts of dist_sub and sim_sub since +# we have a very small example dataset of only 50 sites +myWeights <- createWeights(distances = myDistances, + attributes = myHabitatData, + dist_sub = 20, + sim_sub = 10) + +head(myWeights) +