Geometric Harnessing of Precipitation Records: Reexamining Four Storms from Iowa City Online Appendix

Huai-Hsien Huang, Carlos E. Puente*, Andrea Cortis
Stochastic Environmental Research and Risk Assessment (2012)
DOI 10.1007/s00477-012-0617-6

This page contains supplementary information deemed not important enough to include in the paper but still of relevance to the interested reader. Here one will find the values of parameters used in making the figures, example MATLAB source code, and interactive demos of the fractal-multifractal encoding method.


Parameters

These tables only list free parameters, rounded to two decimal places. One can mouse over a table cell to see a slightly more precise value (four decimal places).

All values are normalized between 0 and 1 for simplicity when running the General PSO search and thus shown here as such. A, p, r(1), r(2), x live in [0, 1]; y, z in [−5, 5]; d in [−1, 1]; θ(1), θ(2), and ω in [−π/2, π/2].

The first and last of the x-, y-, and p-values are fixed at 0 and 1, respectively. Additionally the first z-value is fixed at 0 for the higher-dimensonal marginals. Note that the p-values delineate the bounds of the probability of using a map. For example, the probabilities associated with the three maps in the first wire example are 26.44%, 30.70%, and 42.86%.

Tables marked in gray denote results that were not shown in the paper.

Iowa A

FM-Wire (maps: 3)
x y d p
0.3569 0.4562 0.4186 0.2644
0.8120 0.3669 0.6954 0.5714
0.7420
FM-Wire (maps: 4)
x y d p
0.4986 0.0000 0.5203 0.2250
0.6935 0.7123 0.2775 0.4844
0.8469 0.7898 0.4189 0.7506
0.1157
FM-Wire (maps: 4)
x y d p
0.6965 0.7877 0.5251 0.2764
0.8864 0.0041 0.7075 0.6026
0.9509 0.4341 0.4624 0.7140
0.1175
FM-Wire (maps: 4)
x y d p
0.4388 0.1077 0.4010 0.2032
0.6957 0.4323 0.5243 0.3931
0.8925 0.4120 0.0473 0.6941
0.3588
Extension 1 (maps: 4)
x y d p
0.5134 0.0047 0.2993 0.4388
0.2350 0.8299 0.1086 0.6736
0.5541 0.5485 0.4299 0.9121
0.4277 0.7382 0.4497
0.8277 0.8291
0.7765 0.7752
Extension 2 (maps: 3)
x y d ω A p
0.3886 0.5850 0.3098 1.0000 0.4051 0.3509
0.3517 0.7122 0.2797 0.9647 0.8092 0.5647
0.7310 0.6591 0.1513 0.8953 0.6706
0.5692 0.1678
Extension 3 (maps: 3)
x y z r(1) r(2) θ1 θ2 p
0.4094 0.0065 0.9795 0.6462 0.5001 0.6030 0.3840 0.3736
0.5767 0.3894 0.0316 0.7908 0.6071 0.0000 0.8713 0.6527
1.0000 0.6715 0.6789 0.5417 0.8932 0.6263 0.0089
0.1515 0.5428 0.5709
0.5130

Iowa B

