#### St Veit-Klinglberg, Austria - Radiocarbon calibration with stratification

This example is from the book Buck CE, Cavanagh WG & Litton CD (1996) Bayesian approach to interpreting archaeological data. Wiley: Chichester p218-226
See also Buck CE, Litton CD & Shennan SJ (1994) A case study in combining radiocarbon and archaeological information: the Early Bronze Age settlement of St Veit-Klinglberg, Lan Salzburg, Austria. Germania 2 427-447. The model was set up by Andrew Millard. © Andrew Millard 2001

model{
theta[1] ~ dunif(theta[2], theta.max)
theta[2] ~ dunif(theta[3], theta[1])
theta[3] ~ dunif(theta[9], theta[2])
theta[4] ~ dunif(theta[9], theta.max)
theta[5] ~ dunif(theta[7], theta.max)
theta[6] ~ dunif(theta[7], theta.max)
theta[7] ~ dunif(theta[9], theta7max)
theta7max <- min(theta[5], theta[6])
theta[8] ~ dunif(theta[9], theta.max)
theta[9] ~ dunif(theta[10], theta9max)
theta9max <-min(min(theta[3], theta[4]), min(theta[7], theta[8]))
theta[10] ~ dunif(theta[11], theta[9])
theta[11] ~ dunif(0 ,theta[10])

bound[1] <- ranked(theta[1:8], 8)
bound[2] <- ranked(theta[1:8], 1)
bound[3] <- ranked(theta[9:11], 3)
bound[4] <- ranked(theta[9:11], 1)

for (j in 1 : 5){
theta[j + 11] ~ dunif(0, theta.max)
within[j, 1] <- 1 - step(bound[1] - theta[j + 11])
for (k in 2 : 4){
within[j, k] <- step(bound[k - 1] - theta[j + 11])
- step(bound[k] - theta[j + 11])
}
within[j, 5] <- step(bound[4] - theta[j + 11])
}

for (i in 1:nDate){
X[i] ~ dnorm(mu[i], tau[i])
tau[i] <- 1/pow(sigma[i],2)
mu[i] <- interp.lin(theta[i], calBP[], C14BP[])

# monitor the following variable to smooth density of theta
theta.smooth[i] <- 10 * round(theta[i] / 10)
}
}

##### Data 1
``` list(nDate=16, theta.max=21000,   X= c(3275, 3270, 3400, 3190, 3420, 3370, 3435, 3160, 3340, 3270, 3200, 3390, 3480, 3250, 3115, 3460),    sigma=c( 75, 80, 75, 75, 65, 75, 60, 70, 80, 75, 70, 80, 75, 75, 70, 70)) ```

