> s <- c(0,0,1,1,3,1,5) > d <- c(0,0,0,2,4,4,6) > createA(s,d) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.000 0.00 0.500 0.5000 0.50000 0.75000 0.62500 [2,] 0.000 1.00 0.000 0.5000 0.25000 0.25000 0.25000 [3,] 0.500 0.00 1.000 0.2500 0.62500 0.37500 0.50000 [4,] 0.500 0.50 0.250 1.0000 0.62500 0.75000 0.68750 [5,] 0.500 0.25 0.625 0.6250 1.12500 0.56250 0.84375 [6,] 0.750 0.25 0.375 0.7500 0.56250 1.25000 0.90625 [7,] 0.625 0.25 0.500 0.6875 0.84375 0.90625 1.28125
> s <- c(0,0,1,1,3,1,5) > d <- c(0,0,0,2,4,4,6) > L <- createL(s,d) > L [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.000 0.00 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [2,] 0.000 1.00 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [3,] 0.500 0.00 0.8660254 0.0000000 0.0000000 0.0000000 0.0000000 [4,] 0.500 0.50 0.0000000 0.7071068 0.0000000 0.0000000 0.0000000 [5,] 0.500 0.25 0.4330127 0.3535534 0.7071068 0.0000000 0.0000000 [6,] 0.750 0.25 0.0000000 0.3535534 0.0000000 0.7071068 0.0000000 [7,] 0.625 0.25 0.2165064 0.3535534 0.3535534 0.3535534 0.6373774 > L%*%t(L) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.000 0.00 0.500 0.5000 0.50000 0.75000 0.62500 [2,] 0.000 1.00 0.000 0.5000 0.25000 0.25000 0.25000 [3,] 0.500 0.00 1.000 0.2500 0.62500 0.37500 0.50000 [4,] 0.500 0.50 0.250 1.0000 0.62500 0.75000 0.68750 [5,] 0.500 0.25 0.625 0.6250 1.12500 0.56250 0.84375 [6,] 0.750 0.25 0.375 0.7500 0.56250 1.25000 0.90625 [7,] 0.625 0.25 0.500 0.6875 0.84375 0.90625 1.28125
> s <- c(0,0,1,1,4) > d <- c(0,0,2,3,2) > G <- createG(s,d) > createAfromG(G) [,1] [,2] [,3] [,4] [,5] [1,] 1.000 0.000 0.500 0.75 0.375 [2,] 0.000 1.000 0.500 0.25 0.625 [3,] 0.500 0.500 1.000 0.75 0.625 [4,] 0.750 0.250 0.750 1.25 0.750 [5,] 0.375 0.625 0.625 0.75 1.125
> s <- c(0,0,1,1,1,1,1,2,7) > d <- c(0,0,2,2,2,0,0,0,8) > createAinv(s,d) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3.1666667 1.5000000 -1 -1 -1 -0.6666667 -0.6666667 0.0000000 0 [2,] 1.5000000 2.8333333 -1 -1 -1 0.0000000 0.0000000 -0.6666667 0 [3,] -1.0000000 -1.0000000 2 0 0 0.0000000 0.0000000 0.0000000 0 [4,] -1.0000000 -1.0000000 0 2 0 0.0000000 0.0000000 0.0000000 0 [5,] -1.0000000 -1.0000000 0 0 2 0.0000000 0.0000000 0.0000000 0 [6,] -0.6666667 0.0000000 0 0 0 1.3333333 0.0000000 0.0000000 0 [7,] -0.6666667 0.0000000 0 0 0 0.0000000 1.8333333 0.5000000 -1 [8,] 0.0000000 -0.6666667 0 0 0 0.0000000 0.5000000 1.8333333 -1 [9,] 0.0000000 0.0000000 0 0 0 0.0000000 -1.0000000 -1.0000000 2
> s <- c(0,0,1,1,3,1,5) > d <- c(0,0,0,2,4,4,6) > createAinvL(s,d) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.3333333 0.5 -0.6666667 -0.5 0.0000000 -1.0000000 0.000000 [2,] 0.5000000 1.5 0.0000000 -1.0 0.0000000 0.0000000 0.000000 [3,] -0.6666667 0.0 1.8333333 0.5 -1.0000000 0.0000000 0.000000 [4,] -0.5000000 -1.0 0.5000000 3.0 -1.0000000 -1.0000000 0.000000 [5,] 0.0000000 0.0 -1.0000000 -1.0 2.6153846 0.6153846 -1.230769 [6,] -1.0000000 0.0 0.0000000 -1.0 0.6153846 2.6153846 -1.230769 [7,] 0.0000000 0.0 0.0000000 0.0 -1.2307692 -1.2307692 2.461538
> s <- c(0,0,1,1,3,1,5) > d <- c(0,0,0,2,4,4,6) > quass(s,d) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.3333333 0.5 -0.6666667 -0.5 0.0000000 -1.0000000 0.000000 [2,] 0.5000000 1.5 0.0000000 -1.0 0.0000000 0.0000000 0.000000 [3,] -0.6666667 0.0 1.8333333 0.5 -1.0000000 0.0000000 0.000000 [4,] -0.5000000 -1.0 0.5000000 3.0 -1.0000000 -1.0000000 0.000000 [5,] 0.0000000 0.0 -1.0000000 -1.0 2.6153846 0.6153846 -1.230769 [6,] -1.0000000 0.0 0.0000000 -1.0 0.6153846 2.6153846 -1.230769 [7,] 0.0000000 0.0 0.0000000 0.0 -1.2307692 -1.2307692 2.461538
> s <- c(0,0,0,0,1,3,6,0,3,3,6,6) > d <- c(0,0,0,0,2,4,5,5,8,8,8,8) > createD(s,d) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 1 0 0 0 0 0 0.0000 0 0.0000 0.0000 0.000 0.000 [2,] 0 1 0 0 0 0 0.0000 0 0.0000 0.0000 0.000 0.000 [3,] 0 0 1 0 0 0 0.0000 0 0.0000 0.0000 0.000 0.000 [4,] 0 0 0 1 0 0 0.0000 0 0.0000 0.0000 0.000 0.000 [5,] 0 0 0 0 1 0 0.0000 0 0.0000 0.0000 0.000 0.000 [6,] 0 0 0 0 0 1 0.0000 0 0.0000 0.0000 0.000 0.000 [7,] 0 0 0 0 0 0 1.0000 0 0.0625 0.0625 0.125 0.125 [8,] 0 0 0 0 0 0 0.0000 1 0.0000 0.0000 0.000 0.000 [9,] 0 0 0 0 0 0 0.0625 0 1.0000 0.2500 0.125 0.125 [10,] 0 0 0 0 0 0 0.0625 0 0.2500 1.0000 0.125 0.125 [11,] 0 0 0 0 0 0 0.1250 0 0.1250 0.1250 1.000 0.250 [12,] 0 0 0 0 0 0 0.1250 0 0.1250 0.1250 0.250 1.000
> s <- c(0,0,1,1,4) > d <- c(0,0,2,3,2) > G <- createG(s,d) > createDfromG(G) [,1] [,2] [,3] [,4] [,5] [1,] 1.00 0.000 0.00 0.25000 0.000000 [2,] 0.00 1.000 0.00 0.00000 0.125000 [3,] 0.00 0.000 1.00 0.25000 0.250000 [4,] 0.25 0.000 0.25 1.06250 0.156250 [5,] 0.00 0.125 0.25 0.15625 1.015625
> s <- c(0,0,1,1,4) > d <- c(0,0,2,3,2) > createG(s,d) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.000 0.000 0.000 0.000 0.5 0.00 0.500 0.250 0.375 0.000 [2,] 0.000 1.000 0.000 0.000 0.5 0.00 0.500 0.250 0.375 0.000 [3,] 0.000 0.000 1.000 0.000 0.0 0.50 0.000 0.250 0.125 0.500 [4,] 0.000 0.000 0.000 1.000 0.0 0.50 0.000 0.250 0.125 0.500 [5,] 0.500 0.500 0.000 0.000 1.0 0.00 0.500 0.500 0.500 0.000 [6,] 0.000 0.000 0.500 0.500 0.0 1.00 0.000 0.500 0.250 0.500 [7,] 0.500 0.500 0.000 0.000 0.5 0.00 1.000 0.250 0.625 0.000 [8,] 0.250 0.250 0.250 0.250 0.5 0.50 0.250 1.000 0.625 0.250 [9,] 0.375 0.375 0.125 0.125 0.5 0.25 0.625 0.625 1.000 0.125 [10,] 0.000 0.000 0.500 0.500 0.0 0.50 0.000 0.250 0.125 1.000
> s <- c(0,0,1,1,4) > d <- c(0,0,2,3,3) > sM <- c(0,0,1,2,1) > dM <- c(0,0,2,1,1) > r <- 0.1 > createG(s,d,sM,dM,r) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.000 0.000 0.000 0.000 0.900 0.00 0.1000 0.8100 0.1710 0.8100 [2,] 0.000 1.000 0.000 0.000 0.100 0.00 0.9000 0.0900 0.8190 0.0900 [3,] 0.000 0.000 1.000 0.000 0.000 0.10 0.0000 0.0100 0.0010 0.0100 [4,] 0.000 0.000 0.000 1.000 0.000 0.90 0.0000 0.0900 0.0090 0.0900 [5,] 0.900 0.100 0.000 0.000 1.000 0.00 0.1800 0.9000 0.2520 0.9000 [6,] 0.000 0.000 0.100 0.900 0.000 1.00 0.0000 0.1000 0.0100 0.1000 [7,] 0.100 0.900 0.000 0.000 0.180 0.00 1.0000 0.1620 0.9162 0.1620 [8,] 0.810 0.090 0.010 0.090 0.900 0.10 0.1620 1.0000 0.2458 0.8200 [9,] 0.171 0.819 0.001 0.009 0.252 0.01 0.9162 0.2458 1.0000 0.2278 [10,] 0.810 0.090 0.010 0.090 0.900 0.10 0.1620 0.8200 0.2278 1.0000