FM-Wire (maps: 4)
x y d p
0.0488 0.5670 0.9804 0.3652
0.5487 0.0692 0.1346 0.5255
0.6768 0.9337 0.4494 0.7139
0.2687
Extension 1 (maps: 3)
x y d p
0.6813 0.1379 0.3486 0.5818
0.6338 0.2176 0.2289 0.8564
0.8481 0.4266 0.7987
0.7021 0.5818
Extension 1 (maps: 3)
x y d p
0.0001 0.7476 0.6791 0.3615
0.5940 0.0932 0.7372 0.7156
0.7509 0.8297 0.1429
0.7961 0.1167
Extension 1 (maps: 4)
x y d p
0.3282 0.5422 0.3205 0.3588
0.4858 0.7192 0.8440 0.5259
0.9669 0.4414 0.3642 0.7991
0.7317 0.9149 0.2924
0.9514 0.0000
0.3663 0.1624
Extension 1 (maps: 4)
x y d p
0.3006 0.8274 0.7851 0.4763
0.6647 0.8115 0.3732 0.8040
0.9102 0.1029 0.3750 0.9496
0.6626 0.3256 0.1430
0.8874 0.9305
0.1671 0.4528
Extension 2 (maps: 3)
x y d ω A p
0.3394 0.6668 0.6447 0.1075 0.0054 0.1754
0.0000 0.8390 0.3442 0.2192 0.5009 0.5987
0.7382 0.3361 0.2228 0.4745 0.7035
0.7594 0.3396
Extension 3 (maps: 3)
x y z r(1) r(2) θ1 θ2 p
0.5532 0.9756 0.0000 0.7227 0.7036 0.4695 0.0715 0.3653
0.0000 0.4301 0.0000 0.8181 0.6019 0.0090 0.3781 0.6035
0.7758 0.9549 0.6095 0.8125 0.9144 0.0900 0.0632
0.5912 0.0014 0.5173
0.6902

Iowa C

FM-Wire (maps: 4)
x y d p
0.6606 0.2674 0.6476 0.3899
0.8850 0.4225 0.3292 0.6065
0.9330 0.6413 0.0911 0.7241
0.7079
Extension 1 (maps: 3)
x y d p
0.4241 0.5149 0.6235 0.3347
0.4071 0.7321 0.5128 0.5913
0.9478 0.5679 0.5761 0.6814
0.7434
Extension 2 (maps: 2)
x y d ω A p
0.5226 0.8105 0.5786 0.5759 0.1242 0.5944
0.4871 0.5164 0.1663 0.5299 0.1890
Extension 2 (maps: 3)
x y d ω A p
0.4364 1.0000 0.7984 0.8822 0.5941 0.2219
0.2226 0.3974 0.5925 0.2639 0.0190 0.5348
0.5585 0.2710 0.1503 1.0000 0.3383
0.6633 0.3692
Extension 2 (maps: 3)
x y d ω A p
0.0283 0.8144 0.2486 0.5081 0.3864 0.1004
0.0147 0.4412 0.6202 0.0922 0.1642 0.5972
0.7944 0.2242 0.7329 0.8240 0.4581
0.6054 0.6405
Extension 2 (maps: 3)
x y d ω A p
0.6723 0.5581 0.5076 0.4175 0.4342 0.2837
0.2041 0.7414 0.2873 0.1399 0.4530 0.5785
0.5560 0.6145 0.0574 0.1897 0.7604
0.2401 0.8743
Extension 3 (maps: 2)
x y z r(1) r(2) θ1 θ2 p
0.0146 0.8228 0.5411 0.8443 0.8441 0.3302 0.4247 0.7410
0.8758 0.8144 0.3237 0.9825 0.7542 0.4336 0.2307
0.4069

Iowa D

