Permalink
Browse files

Pristine Start using Luke's original CLS 1.0 alpha 1

  • Loading branch information...
blindglobe committed Jan 28, 2007
0 parents commit ab0c5b6f473c5e8d596e0d8b8390869e7d039ca1
Showing with 18,375 additions and 0 deletions.
  1. +3 −0 Data/absorbtion.lsp
  2. +22 −0 Data/aircraft.lsp
  3. +57 −0 Data/book.lsp
  4. +1 −0 Data/car-prices.lsp
  5. +3 −0 Data/diabetes.lsp
  6. +2 −0 Data/heating.lsp
  7. +2 −0 Data/iris.lsp
  8. +25 −0 Data/leukemia.lsp
  9. +2 −0 Data/metabolism.lsp
  10. +4 −0 Data/oxygen.lsp
  11. +24 −0 Data/puromycin.lsp
  12. +1 −0 Data/randu.lsp
  13. +4 −0 Data/stackloss.lsp
  14. +35 −0 Data/tutorial.lsp
  15. +10 −0 Examples/fstat.lsp
  16. +76 −0 Makefile
  17. +44 −0 README
  18. +20 −0 README.excl
  19. +42 −0 README.kcl
  20. +50 −0 README.mcl
  21. +663 −0 bayes.lsp
  22. +695 −0 cmpinclude.h
  23. +210 −0 compound.lsp
  24. +183 −0 defsys.lsp
  25. +257 −0 dists.lsp
  26. +402 −0 exclglue.lsp
  27. +95 −0 fastmap.lsp
  28. +436 −0 kclglue.lsp
  29. +48 −0 kclpatch.lsp
  30. +180 −0 ladata.lsp
  31. +25 −0 lib/Makefile
  32. +289 −0 lib/betabase.c
  33. +128 −0 lib/bivnor.c
  34. +227 −0 lib/cbayes.c
  35. +837 −0 lib/cdists.c
  36. +827 −0 lib/cfft.c
  37. +81 −0 lib/cholesky.c
  38. +134 −0 lib/clib.make
  39. +211 −0 lib/clinalg.c
  40. +115 −0 lib/complex.c
  41. +14 −0 lib/complex.h
  42. +67 −0 lib/derivatives.c
  43. +625 −0 lib/eigen.c
  44. +385 −0 lib/exclglue.c
  45. +1,105 −0 lib/functions.c
  46. +35 −0 lib/gamln.c
  47. +288 −0 lib/gammabase.c
  48. +83 −0 lib/kernel.c
  49. +26 −0 lib/linalg.h
  50. +89 −0 lib/linalgdata.c
  51. +148 −0 lib/lowess.c
  52. +173 −0 lib/ludecomp.c
  53. +59 −0 lib/makerotation.c
  54. +476 −0 lib/mclglue.c
  55. +848 −0 lib/minimize.c
  56. +90 −0 lib/nor.c
  57. +60 −0 lib/ppnd.c
  58. +186 −0 lib/qrdecomp.c
  59. +100 −0 lib/rcondest.c
  60. +104 −0 lib/splines.c
  61. +120 −0 lib/studentbase.c
  62. +261 −0 lib/svdecomp.c
  63. +9 −0 lib/xlisp.h
  64. +5 −0 lib/xmath.h
  65. +1,074 −0 linalg.lsp
  66. +717 −0 lsbasics.lsp
  67. +207 −0 lsfloat.lsp
  68. +105 −0 lsmacros.lsp
  69. +212 −0 lsmath.lsp
  70. +816 −0 lsobjects.lsp
  71. +244 −0 lspackages.lsp
  72. +145 −0 lstoplevel.lsp
  73. +13 −0 makesys.excl
  74. +13 −0 makesys.excl.dist
  75. +11 −0 makesys.kcl
  76. +287 −0 matrices.lsp
  77. +326 −0 maximize.lsp
  78. +468 −0 mclglue.lsp
  79. +286 −0 nonlin.lsp
  80. +655 −0 num_sfun.c
  81. +197 −0 numlib.lsp
  82. +447 −0 regression.lsp
  83. +326 −0 statistics.lsp