##### Data 2
``` # data used here is 1993 calibration curvecalBP[] C14BP[]0 0 10 178 30 126 50 85 70 113 90 120 110 118 125 101 140 148 160 219 180 176 200 169 220 136 240 110 260 136 280 207 300 272 320 334 340 371 360 349 380 341 400 322 420 319 440 362 460 365 480 405 490 411 500 425 520 502 540 540 560 622 580 654 600 625 620 596 640 629 660 711 675 782 690 792 705 810 720 818 738 865 758 871 780 883 800 950 820 914 840 949 860 935 880 915 900 932 920 974 940 1043 960 1069 980 1105 998 1135 1010 1139 1030 1137 1050 1112 1070 1193 1090 1210 1100 1216 1120 1204 1140 1218 1160 1218 1180 1276 1200 1295 1220 1267 1240 1291 1260 1299 1280 1343 1300 1414 1320 1448 1340 1469 1360 1512 1380 1503 1400 1523 1420 1584 1440 1580 1460 1586 1480 1576 1500 1583 1520 1613 1540 1664 1560 1689 1580 1715 1600 1705 1620 1737 1640 1778 1660 1752 1680 1724 1700 1777 1720 1820 1740 1846 1760 1850 1780 1849 1800 1843 1820 1879 1840 1919 1860 1904 1880 1954 1900 1984 1920 1974 1940 2003 1960 2032 1980 2027 2000 2071 2020 2093 2040 2090 2060 2107 2080 2124 2100 2112 2120 2136 2140 2161 2160 2228 2180 2225 2200 2230 2220 2258 2240 2227 2260 2217 2280 2193 2300 2213 2320 2264 2340 2313 2360 2416 2380 2443 2400 2430 2420 2424 2440 2437 2460 2438 2480 2466 2500 2495 2520 2505 2540 2498 2560 2519 2580 2501 2600 2490 2620 2503 2640 2475 2660 2464 2680 2464 2700 2459 2720 2538 2740 2568 2760 2662 2780 2707 2800 2743 2820 2750 2840 2733 2860 2779 2880 2815 2900 2837 2920 2815 2940 2833 2960 2871 2980 2886 3000 2905 3020 2912 3040 2916 3060 2905 3070 2930 3090 2972 3100 2947 3120 2978 3140 2963 3160 2986 3180 3014 3200 2977 3220 3049 3240 3036 3260 3054 3280 3103 3300 3066 3320 3061 3340 3096 3360 3141 3380 3182 3400 3210 3420 3227 3440 3206 3460 3226 3480 3313 3500 3326 3520 3308 3540 3301 3560 3326 3580 3357 3600 3367 3620 3357 3640 3423 3660 3436 3680 3407 3700 3476 3720 3486 3740 3531 3760 3508 3780 3537 3800 3481 3820 3502 3840 3569 3860 3579 3880 3593 3900 3618 3920 3624 3940 3672 3960 3638 3980 3666 4000 3725 4020 3733 4040 3687 4060 3688 4080 3713 4100 3788 4120 3753 4140 3770 4160 3829 4180 3817 4200 3814 4220 3804 4240 3853 4260 3856 4280 3872 4300 3892 4320 3903 4340 3874 4360 3922 4380 3904 4400 3899 4420 3988 4440 4002 4460 4056 4480 4020 4500 4004 4520 4045 4540 4088 4560 4087 4580 4144 4600 4111 4620 4151 4640 4139 4660 4202 4680 4151 4700 4167 4720 4179 4740 4222 4760 4165 4780 4106 4800 4120 4820 4185 4840 4281 4860 4305 4880 4401 4900 4406 4920 4405 4940 4385 4960 4372 4980 4403 5000 4459 5020 4424 5040 4446 5060 4509 5080 4523 5100 4539 5120 4496 5140 4526 5160 4533 5180 4518 5200 4465 5220 4496 5240 4487 5260 4522 5280 4524 5300 4581 5320 4639 5340 4733 5360 4708 5380 4683 5400 4688 5420 4655 5440 4647 5460 4727 5480 4757 5500 4805 5520 4779 5540 4751 5560 4730 5580 4796 5600 4872 5620 4900 5640 4895 5660 4954 5680 4969 5700 4956 5720 4975 5740 5016 5760 5065 5780 5102 5800 5086 5820 5071 5840 5029 5860 5057 5880 5060 5900 5110 5920 5162 5940 5211 5960 5259 5980 5220 6000 5296 6020 5260 6040 5309 6060 5322 6080 5279 6100 5319 6120 5359 6140 5337 6160 5272 6180 5368 6200 5402 6220 5447 6240 5417 6260 5399 6280 5447 6300 5516 6320 5582 6340 5570 6360 5603 6380 5558 6400 5576 6420 5667 6440 5664 6460 5683 6480 5700 6500 5739 6520 5742 6540 5757 6560 5770 6580 5798 6600 5765 6620 5771 6640 5807 6660 5815 6680 5869 6700 5847 6720 5869 6740 5916 6760 5943 6780 5946 6800 5986 6820 6005 6840 5956 6860 6015 6880 6031 6900 6080 6920 6096 6940 6098 6960 6114 6980 6102 7000 6118 7020 6165 7040 6209 7060 6203 7080 6169 7100 6243 7120 6201 7140 6163 7160 6210 7180 6273 7200 6282 7220 6341 7240 6383 7260 6385 7280 6415 7300 6463 7320 6422 7340 6481 7360 6430 7380 6469 7400 6592 7420 6582 7440 6609 7450 6606 7460 6614 7470 6598 7480 6683 7490 6687 7500 6624 7510 6611 7520 6645 7530 6693 7540 6717 7550 6760 7570 6779 7590 6811 7610 6808 7630 6841 7650 6874 7670 6905 7690 6929 7710 6945 7730 6970 7750 6975 7770 6992 7790 7001 7810 7027 7830 7050 7850 7093 7870 7015 7890 7049 7910 7113 7930 7159 7950 7198 7970 7228 7990 7235 8010 7295 8030 7326 8050 7247 8060 7263 8080 7327 8100 7302 8120 7331 8140 7411 8160 7412 8180 7457 8200 7474 8220 7502 8240 7457 8260 7494 8280 7463 8300 7467 8320 7515 8340 7564 8360 7572 8380 7637 8400 7625 8420 7711 8440 7745 8460 7757 8480 7728 8500 7774 8520 7802 8540 7786 8560 7848 8580 7881 8600 7893 8620 7906 8640 7894 8660 7926 8680 7952 8700 7919 8720 7959 8740 7990 8760 7986 8780 8019 8800 7944 8820 7973 8840 7973 8860 7999 8880 7962 8900 7977 8920 7951 8940 7946 8960 8048 8980 8049 9000 8169 9020 8173 9040 8173 9060 8228 9080 8146 9100 8222 9120 8223 9140 8155 9160 8219 9180 8173 9200 8205 9220 8251 9240 8253 9260 8296 9280 8327 9300 8316 9320 8291 9340 8299 9360 8291 9380 8364 9400 8422 9420 8365 9440 8441 9460 8509 9480 8497 9500 8594 9520 8594 9540 8665 9560 8669 9580 8678 9600 8693 9620 8675 9640 8676 9660 8750 9680 8760 9700 8800 9720 8761 9740 8776 9760 8755 9780 8706 9800 8725 9820 8740 9840 8767 9930 8932 9950 8936 9970 8963 9990 9040 10010 9062 10030 9076 10050 9191 10070 9164 10090 9199 10130 9186 10150 9222 10170 9243 10190 9220 10210 9254 10230 9316 10250 9288 10270 9191 10290 9282 10310 9354 10330 9322 10350 9348 10370 9394 10390 9436 10410 9435 10430 9455 10450 9460 10470 9462 10490 9520 10510 9506 10530 9474 10550 9540 10570 9559 10590 9590 10610 9587 10630 9609 10650 9589 10670 9617 10730 9630 10750 9583 10770 9509 10790 9529 10810 9611 10850 9576 10870 9599 10890 9631 10910 9662 10930 9673 10950 9694 10970 9756 10990 9793 11010 9939 11030 9939 11050 9963 11070 9934 11090 9993 11110 10001 11130 10023 11150 10038 11170 10038 11190 9963 11210 10011 11230 10060 11250 10028 11270 10065 11310 10009 11330 10027 11350 10090 11370 10039 11390 10051 11400 10036 11450 10047 11500 10057 11550 10068 11600 10080 11650 10092 11700 10106 11750 10121 11800 10137 11850 10154 11900 10173 11950 10194 12000 10217 12050 10242 12100 10269 12150 10298 12200 10330 12250 10364 12300 10401 12350 10440 12400 10482 12450 10526 12500 10572 12550 10619 12600 10668 12650 10719 12700 10770 12750 10822 12800 10875 12850 10928 12900 10981 12950 11035 13000 11087 13050 11140 13100 11192 13150 11242 13200 11292 13250 11341 13300 11390 13350 11437 13400 11484 13450 11530 13500 11575 13550 11620 13600 11664 13650 11708 13700 11752 13750 11795 13800 11838 13850 11881 13900 11923 13950 11965 14000 12006 14050 12047 14100 12088 14150 12128 14200 12168 14250 12207 14300 12246 14350 12284 14400 12321 14450 12359 14500 12395 14550 12431 14600 12466 14650 12501 14700 12535 14750 12569 14800 12602 14850 12634 14900 12666 14950 12698 15000 12729 15050 12760 15100 12791 15150 12822 15200 12853 15250 12884 15300 12914 15350 12945 15400 12976 15450 13008 15500 13039 15550 13071 15600 13104 15650 13137 15700 13170 15750 13204 15800 13238 15850 13273 15900 13308 15950 13344 16000 13380 16050 13416 16100 13453 16150 13490 16200 13528 16250 13566 16300 13604 16350 13643 16400 13682 16450 13721 16500 13761 16550 13801 16600 13842 16650 13882 16700 13923 16750 13965 16800 14006 16850 14048 16900 14090 16950 14133 17000 14176 17050 14219 17100 14262 17150 14305 17200 14349 17250 14393 17300 14437 17350 14482 17400 14526 17450 14571 17500 14616 17550 14661 17600 14707 17650 14752 17700 14798 17750 14844 17800 14890 17850 14937 17900 14984 17950 15031 18000 15080 18050 15128 18100 15178 18150 15228 18200 15278 18250 15330 18300 15382 18350 15435 18400 15489 18450 15543 18500 15597 18550 15651 18600 15705 18650 15760 18700 15813 18750 15867 18800 15920 18850 15972 18900 16024 18950 16074 19000 16124 19050 16172 19100 16219 19150 16265 19200 16310 19250 16354 19300 16397 19350 16439 19400 16481 19450 16521 19500 16561 19550 16600 19600 16638 19650 16676 19700 16713 19750 16750 19800 16786 19850 16822 19900 16857 19950 16892 20000 16927 20050 16961 20100 16996 20150 17030 20200 17064 20250 17098 20300 17132 20350 17166 20400 17200 20450 17234 20500 17269 20550 17303 20600 17338 20650 17374 20700 17409 20750 17445 20800 17481 20850 17518 20900 17554 20950 17591 21000 17629 21050 17666 21100 17704 21150 17742 21200 17780 21250 17818 21300 17857 21350 17895 21400 17934 21450 17973 21500 18012 21550 18051 21600 18091 21650 18130 21700 18169 21750 18209 21800 18248 21850 18288 21900 18328 21950 18367 END ```
##### Inits for chain 1
``` list(theta=c(3700, 3600, 3550, 3504, 3586, 3800, 3529, 3525, 3500, 3500, 3402, 3542, 3492, 3618, 3148, 3638)) ```

##### Inits for chain 2
``` list(theta=c(3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000)) ```

Results