FM-Wire (maps: 4)
x y d p
0.0324 0.7167 0.2417 0.4307
0.6012 0.4157 0.2608 0.7860
0.9490 0.5543 0.3748 0.9269
0.4320
Extension 1 (maps: 4)
x y d p
0.1016 0.7296 0.1891 0.2576
0.4569 0.8795 0.3869 0.3994
0.6600 0.3016 0.3816 0.6128
0.0428 0.3692 0.3960
0.2839 0.9016
0.0671 0.0035
Extension 2 (maps: 3)
x y d ω A p
0.6784 0.4228 0.3857 0.2828 0.1740 0.2413
0.8648 0.5145 0.1162 0.2158 0.0876 0.6383
1.0000 0.8131 0.3137 0.0000 0.2479
0.4686 0.7033
Extension 3 (maps: 2)
x y z r(1) r(2) θ1 θ2 p
0.7159 0.3931 0.1837 0.7902 0.9781 0.8896 0.7006 0.5846
0.5400 0.2011 0.0000 0.5430 0.7530 0.0000 0.1992
0.9503
Extension 3 (maps: 3)
x y z r(1) r(2) θ1 θ2 p
0.9993 0.0000 1.0000 0.8468 0.6512 0.0349 0.1765 0.5541
0.1402 0.7465 0.7566 0.7049 0.8335 0.8116 0.4028 0.8043
0.4111 1.0000 0.0712 0.8388 0.5692 0.9130 0.2270
0.8701 0.5646 0.3806
0.8562
Extension 3 (maps: 3)
x y z r(1) r(2) θ1 θ2 p
0.2116 0.3123 0.8713 0.8214 0.8446 0.9937 1.0000 0.6550
0.6598 0.9999 0.9712 0.9730 0.7659 0.9916 1.0000 0.9332
0.9825 0.9460 0.3455 0.5093 0.5697 0.0000 0.8860
0.9999 0.9999 0.6566
0.5818
Extension 3 (maps: 3)
x y z r(1) r(2) θ1 θ2 p
0.3574 0.2793 0.8624 0.8898 0.5418 0.5016 0.0545 0.4673
0.3887 0.9355 0.7481 0.9816 0.8238 0.0719 0.3034 0.8218
0.8967 0.7042 0.5661 0.5605 0.7010 0.5070 0.5337
0.6378 0.3455 0.5709
0.8781

MATLAB Code