@@ -0,0 +1,3 @@
+(def iron (list 61 175 111 124 130 173 169 169 160 224 257 333 199))
+(def aluminum (list 13 21 24 23 64 38 33 61 39 71 112 88 54))
+(def absorbtion (list 4 18 14 18 26 26 21 30 28 36 65 62 40))
@@ -0,0 +1,22 @@
+(require "maximize")
+
+(def failure-times
+ '((413 14 58 37 100 65 9 169 447 184 36 201 118 34 31
+ 18 18 67 57 62 7 22 34)
+ (90 10 60 186 61 49 14 24 56 20 79 84 44 59 29 118 25 156
+ 310 76 26 44 23 62 130 208 70 101 208)
+ (74 57 48 29 502 12 70 21 29 386 59 27 153 26 326)
+ (55 320 65 104 220 239 47 246 176 182 33 15 104 35)
+ (23 261 87 7 120 14 62 47 225 71 246 21 42 20 5 12 120
+ 11 3 14 71 11 14 11 16 90 1 16 52 95)))
+
+(def x (select failure-times 1))
+
+(defun gllik (theta)
+ (let* ((mu (select theta 0))
+ (beta (select theta 1))
+ (n (length x))
+ (bym (* x (/ beta mu))))
+ (+ (* n (- (log beta) (log mu) (log-gamma beta)))
+ (sum (* (- beta 1) (log bym)))
+ (sum (- bym)))))
@@ -0,0 +1,57 @@
+(load-data "tutorial")
+(load-data "oxygen")
+(load-data "puromycin")
+(load-data "aircraft")
+(load-data "leukemia")
+(load-data "stackloss")
+(def precipitation
+ (list .77 1.74 .81 1.20 1.95 1.20 .47 1.43 3.37 2.20
+ 3.00 3.09 1.51 2.10 .52 1.62 1.31 .32 .59 .81
+ 2.81 1.87 1.18 1.35 4.75 2.48 .96 1.89 .90 2.05))
+(def urban (list 206 170 155 155 134 239 234 228 330 284
+ 201 241 179 244 200 205 279 227 197 242 234))
+(def rural (list 108 152 129 146 174 194 152 223 231 131
+ 142 173 155 220 172 148 143 158 108 136))
+(def hc (list .50 .65 .46 .41 .41 .39 .44 .55 .72 .64 .83 .38
+ .38 .50 .60 .73 .83 .57 .34 .41 .37 1.02 .87 1.10
+ .65 .43 .48 .41 .51 .41 .47 .52 .56 .70 .51 .52
+ .57 .51 .36 .48 .52 .61 .58 .46 .47 .55))
+(def co (list 5.01 14.67 8.60 4.42 4.95 7.24 7.51 12.30
+ 14.59 7.98 11.53 4.10 5.21 12.10 9.62 14.97
+ 15.13 5.04 3.95 3.38 4.12 23.53 19.00 22.92
+ 11.20 3.81 3.45 1.85 4.10 2.26 4.74 4.29
+ 5.36 14.83 5.69 6.35 6.02 5.79 2.03 4.62
+ 6.78 8.43 6.02 3.99 5.22 7.47))
+(def age (list 19 21 24 24 24 25 32 33 35 37 37 44 50 51 52 55 57 62))
+(def cpk (list 520 300 480 1040 1360 580 440 180 490 520 380 640 360
+ 240 420 280 400 260))
+(def yield (list 9.2 12.4 5.0 8.9 9.2 6.0 16.3 15.2 9.4
+ 12.4 14.5 8.6 12.7 14.0 12.3 18.2 18.0 16.9
+ 12.9 16.4 12.1 14.6 16.0 14.7 20.8 20.6 18.7
+ 10.9 14.3 9.2 12.6 13.0 13.0 18.3 16.0 13.0))
+(def variety (repeat (repeat (list 1 2 3) (list 3 3 3)) 4))
+(def density (repeat (list 1 2 3 4) (list 9 9 9 9)))
+(def abrasion-loss
+ (list 372 206 175 154 136 112 55 45 221 166 164 113 82
+ 32 228 196 128 97 64 249 219 186 155 114 341 340
+ 283 267 215 148))
+(def gas1 (list 17.14 12.17 12.22 13.89 16.47 15.88 16.10 16.74 17.54 17.43
+ 14.57 12.90 12.81 14.95 16.25 17.13 14.46 14.20 16.90 11.34
+ 12.57 13.15 16.53 13.60 13.34 13.67 14.23 15.81 16.63 11.40
+ 14.94 13.66 9.79 13.08 14.57 14.93 14.01 14.43 16.35 15.65
+ 11.52 17.46 14.67 15.92 16.02 13.46 13.70 14.98 14.57 15.72))
+(def gas2 (list 24.57 24.79 22.21 25.84 25.35 22.19 24.37 21.32 22.74 23.35
+ 25.10 28.03 29.09 29.34 24.41 25.12 25.27 27.46 27.65 27.95
+ 21.67 22.15 24.36 26.32 24.05 28.27 26.57 26.10 24.35 30.04
+ 25.18 27.42 24.50 23.21 25.10 23.59 26.98 22.64 25.27 25.84
+ 27.18 24.69 26.35 23.05 23.37 25.46 28.84 22.14 25.42 21.76))
+(def flow (list 5.00 4.81 4.46 4.84 4.46 3.85 3.21 3.25 4.55
+ 4.85 4.00 3.62 5.15 3.76 4.90 4.13 5.10 5.05
+ 4.27 4.90 4.55 4.39 4.85 4.59 5.00 3.82 3.68
+ 5.15 2.94 5.00 4.10 1.15 1.72 4.20 5.00))
+(def moist (list 21 20 16 18 16 18 12 12 13 13 17 24 11 10 17
+ 14 14 14 20 12 11 10 16 17 17 17 15 17 21 21
+ 21 26 21 17 11))
+(def ratio (list 2.4 2.4 2.4 2.5 3.2 3.1 3.2 2.7 2.7 2.7 2.7
+ 2.8 2.5 2.6 2 2 2.0 1.9 2.1 1.9 2 2.0 2.0 2.2 2.4
+ 2.4 2.4 2.2 2.2 1.9 2.4 3.5 3 3.5 3.2))
@@ -0,0 +1 @@
+(DEF CAR-PRICES (QUOTE (0.95 1.9 1.3 1.8 1.7 1.5 1.39 1.5 1.5 1.99 1.5 1.75 1.79 1.8 1.1 1.99 1.39 1.8 2.98 2.98 2.9 2.49 2.55 2.6 2.85 2 2.39 2.55 2 2.9 2.99 2.39 2.68 2.48 3.99 3.99 3.3 3.75 3.28 3.92 3.8 3.19 4.88 4.39 4.48 5.2 5.49 5.3 5.3 5.87)))
@@ -0,0 +1,3 @@
+
+(DEF DIABETES (QUOTE ((80 97 105 90 90 86 100 85 97 97 91 87 78 90 86 80 90 99 85 90 90 88 95 90 92 74 98 100 86 98 70 99 75 90 85 99 100 78 106 98 102 90 94 80 93 86 85 96 88 87 94 93 86 86 96 86 89 83 98 100 110 88 100 80 89 91 96 95 82 84 90 100 86 93 107 112 94 93 93 90 99 93 85 89 96 111 107 114 101 108 112 105 103 99 102 110 102 96 95 112 110 92 104 75 92 92 92 93 112 88 114 103 300 303 125 280 216 190 151 303 173 203 195 140 151 275 260 149 233 146 124 213 330 123 130 120 138 188 339 265 353 180 213 328 346) (356 289 319 356 323 381 350 301 379 296 353 306 290 371 312 393 364 359 296 345 378 304 347 327 386 365 365 352 325 321 360 336 352 353 373 376 367 335 396 277 378 360 291 269 318 328 334 356 291 360 313 306 319 349 332 323 323 351 478 398 426 439 429 333 472 436 418 391 390 416 413 385 393 376 403 414 426 364 391 356 398 393 425 318 465 558 503 540 469 486 568 527 537 466 599 477 472 456 517 503 522 476 472 455 442 541 580 472 562 423 643 533 1468 1487 714 1470 1113 972 854 1364 832 967 920 613 857 1373 1133 849 1183 847 538 1001 1520 557 670 636 741 958 1354 1263 1428 923 1025 1246 1568) (124 117 143 199 240 157 221 186 142 131 221 178 136 200 208 202 152 185 116 123 136 134 184 192 279 228 145 172 179 222 134 143 169 263 174 134 182 241 128 222 165 282 94 121 73 106 118 112 157 292 200 220 144 109 151 158 73 81 151 122 117 208 201 131 162 148 130 137 375 146 344 192 115 195 267 281 213 156 221 199 76 490 143 73 237 748 320 188 607 297 232 480 622 287 266 124 297 326 564 408 325 433 180 392 109 313 132 285 139 212 155 120 28 23 232 54 81 87 76 42 102 138 160 131 145 45 118 159 73 103 460 42 13 130 44 314 219 100 10 83 41 77 29 124 15) (3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 2 2 3 2 2 3 3 3 3 2 3 3 3 3 3 2 3 3 3 3 3 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1))))
+(DEF DLABS (QUOTE ("GLUFAST" "GLUTEST" "INSTEST" "CCLASS")))
@@ -0,0 +1,2 @@
+(DEF GAS-HEAT (QUOTE (25.42 26.12 25.22 23.6 27.77 28.52 21.6 29.49 26.22 25.52 20.19 23.99 26.32 23.38 26.77 31.56 25.54 22.72 27.58 29.96 26.2 23.97 28.17 18.01 22.98)))
+(DEF ELECTRIC-HEAT (QUOTE (33.52 51.01 41.99 33.8 25.93 30.32 32.06 39.86 24.62 31.8 48.58 44.65 31.3 35.4 19.24 40.78 43.39 34.78 25.43 33.82 26.47 34.62 32.02 27.98 30.92)))
@@ -0,0 +1,2 @@
+(DEF VARNAMES (QUOTE ("Sepal Length" "Sepal Width" "Petal Length" "Petal Width")))
+(DEF IRIS (QUOTE ((5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 5.4 4.8 4.8 4.3 5.8 5.7 5.4 5.1 5.7 5.1 5.4 5.1 4.6 5.1 4.8 5 5 5.2 5.2 4.7 4.8 5.4 5.2 5.5 4.9 5 5.5 4.9 4.4 5.1 5 4.5 4.4 5 5.1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8 1.8 2.1 2.4 2.3 1.9 2.3 2.5 2.3 1.9 2 2.3 1.8))))
@@ -0,0 +1,25 @@
+(require "bayes")
+
+(def wbc-pos (list 2300 750 4300 2600 6000 10500 10000 17000 5400 7000
+ 9400 32000 35000 100000 100000 52000 100000))
+
+(def transformed-wbc-pos (- (log wbc-pos) (log 10000)))
+
+(def times-pos (list 65 156 100 134 16 108 121 4 39 143 56 26 22 1 1 5 65))
+
+(defun llik-pos (theta)
+ (let* ((x transformed-wbc-pos)
+ (y times-pos)
+ (theta0 (select theta 0))
+ (theta1 (select theta 1))
+ (t1x (* theta1 x)))
+ (- (sum t1x)
+ (* (length x) (log theta0))
+ (/ (sum (* y (exp t1x)))
+ theta0))))
+
+(defun lk-sprob (theta)
+ (let* ((time 52.0)
+ (x (log 5))
+ (mu (* (select theta 0) (exp (- (* (select theta 1) x))))))
+ (exp (- (/ time mu)))))
@@ -0,0 +1,2 @@
+(DEF CPK (QUOTE (180 300 520 480 580 440 380 480 520 1040 1360 640 260 360 400 230 300 400)))
+(DEF AGE (QUOTE (33 21 19 24 25 32 36 35 36 24 25 44 51 50 52 55 62 57)))
@@ -0,0 +1,4 @@
+(def ethanol (list .59 .30 .25 .03 .44 .18 .13 .02 .22 .23 .07 .00 .12 .13 .00 .01))
+(def oxygen (list 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4))
+(def sugar (list 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 ))
+
@@ -0,0 +1,24 @@
+(require "nonlin")
+
+(def x1 (list 0.02 0.02 0.06 0.06 .11 .11 .22 .22 .56 .56 1.1 1.1))
+
+(def x2 (list 0.02 0.02 0.06 0.06 .11 .11 .22 .22 .56 .56 1.1))
+
+(def y1 (list 76 47 97 107 123 139 159 152 191 201 207 200))
+
+(def y2 (list 67 51 84 86 98 115 131 124 144 158 160))
+
+(defun f1 (theta)
+ "The Michaelis-Menten function for the velocity of an enzymatic reaction
+as a function of the substrate concentration. THETA is a parameter
+vector of length 2 consisting of the asymptotic velocity and the
+concentration at which half the asymptotic velocity is attained."
+ (/ (* (select theta 0) x1) (+ (select theta 1) x1)))
+
+(defun f2 (theta)
+ "The Michaelis-Menten function for the velocity of an enzymatic reaction
+as a function of the substrate concentration. THETA is a parameter
+vector of length 2 consisting of the asymptotic velocity and the
+concentration at which half the asymptotic velocity is attained."
+ (/ (* (select theta 0) x2) (+ (select theta 1) x2)))
+
@@ -0,0 +1 @@
+(DEF RANDU (QUOTE ((0.044495 0.82244 0.322291 0.393595 0.309097 0.826368 0.729424 0.317649 0.599793 0.647603 0.547048 0.529873 0.90804 0.835195 0.068696 0.984329 0.945783 0.017137 0.772506 0.49308 0.919386 0.964342 0.864672 0.786249 0.123862 0.990535 0.455714 0.345516 0.482433 0.0631 0.494563 0.386052 0.156384 0.99985 0.585455 0.361887 0.350248 0.126752 0.812634 0.369723 0.437286 0.771568 0.697878 0.826174 0.530293 0.968455 0.415824 0.793458 0.622709 0.748484 0.392119 0.32851 0.425048 0.391111 0.409372 0.230546 0.021631 0.011576 0.345928 0.562056 0.47264 0.859244 0.672445 0.31824 0.486482 0.701881 0.831292 0.619876 0.287463 0.670872 0.623757 0.804632 0.803778 0.94237 0.730063 0.79181 0.300808 0.629387 0.487203 0.09553 0.584738 0.259822 0.049581 0.861351 0.901482 0.215425 0.057474 0.301331 0.655918 0.5067 0.938298 0.90252 0.076441 0.258743 0.96569 0.783897 0.949827 0.283024 0.201405 0.576739 0.551408 0.110096 0.44502 0.203431 0.895558 0.858251 0.316456 0.929709 0.431499 0.313108 0.596309 0.065349 0.309409 0.593143 0.948994 0.688282 0.341853 0.776151 0.153704 0.767158 0.785514 0.861648 0.968176 0.057338 0.068251 0.444216 0.750276 0.145329 0.586459 0.472772 0.962394 0.016658 0.697745 0.470791 0.683648 0.522175 0.033916 0.592453 0.254907 0.117803 0.25928 0.889736 0.181619 0.25272 0.399261 0.16544 0.41946 0.780983 0.864323 0.787156) (0.155732 0.873416 0.648545 0.826873 0.92659 0.30854 0.741526 0.393468 0.846041 0.281525 0.94879 0.348011 0.013456 0.814513 0.275943 0.927687 0.689675 0.166494 0.282393 0.943686 0.618783 0.025198 0.711721 0.961377 0.810826 0.706806 0.020492 0.800801 0.160464 0.488463 0.180498 0.482467 0.276557 0.198618 0.129442 0.743469 0.897698 0.190162 0.245063 0.248908 0.268675 0.821389 0.217688 0.623633 0.852871 0.569763 0.696233 0.429293 0.75561 0.903503 0.082637 0.211696 0.233427 0.035974 0.849729 0.743487 0.664288 0.687896 0.75754 0.587138 0.353742 0.982364 0.343048 0.103248 0.552006 0.597679 0.05836 0.029152 0.057 0.302992 0.432338 0.752854 0.778307 0.001763 0.630651 0.407259 0.637073 0.408029 0.789276 0.909727 0.176853 0.480486 0.49643 0.071937 0.260386 0.739384 0.797941 0.90506 0.227307 0.591236 0.101057 0.245249 0.887802 0.786332 0.35169 0.824439 0.727198 0.134077 0.860104 0.911462 0.696489 0.601132 0.150031 0.64847 0.963804 0.917374 0.206234 0.207676 0.001802 0.814661 0.4955 0.893404 0.386023 0.023418 0.136076 0.314449 0.679153 0.15203 0.590536 0.75176 0.776249 0.57405 0.257096 0.846421 0.085886 0.448217 0.334354 0.732954 0.922249 0.996288 0.334478 0.742936 0.483157 0.163685 0.619823 0.80392 0.789033 0.787949 0.337993 0.658675 0.957802 0.400012 0.130337 0.029737 0.190735 0.783277 0.988879 0.854271 0.844219 0.415515) (0.533939 0.838542 0.990648 0.418881 0.777664 0.413932 0.884338 0.501968 0.678107 0.860718 0.769314 0.319211 0.90838 0.370327 0.037394 0.707165 0.626002 0.844727 0.741801 0.224398 0.438229 0.47211 0.488282 0.692023 0.750198 0.326013 0.021528 0.695158 0.620887 0.36288 0.631916 0.420333 0.251881 0.193051 0.507559 0.203826 0.233957 0.000203 0.156666 0.165943 0.676477 0.984216 0.025225 0.306233 0.344595 0.702484 0.434983 0.434638 0.929275 0.684661 0.966753 0.313584 0.575129 0.695843 0.414026 0.386009 0.791052 0.023192 0.431892 0.464327 0.868689 0.16099 0.006286 0.75533 0.933698 0.269141 0.868532 0.596032 0.754833 0.7801 0.98021 0.275437 0.435841 0.529245 0.213333 0.317265 0.115167 0.783687 0.350829 0.598596 0.798474 0.544515 0.532351 0.679465 0.448975 0.49748 0.27038 0.718384 0.460576 0.987116 0.16166 0.348813 0.638839 0.389299 0.418931 0.89156 0.814741 0.257241 0.347981 0.278116 0.216269 0.615928 0.895009 0.059942 0.722801 0.779985 0.389302 0.878674 0.127325 0.06999 0.606222 0.772282 0.53145 0.802219 0.275507 0.692158 0.998243 0.926825 0.159884 0.606141 0.587872 0.689467 0.828997 0.562486 0.901061 0.691361 0.253643 0.089762 0.255363 0.722781 0.345322 0.307697 0.61924 0.744991 0.566103 0.123949 0.428958 0.395616 0.733798 0.891827 0.413294 0.39245 0.14745 0.903937 0.551055 0.210702 0.158136 0.09678 0.286411 0.408684))))
@@ -0,0 +1,4 @@
+(DEF LOSS (QUOTE (42 37 37 28 18 18 19 20 15 14 14 13 11 12 8 7 8 8 9 15 15)))
+(DEF AIR (QUOTE (80 80 75 62 62 62 62 62 58 58 58 58 58 58 50 50 50 50 50 56 70)))
+(DEF TEMP (QUOTE (27 27 25 24 22 23 24 24 23 18 18 17 18 19 18 18 19 19 20 20 20)))
+(DEF CONC (QUOTE (89 88 90 87 87 87 93 93 87 80 89 88 82 93 89 86 72 79 80 82 91)))
@@ -0,0 +1,35 @@
+; Section 3.1
+(def purchases (list 0 2 5 0 3 1 8 0 3 1 1 9 2 4 0 2 9 3 0 1 9 8))
+
+; Section 3.2
+(def precipitation (list .77 1.74 .81 1.20 1.95 1.20 .47 1.43 3.37 2.20 3.30 3.09 1.51 2.10 .52 1.62 1.31 .32 .59 .81 2.81 1.87 1.18 1.35 4.75 2.48 .96 1.89 .90 2.05))
+
+(def urban (list 184 196 217 284 184 236 189 206 179 170 205 190 204 330 217 242 222 242 249 241))
+(def rural (list 166 146 144 204 158 143 158 180 223 194 194 175 171 155 143 145 131 181 148 144 220 129))
+
+; Section 3.3
+(def hc '(.5 .46 .41 .44 .72 .83 .38 .60 .83 .34 .37 .87 .65 .48 .51 .47 .56 .51 .57 .36 .52 .58 .47 .65 .41 .39 .55 .64 .38 .50 .73 .57 .41 1.02 1.10 .43 .41 .41 .52 .70 .52 .51 .49 .61 .46 .55))
+(def co '(5.01 8.60 4.95 7.51 14.59 11.53 5.21 9.62 15.13 3.95 4.12 19.00 11.20 3.45 4.10 4.74 5.36 5.69 6.02 2.03 6.78 6.02 5.22 14.67 4.42 7.24 12.30 7.98 4.10 12.10 14.97 5.04 3.38 23.53 22.92 3.81 1.85 2.26 4.29 14.93 6.35 5.79 4.62 8.43 3.99 7.47))
+
+; Section 6.1
+(def iron (list 61 175 111 124 130 173 169 169 160 224 257 333 199))
+(def aluminum (list 13 21 24 23 64 38 33 61 39 71 112 88 54))
+(def absorption (list 4 18 14 18 26 26 21 30 28 36 65 62 40))
+
+(def strength (list 14.7 48.0 25.6 10.0 16.0 16.8 20.7 38.8 16.9 27.0 16.0 24.9 7.3 12.8))
+(def depth (list 8.9 36.6 36.8 6.1 6.9 6.9 7.3 8.4 6.5 8.0 4.5 9.9 2.9 2.0))
+(def water (list 31.5 27.0 25.9 39.1 39.2 38.3 33.9 33.8 27.9 33.1 26.3 37.8 34.6 36.4))
+
+; Section 6.2
+(def hardness (list 45 55 61 66 71 71 81 86 53 60 64 68 79 81 56 68 75 83 88 59 71 80 82 89 51 59 65 74 81 86))
+(def tensile-strength (list 162 233 232 231 231 237 224 219 203 189 210 210 196 180 200 173 188 161 119 161 151 165 151 128 161 146 148 144 134 127))
+(def abrasion-loss (list 372 206 175 154 136 112 55 45 221 166 164 113 82 32 228 196 128 97 64 249 219 186 155 114 341 340 284 267 215 148))
+
+(def yield (list 7.9 9.2 10.5 11.2 12.8 13.3 12.1 12.6 14.0 9.1 10.8 12.5 8.1 8.6 10.1 11.5 12.7 13.7 13.7 14.4 15.5 11.3 12.5 14.5 15.3 16.1 17.5 16.6 18.5 19.2 18.0 20.8 21 17.2 18.4 18.9 ))
+(def density (list 1 1 1 2 2 2 3 3 3 4 4 4 1 1 1 2 2 2 3 3 3 4 4 4 1 1 1 2 2 2 3 3 3 4 4 4))
+(def variety (list 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3))
+
+; Section 6.5
+(def travel-space (list 12.8 12.9 12.9 13.6 14.5 14.6 15.1 17.5 19.5 20.8))
+(def separation (list 5.5 6.2 6.3 7.0 7.8 8.3 7.1 10.0 10.8 11.0))
+
@@ -0,0 +1,10 @@
+(defun f-statistic (m1 m2)
+"
+Args: (m1 m2)
+Computes the F statistic for testing model m1 within model m2."
+ (let ((ss1 (send m1 :sum-of-squares))
+ (df1 (send m1 :df))
+ (ss2 (send m2 :sum-of-squares))
+ (df2 (send m2 :df)))
+ (/ (/ (- ss1 ss2) (- df1 df2)) (/ ss2 df2))))
+
Oops, something went wrong.

0 comments on commit ab0c5b6

Please sign in to comment.