Original FM (wire.m)

  1. function dy = wire(p)
  2. % This subroutine accepts a vector that contains all the
  3. % parameters used in the wire. The number of interpolating
  4. % points is automatically calculated from the vector length.
  5. % Examples:
  6. % pattern_3p = wire([x y d1 d2 p]);
  7. % pattern_4p = wire([x1 x2 y1 y2 d1 d2 d3 p1 p2]);
  8. % pattern_5p = wire([x1 x2 x3 y1 y2 y3 d1 d2 d3 d4 p1 p2 p3]);
  9. % resolution of the pattern (# bins in histogram)
  10. nbins = 2^8;
  11. % duration of chaos game
  12. ndots = 2^14;
  13. % # of interpolating points
  14. intp = (7+length(p))/4;
  15. % y in [-5,5]
  16. M = 5;
  17. % d in [-1,1]
  18. D = 1;
  19. % Put the parameters into neat little vectors.
  20. xs = [0 p(1:(intp-2)) 1];
  21. ys = [0 M*(2*p((intp-1):(2*intp-4))-1) 1];
  22. d = D*(2*p((2*intp-3):(3*intp-5))-1);
  23. ps = [0 p((3*intp-4):(4*intp-7)) 1];
  24. % Validation required when >3 interpolating pts
  25. if intp>3
  26. % x-values must be in increasing order
  27. for vx=2:(length(xs)-2)
  28. if xs(vx) >= xs(vx+1)
  29. dy = ones(1,nbins) / nbins;
  30. return
  31. end
  32. end
  33. % p-values must be in increasing order
  34. for vp=2:(length(ps)-2)
  35. if ps(vp) >= ps(vp+1)
  36. dy = ones(1,nbins) / nbins;
  37. return
  38. end
  39. end
  40. end
  41. % Calculate the other parameters of the map.
  42. h = xs(end)-xs(1);
  43. a =(xs(2:end)-xs(1:end-1))/h;
  44. e = xs(1:end-1)-xs(1)*a;
  45. c =(ys(2:end)-ys(1:end-1)-d*(ys(end) - ys(1)))/h;
  46. f = ys(1:end-1)-d*ys(1)-c*xs(1);
  47. % Determine when to use which map during the chaos game.
  48. W = zeros(ndots,1);
  49. prob = rand(ndots,1);
  50. for k=1:(length(ps)-1)
  51. W = W + and(prob<ps(k+1),prob>ps(k))*k;
  52. end
  53. kfun = sum(W,2);
  54. y = zeros(ndots,1);
  55. xold = xs(2);
  56. yold = ys(2);
  57. y(1) = yold;
  58. for i=1:ndots-1
  59. k = max(min(kfun(i),numel(a)),1);
  60. xnew = a(k)*xold + e(k);
  61. ynew = c(k)*xold + d(k)*yold + f(k);
  62. xold = xnew;
  63. yold = ynew;
  64. y(i+1) = ynew;
  65. end
  66. % Create histogram.
  67. dy = hist(y, nbins);
  68. % Normalize histogram so that the area underneath = 1
  69. dy = dy/sum(dy);
  70. % End.

Extension 1 (overlap.m)

  1. function dy = overlap(p)
  2. % This subroutine accepts a vector that contains all the
  3. % parameters used in the wire. The number of mappings is
  4. % automatically calculated from the vector length.
  5. % resolution of the pattern (# bins in histogram)
  6. nbins = 2^8;
  7. % duration of chaos game
  8. ndots = 2^14;
  9. % # of maps
  10. nobj = (5+length(p))/6;
  11. % y in [-5,5]
  12. M = 5;
  13. % d in [-1,1]
  14. D = 1;
  15. % Put the parameters into neat little vectors.
  16. xs = [0 p(1:(2*nobj-2)) 1];
  17. ys = [0 M*(2*p((2*nobj-1):(4*nobj-4))-1) 1];
  18. d = D*(2*p((4*nobj-3):(5*nobj-4))-1);
  19. ps = [0 p((5*nobj-3):(6*nobj-5)) 1];
  20. % Validation required when >2 maps
  21. if nobj>2
  22. % interval spans must be positive
  23. for vx=3:2:(length(xs)-3)
  24. if xs(vx) >= xs(vx+1)
  25. dy = ones(1,nbins) / nbins;
  26. return
  27. end
  28. end
  29. % p-values must be in increasing order
  30. for vp=2:(length(ps)-2)
  31. if ps(vp) >= ps(vp+1)
  32. dy = ones(1,nbins) / nbins;
  33. return
  34. end
  35. end
  36. end
  37. % Calculate the other parameters of the map.
  38. h = xs(end)-xs(1);
  39. a =(xs(2:2:end)-xs(1:2:end-1))/h;
  40. e = xs(1:2:end-1)-xs(1)*a;
  41. c =(ys(2:2:end)-ys(1:2:end-1)-d*(ys(end)-ys(1)))/h;
  42. f = ys(1:2:end-1)-d*ys(1)-c*xs(1);
  43. % Determine when to use which map during the chaos game.
  44. W = zeros(ndots,1);
  45. prob = rand(ndots,1);
  46. for k=1:(length(ps)-1)
  47. W = W + and(prob<ps(k+1),prob>ps(k))*k;
  48. end
  49. kfun = sum(W,2);
  50. y = zeros(ndots,1);
  51. xold = xs(2);
  52. yold = ys(2);
  53. y(1) = yold;
  54. for i=1:ndots-1
  55. k = max(min(kfun(i),numel(a)),1);
  56. xnew = a(k)*xold + e(k);
  57. ynew = c(k)*xold + d(k)*yold + f(k);
  58. xold = xnew;
  59. yold = ynew;
  60. y(i+1) = ynew;
  61. end
  62. % Create histogram.
  63. dy = hist(y, nbins);
  64. % Normalize histogram so that the area underneath = 1
  65. dy = dy/sum(dy);
  66. % End.

Extension 2 (nonlinear.m)

  1. function dy = nonlinear(p)
  2. % This subroutine accepts a vector that contains all the
  3. % parameters used in the wire. The number of mappings is
  4. % automatically calculated from the vector length.
  5. % resolution of the pattern (# bins in histogram)
  6. nbins = 2^8;
  7. % duration of chaos game
  8. ndots = 2^14;
  9. % # of maps
  10. nobj = (5+length(p))/8;
  11. % y in [-5,5]
  12. M = 5;
  13. % d in [-1,1]
  14. D = 1;
  15. % period in [-pi/2,pi/2]
  16. T = pi/2;
  17. xs = [0 p(1:(2*nobj-2)) 1];
  18. ys = [0 M*(2*p((2*nobj-1):(4*nobj-4))-1) 1];
  19. d = D*(2*p((4*nobj-3):(5*nobj-4))-1);
  20. amp = p((5*nobj-3):(6*nobj-4));
  21. per = T*(2*p((6*nobj-3):(7*nobj-4))-1);
  22. ps = [0 p((7*nobj-3):(8*nobj-5)) 1];
  23. % Validation required when >2 maps
  24. if nobj>2
  25. % interval spans must be positive
  26. for vx=3:2:(length(xs)-3)
  27. if xs(vx) >= xs(vx+1)
  28. dy = ones(1,nbins) / nbins;
  29. return
  30. end
  31. end
  32. % p-values must be in increasing order
  33. for vp=2:(length(ps)-2)
  34. if ps(vp) >= ps(vp+1)
  35. dy = ones(1,nbins) / nbins;
  36. return
  37. end
  38. end
  39. end
  40. % Calculate the other parameters of the map.
  41. hx = xs(end)-xs(1);
  42. hy = ys(end)-ys(1);
  43. a = (xs(2:2:end)-xs(1:2:end-1))/hx;
  44. e = xs(1:2:end-1) - xs(1)*a;
  45. c = (ys(2:2:end)-ys(1:2:end-1) - d*(hy) + d.*amp.*(cos(per*ys(end))-cos(per*ys(1))))/hx;
  46. f = ys(1:2:end-1) - d*ys(1) - d.*amp.*cos(per*ys(1)) - c*xs(1);
  47. % Determine when to use which map during the chaos game.
  48. W = zeros(ndots,1);
  49. prob = rand(ndots,1);
  50. for k=1:(length(ps)-1)
  51. W = W + and(prob<ps(k+1),prob>ps(k))*k;
  52. end
  53. kfun = sum(W,2);
  54. y = zeros(ndots,1);
  55. xold = xs(2);
  56. yold = ys(2);
  57. y(1) = yold;
  58. for i=1:ndots-1
  59. k = max(min(kfun(i),numel(a)),1);
  60. xnew = a(k)*xold + e(k);
  61. ynew = c(k)*xold + d(k)*(yold+amp(k)*cos(per(k)*yold)) + f(k);
  62. xold = xnew;
  63. yold = ynew;
  64. y(i+1) = ynew;
  65. end
  66. % Create histogram.
  67. dy = hist(y, nbins);
  68. % Normalize histogram so that the area underneath = 1
  69. dy = dy/sum(dy);
  70. % End.

Extension 3 (marginal.m)

  1. function res = marginal(p,map_dim)
  2. % This subroutine accepts a vector of length 16 (2 maps)
  3. % or 27 (three maps) as the parameters, plus the dimension/s
  4. % of interest (y, z, or yz; default: y).
  5. % resolution of the pattern (# bins in histogram)
  6. nbins = 2^8;
  7. % resolution of the 2D pattern (if map_dim set to 'yz')
  8. nbins2 = 2^5 -1;
  9. % duration of chaos game
  10. ndots = 2^14;
  11. % y in [-5,5]
  12. M = 5;
  13. % theta in [-pi/2,pi/2]
  14. T = pi/2;
  15. % Put the parameters into neat little vectors.
  16. switch length(p)
  17. case 16 % 2 maps
  18. xs = [0 p(1:2) 1];
  19. ys = [0 M*(2*p(3:4)-1) 1];
  20. zs = [0 M*(2*p(5:7)-1)];
  21. r1 = 2*p(8:9)-1;
  22. r2 = 2*p(10:11)-1;
  23. t1 = T*(2*p(12:13)-1);
  24. t2 = T*(2*p(14:15)-1);
  25. ps = [0 p(16) 1];
  26. case 27 % 3 maps
  27. if ~all([p(2)<p(3) p(26)<p(27)])
  28. res = ones(1,nbins) / nbins;
  29. return
  30. end
  31. xs = [0 p(1:4) 1];
  32. ys = [0 M*(2*p(5:8)-1) 1];
  33. zs = [0 M*(2*p(9:13)-1)];
  34. r1 = 2*p(14:16)-1;
  35. r2 = 2*p(17:19)-1;
  36. t1 = T*(2*p(20:22)-1);
  37. t2 = T*(2*p(23:25)-1);
  38. ps = [0 p(26:27) 1];
  39. otherwise
  40. res = ones(1,nbins) / nbins;
  41. return
  42. end
  43. % Calculate the other parameters of the map.
  44. e = r1.*cos(t1);
  45. f = -r2.*sin(t2);
  46. h = r1.*sin(t1);
  47. k = r2.*cos(t2);
  48. hx = xs(end)-xs(1);
  49. hy = ys(end)-ys(1);
  50. hz = zs(end)-zs(1);
  51. a = (xs(2:2:end)-xs(1:2:end-1)) / hx;
  52. l = xs(1:2:end-1) - xs(1)*a;
  53. d = (ys(2:2:end)-ys(1:2:end-1) - e*hy - f*hz) / hx;
  54. g = (zs(2:2:end)-zs(1:2:end-1) - h*hy - k*hz) / hx;
  55. m = (ys(1:2:end-1) - d*xs(1) - e*ys(1) - f*zs(1));
  56. n = (zs(1:2:end-1) - g*xs(1) - h*ys(1) - k*zs(1));
  57. % Determine when to use which map during the chaos game.
  58. kfun = zeros(ndots,1);
  59. prob = rand(ndots,1);
  60. for kind=1:(length(ps)-1)
  61. kfun = kfun + and(prob<ps(kind+1),prob>ps(kind)) * kind;
  62. end
  63. y = zeros(ndots,1);
  64. z = zeros(ndots,1);
  65. yz = zeros(nbins2+1,nbins2+1);
  66. xold = xs(2);
  67. yold = ys(2);
  68. zold = zs(2);
  69. y(1) = yold;
  70. z(1) = zold;
  71. for i=1:ndots-1
  72. kk = max(min(kfun(i),numel(a)),1);
  73. xnew = a(kk)*xold + l(kk);
  74. ynew = d(kk)*xold + e(kk)*yold + f(kk)*zold + m(kk);
  75. znew = g(kk)*xold + h(kk)*yold + k(kk)*zold + n(kk);
  76. xold = xnew;
  77. yold = ynew;
  78. zold = znew;
  79. y(i+1) = ynew;
  80. z(i+1) = znew;
  81. end
  82. % Decide on what to send back.
  83. switch map_dim
  84. case 'y' % Marginal over y.
  85. dy = hist(y, nbins);
  86. dy = dy/sum(dy);
  87. res = dy;
  88. case 'z' % Marginal over z.
  89. dz = hist(z, nbins);
  90. dz = dz/sum(dz);
  91. res = dz;
  92. case 'yz' % 2D histogram over yz.
  93. y1 = min(y)-eps; y2 = max(y)+eps;
  94. z1 = min(z)-eps; z2 = max(z)+eps;
  95. for i=1:ndots
  96. iy = floor((y(i) - y1)/(y2-y1)*nbins2)+1;
  97. iz = floor((z(i) - z1)/(z2-z1)*nbins2)+1;
  98. yz(iy,iz) = yz(iy,iz) + 1;
  99. end
  100. dyz = yz/sum(yz(:));
  101. res = dyz;
  102. otherwise % Marginal over y by default.
  103. dy = hist(y, nbins);
  104. dy = dy/sum(dy);
  105. res = dy;
  106. end
  107. % End.

Online Demo

Below are live demonstrations of the wire subroutine, using normalized parameters. The other procedures have been omitted as matrix manipulation is not very efficient in JavaScript.

Wire with 3 maps

X-values
Y-values
Scalings
Probability

Wire with 4 maps

X-values
Y-values
Scalings
Probability