diff --git a/benchmark/run_benchmarks.jl b/benchmark/run_benchmarks.jl index da069495c..c6446a12a 100644 --- a/benchmark/run_benchmarks.jl +++ b/benchmark/run_benchmarks.jl @@ -28,7 +28,7 @@ end ## Stan const STAN_BUGS_EXAMPLES_FOLDER = joinpath( - dirname(@__FILE__), "stan-example-models/bugs_examples/" + dirname(@__FILE__), "stan/bugs_examples/" ) const MODEL_VOL1_STAN = OrderedDict( diff --git a/benchmark/stan-example-models b/benchmark/stan-example-models deleted file mode 160000 index 4902ad703..000000000 --- a/benchmark/stan-example-models +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4902ad703332ad0808dab7a7b94bacc1a429940d diff --git a/benchmark/stan/bugs_examples/README.txt b/benchmark/stan/bugs_examples/README.txt new file mode 100644 index 000000000..ff1792425 --- /dev/null +++ b/benchmark/stan/bugs_examples/README.txt @@ -0,0 +1,22 @@ +This folder contains WinBUGS examples in Stan. The descriptions can be found at: + http://www.mrc-bsu.cam.ac.uk/wp-content/uploads/WinBUGS_Vol1.pdf + http://www.mrc-bsu.cam.ac.uk/wp-content/uploads/WinBUGS_Vol2.pdf + http://www.mrc-bsu.cam.ac.uk/wp-content/uploads/WinBUGS_Vol3.pdf + +OpenBUGS examples: + http://www.openbugs.net/w/Examples + http://mathstat.helsinki.fi/openbugs/ExamplesFrames.html + +JAGS models and data for all these examples are in: + + http://sourceforge.net/projects/mcmc-jags/files/Examples/2.x/ + +JAGS' author has a R package for BUGS examples: + https://r-forge.r-project.org/projects/bugs-examples/ + To install the package, install.packages("BUGSExamples", repos="http://R-Forge.R-project.org") + +---- + +Above is the original README.txt file. + +This folder is copied from: https://github.com/stan-dev/example-models/tree/master/bugs_examples. diff --git a/benchmark/stan/bugs_examples/vol1/blocker/blocker.data.R b/benchmark/stan/bugs_examples/vol1/blocker/blocker.data.R new file mode 100644 index 000000000..ee6ef1198 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/blocker.data.R @@ -0,0 +1,14 @@ +"rt" <- +c(3, 7, 5, 102, 28, 4, 98, 60, 25, 138, 64, 45, 9, 57, 25, 33, +28, 8, 6, 32, 27, 22) +"nt" <- +c(38, 114, 69, 1533, 355, 59, 945, 632, 278, 1916, 873, 263, +291, 858, 154, 207, 251, 151, 174, 209, 391, 680) +"rc" <- +c(3, 14, 11, 127, 27, 6, 152, 48, 37, 188, 52, 47, 16, 45, 31, +38, 12, 6, 3, 40, 43, 39) +"nc" <- +c(39, 116, 93, 1520, 365, 52, 939, 471, 282, 1921, 583, 266, +293, 883, 147, 213, 122, 154, 134, 218, 364, 674) +"N" <- +22 diff --git a/benchmark/stan/bugs_examples/vol1/blocker/blocker.data.json b/benchmark/stan/bugs_examples/vol1/blocker/blocker.data.json new file mode 100644 index 000000000..b2bafb833 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/blocker.data.json @@ -0,0 +1,7 @@ +{ + "nc": [39, 116, 93, 1520, 365, 52, 939, 471, 282, 1921, 583, 266, 293, 883, 147, 213, 122, 154, 134, 218, 364, 674], + "rc": [3, 14, 11, 127, 27, 6, 152, 48, 37, 188, 52, 47, 16, 45, 31, 38, 12, 6, 3, 40, 43, 39], + "N": 22, + "nt": [38, 114, 69, 1533, 355, 59, 945, 632, 278, 1916, 873, 263, 291, 858, 154, 207, 251, 151, 174, 209, 391, 680], + "rt": [3, 7, 5, 102, 28, 4, 98, 60, 25, 138, 64, 45, 9, 57, 25, 33, 28, 8, 6, 32, 27, 22] +} diff --git a/benchmark/stan/bugs_examples/vol1/blocker/blocker.init.R b/benchmark/stan/bugs_examples/vol1/blocker/blocker.init.R new file mode 100644 index 000000000..266523d00 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/blocker.init.R @@ -0,0 +1,6 @@ +d <- 0 +delta <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +sigmasq_delta <- 1 +mu <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +delta <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +delta_new <- 0 diff --git a/benchmark/stan/bugs_examples/vol1/blocker/blocker.init.json b/benchmark/stan/bugs_examples/vol1/blocker/blocker.init.json new file mode 100644 index 000000000..ab70bf3ab --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/blocker.init.json @@ -0,0 +1,7 @@ +{ + "mu": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "delta": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "d": 0, + "delta_new": 0, + "sigmasq_delta": 1 +} diff --git a/benchmark/stan/bugs_examples/vol1/blocker/blocker.stan b/benchmark/stan/bugs_examples/vol1/blocker/blocker.stan new file mode 100644 index 000000000..44e6cb89d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/blocker.stan @@ -0,0 +1,29 @@ +//DOC See \url{http://www.openbugs.net/Examples/Blockers.html}. +data { + int N; + array[N] int nt; + array[N] int rt; + array[N] int nc; + array[N] int rc; +} +parameters { + real d; + real sigmasq_delta; + vector[N] mu; + vector[N] delta; + real delta_new; +} +transformed parameters { + real sigma_delta; + sigma_delta = sqrt(sigmasq_delta); +} +model { + rt ~ binomial_logit(nt, mu + delta); + rc ~ binomial_logit(nc, mu); + delta ~ student_t(4, d, sigma_delta); + mu ~ normal(0, sqrt(1E5)); + d ~ normal(0, 1E3); + sigmasq_delta ~ inv_gamma(1E-3, 1E-3); + // FIXME: sample in generated quantities in later version + delta_new ~ student_t(4, d, sigma_delta); +} diff --git a/benchmark/stan/bugs_examples/vol1/blocker/makefile b/benchmark/stan/bugs_examples/vol1/blocker/makefile new file mode 100644 index 000000000..0db46461e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = blocker# +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/blocker/post.R b/benchmark/stan/bugs_examples/vol1/blocker/post.R new file mode 100644 index 000000000..4393553b5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/blocker/post.R @@ -0,0 +1,36 @@ +## take a look at the samples and compare with results computed +## in other program. + + +library(coda) + +N <- 22; + +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); +colnames(post) <- c("d", "sigmasq_delta", + paste("mu", 1:N, sep = ''), + paste("delta", 1:N, sep = '')); + +sigma_delta <- sqrt(post[, "sigmasq_delta"]); +delta.new <- post[, "d"] + rt(nrow(post), df = 4) * sigma_delta; + +poi <- cbind(post[, "d"], delta.new, sigma_delta); +pars <- c("d", "delta.new", "sigma"); +colnames(poi) <- pars; +summary(as.mcmc(poi)) + +library(BUGSExamples) + + +# theta0 <- theta[1] - theta[2] * mean(X) +ex <- list(name = "Blockers", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3); + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) + + + + + diff --git a/benchmark/stan/bugs_examples/vol1/bones/bones.data.R b/benchmark/stan/bugs_examples/vol1/bones/bones.data.R new file mode 100644 index 000000000..6ca716819 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/bones/bones.data.R @@ -0,0 +1,51 @@ +nChild <- +13 +nInd <- +34 +gamma <- +structure(c(0.7425, 10.267, 10.5215, 9.3877, 0.2593, -0.5998, +10.5891, 6.6701, 8.8921, 12.4275, 12.4788, 13.7778, 5.8374, 6.9485, +13.7184, 14.3476, 4.8066, 9.1037, 10.7483, 0.3887, 3.2573, 11.6273, +15.8842, 14.8926, 15.5487, 15.4091, 3.9216, 15.475, 0.4927, 1.3059, +1.5012, 0.8021, 5.0022, 4.0168, -1, -1, -1, -1, -1, -1, -1, -1, +-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.0153, 7.0421, 14.4242, +17.4685, 16.7409, 16.872, 17.0061, 5.2099, 16.9406, 1.3556, 1.8793, +1.8902, 2.3873, 6.3704, 5.1537, -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, 17.4944, 2.3016, 2.497, 2.3689, 3.9525, 8.2832, 7.1053, +-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, 3.2535, 3.2306, +2.9495, 5.3198, 10.4988, 10.3038), .Dim = c(34, 4)) +delta <- +c(2.9541, 0.6603, 0.7965, 1.0495, 5.7874, 3.8376, 0.6324, 0.8272, +0.6968, 0.8747, 0.8136, 0.8246, 0.6711, 0.978, 1.1528, 1.6923, +1.0331, 0.5381, 1.0688, 8.1123, 0.9974, 1.2656, 1.1802, 1.368, +1.5435, 1.5006, 1.6766, 1.4297, 3.385, 3.3085, 3.4007, 2.0906, +1.0954, 1.5329) +ncat <- +c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, +3, 3, 3, 3, 3, 3, 3, 4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1, 1, 1, 1, 1, 1, 2, 1, 1, 1, +1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +2, 4, 2, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 3, 5, 5, 5, +5, 5, 5, 5, 5, 5, 5, 1, 1, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, +2, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 2, 3, 3, 3, 4, +5, 5, 5, 5, 1, 1, 1, 1, 3, 3, 3, 4, 4, 5, 5, 5, 5), .Dim = c(13, +34)) diff --git a/benchmark/stan/bugs_examples/vol1/bones/bones.data.R.0 b/benchmark/stan/bugs_examples/vol1/bones/bones.data.R.0 new file mode 100644 index 000000000..027b9af6e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/bones/bones.data.R.0 @@ -0,0 +1,51 @@ +nChild <- +13 +nInd <- +34 +gamma <- +structure(c(0.7425, 10.267, 10.5215, 9.3877, 0.2593, -0.5998, +10.5891, 6.6701, 8.8921, 12.4275, 12.4788, 13.7778, 5.8374, 6.9485, +13.7184, 14.3476, 4.8066, 9.1037, 10.7483, 0.3887, 3.2573, 11.6273, +15.8842, 14.8926, 15.5487, 15.4091, 3.9216, 15.475, 0.4927, 1.3059, +1.5012, 0.8021, 5.0022, 4.0168, NA, NA, NA, NA, NA, NA, NA, NA, +NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1.0153, 7.0421, 14.4242, +17.4685, 16.7409, 16.872, 17.0061, 5.2099, 16.9406, 1.3556, 1.8793, +1.8902, 2.3873, 6.3704, 5.1537, NA, NA, NA, NA, NA, NA, NA, NA, +NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, +NA, NA, NA, 17.4944, 2.3016, 2.497, 2.3689, 3.9525, 8.2832, 7.1053, +NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, +NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 3.2535, 3.2306, +2.9495, 5.3198, 10.4988, 10.3038), .Dim = c(34, 4)) +delta <- +c(2.9541, 0.6603, 0.7965, 1.0495, 5.7874, 3.8376, 0.6324, 0.8272, +0.6968, 0.8747, 0.8136, 0.8246, 0.6711, 0.978, 1.1528, 1.6923, +1.0331, 0.5381, 1.0688, 8.1123, 0.9974, 1.2656, 1.1802, 1.368, +1.5435, 1.5006, 1.6766, 1.4297, 3.385, 3.3085, 3.4007, 2.0906, +1.0954, 1.5329) +ncat <- +c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, +3, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5) +grade <- +structure(c(1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, NA, +2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, +2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, +1, 1, 1, 1, 1, 1, 2, 2, 2, NA, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, +2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, +1, 1, 1, NA, NA, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, NA, NA, 1, +1, NA, 2, NA, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NA, 2, 2, 1, 1, 1, +NA, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, +2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, NA, 2, 2, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, NA, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, +2, 2, 1, 1, 1, 1, 1, NA, NA, 2, 1, NA, 1, 2, 2, 1, 1, 1, 1, 1, +1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, +1, 1, 1, 1, 2, 2, 3, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, NA, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NA, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, NA, NA, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 2, NA, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, +1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +2, 4, 2, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 3, 5, 5, 5, +5, 5, 5, 5, 5, 5, 5, 1, 1, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, +2, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 2, 3, 3, 3, 4, +5, 5, 5, 5, 1, 1, 1, 1, 3, 3, 3, 4, 4, 5, 5, 5, 5), .Dim = c(13, +34)) diff --git a/benchmark/stan/bugs_examples/vol1/bones/bones.data.json b/benchmark/stan/bugs_examples/vol1/bones/bones.data.json new file mode 100644 index 000000000..dcc3f4e61 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/bones/bones.data.json @@ -0,0 +1,57 @@ +{ + "ncat": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5], + "nChild": 13, + "nInd": 34, +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 5, 5, 5, 5], + [2, 1, -1, 2, 2, 2, -1, 2, 2, 1, -1, -1, 2, 2, -1, -1, 2, 1, 2, 3, 3, -1, 1, -1, 1, 1, 3, 1, 5, 5, 5, 5, 5, 5], + [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 1, -1, 2, 1, 3, 2, 5, 5, 5, 5, 5, 5], + [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, -1, 2, -1, 2, 3, 4, 5, 5, 5, 5, 5, 5] + ], + "delta": [2.9541, 0.6603, 0.7965, 1.0495, 5.7874, 3.8376, 0.6324, 0.8272, 0.6968, 0.8747, 0.8136, 0.8246, 0.6711, 0.978, 1.1528, 1.6923, 1.0331, 0.5381, 1.0688, 8.1123, 0.9974, 1.2656, 1.1802, 1.368, 1.5435, 1.5006, 1.6766, 1.4297, 3.385, 3.3085, 3.4007, 2.0906, 1.0954, 1.5329], + "gamma": [ + [0.7425, -1, -1, -1], + [10.267, -1, -1, -1], + [10.5215, -1, -1, -1], + [9.3877, -1, -1, -1], + [0.2593, -1, -1, -1], + [-0.5998, -1, -1, -1], + [10.5891, -1, -1, -1], + [6.6701, -1, -1, -1], + [8.8921, -1, -1, -1], + [12.4275, -1, -1, -1], + [12.4788, -1, -1, -1], + [13.7778, -1, -1, -1], + [5.8374, -1, -1, -1], + [6.9485, -1, -1, -1], + [13.7184, -1, -1, -1], + [14.3476, -1, -1, -1], + [4.8066, -1, -1, -1], + [9.1037, -1, -1, -1], + [10.7483, -1, -1, -1], + [0.3887, 1.0153, -1, -1], + [3.2573, 7.0421, -1, -1], + [11.6273, 14.4242, -1, -1], + [15.8842, 17.4685, -1, -1], + [14.8926, 16.7409, -1, -1], + [15.5487, 16.872, -1, -1], + [15.4091, 17.0061, -1, -1], + [3.9216, 5.2099, -1, -1], + [15.475, 16.9406, 17.4944, -1], + [0.4927, 1.3556, 2.3016, 3.2535], + [1.3059, 1.8793, 2.497, 3.2306], + [1.5012, 1.8902, 2.3689, 2.9495], + [0.8021, 2.3873, 3.9525, 5.3198], + [5.0022, 6.3704, 8.2832, 10.4988], + [4.0168, 5.1537, 7.1053, 10.3038] + ] +} diff --git a/benchmark/stan/bugs_examples/vol1/bones/bones.stan b/benchmark/stan/bugs_examples/vol1/bones/bones.stan new file mode 100644 index 000000000..50d1645f7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/bones/bones.stan @@ -0,0 +1,57 @@ +/** + * Bones: latent trait model for multiple ordered + * categorical responses + * http://www.openbugs.net/Examples/Bones.html + * + * + * Note: + * 1. Since it is just the response that is + * modelled as categorical distribution, + * we should be able to run the model now except handling + * the missing. However, the data structure is a bit + * difficult to deal with (Allowing some redundancy + * in the transformed parameters (Q here), the model + * is fine in Stan. + * 2. The missing data is recoded as `-1`, which is + * not modeled for `gamma` as in the OpenBUGS example + * and not modeled for `grade`. + */ + +data { + int nChild; + int nInd; + array[nInd, 4] real gamma; // -1 if missing + array[nInd] real delta; + array[nInd] int ncat; + array[nChild, nInd] int grade; // -1 if missing +} +parameters { + array[nChild] real theta; +} +model { + array[nChild, nInd, 5] real p; + array[nChild, nInd, 4] real Q; + theta ~ normal(0.0, 36); + for (i in 1 : nChild) { + // Probability of observing grade k given theta + for (j in 1 : nInd) { + // Cumulative probability of > grade k given theta + for (k in 1 : (ncat[j] - 1)) { + Q[i, j, k] = inv_logit(delta[j] * (theta[i] - gamma[j, k])); + } + p[i, j, 1] = 1 - Q[i, j, 1]; + for (k in 2 : (ncat[j] - 1)) { + p[i, j, k] = Q[i, j, k - 1] - Q[i, j, k]; + } + p[i, j, ncat[j]] = Q[i, j, ncat[j] - 1]; + + // incement log probability directly because grade[i, j] + // has categorical distribution with varying dimension. + // for missing grade[i, j] = -1, there is no log prob + // contribution + if (grade[i, j] != -1) { + target += log(p[i, j, grade[i, j]]); + } + } + } +} diff --git a/benchmark/stan/bugs_examples/vol1/bones/makefile b/benchmark/stan/bugs_examples/vol1/bones/makefile new file mode 100644 index 000000000..b21f9dacb --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/bones/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = bones# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -Wall $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/bones/post.R b/benchmark/stan/bugs_examples/vol1/bones/post.R new file mode 100644 index 000000000..e901bff3e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/bones/post.R @@ -0,0 +1,16 @@ + +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +theta_idx <- grep("theta.[:digits:]*", colnames(post)) +summary(as.mcmc(post[, theta_idx])) + +pars <- c('theta') +library(BUGSExamples); +ex <- list(name = "Bones", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +plot(jagspost$coda); diff --git a/benchmark/stan/bugs_examples/vol1/dogs/dogs.data.R b/benchmark/stan/bugs_examples/vol1/dogs/dogs.data.R new file mode 100644 index 000000000..edb0384d2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/dogs.data.R @@ -0,0 +1,42 @@ +Ndogs <- +30 +Ntrials <- +25 +Y <- +structure(c(0, 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 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), .Dim = c(30, +25)) diff --git a/benchmark/stan/bugs_examples/vol1/dogs/dogs.data.json b/benchmark/stan/bugs_examples/vol1/dogs/dogs.data.json new file mode 100644 index 000000000..0577d180f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/dogs.data.json @@ -0,0 +1,36 @@ +{ + "Ndogs": 30, + "Y": [ + [0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1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], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] + ], + "Ntrials": 25 +} diff --git a/benchmark/stan/bugs_examples/vol1/dogs/dogs.init.R b/benchmark/stan/bugs_examples/vol1/dogs/dogs.init.R new file mode 100644 index 000000000..61f4d2f7e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/dogs.init.R @@ -0,0 +1,2 @@ +alpha <- -1 +beta <- -1 diff --git a/benchmark/stan/bugs_examples/vol1/dogs/dogs.init.json b/benchmark/stan/bugs_examples/vol1/dogs/dogs.init.json new file mode 100644 index 000000000..00bcff3b2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/dogs.init.json @@ -0,0 +1,4 @@ +{ + "alpha": -1, + "beta": -1 +} diff --git a/benchmark/stan/bugs_examples/vol1/dogs/dogs.stan b/benchmark/stan/bugs_examples/vol1/dogs/dogs.stan new file mode 100644 index 000000000..0005da508 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/dogs.stan @@ -0,0 +1,47 @@ +// compared with JAGS version in +// the R package BUGSExamples (https://r-forge.r-project.org/R/?group_id=882) +data { + int Ndogs; + int Ntrials; + array[Ndogs, Ntrials] int Y; +} +transformed data { + array[Ndogs, Ntrials] int y; + array[Ndogs, Ntrials] int xa; + array[Ndogs, Ntrials] int xs; + for (dog in 1 : Ndogs) { + xa[dog, 1] = 0; + xs[dog, 1] = 0; + for (trial in 2 : Ntrials) { + for (k in 1 : (trial - 1)) { + xa[dog, trial] = xa[dog, trial] + Y[dog, k]; + } + xs[dog, trial] = trial - 1 - xa[dog, trial]; + } + } + for (dog in 1 : Ndogs) { + for (trial in 1 : Ntrials) { + y[dog, trial] = 1 - Y[dog, trial]; + } + } +} +parameters { + real alpha; + real beta; +} +model { + alpha ~ normal(0.0, 316.2); + beta ~ normal(0.0, 316.2); + for (dog in 1 : Ndogs) { + for (trial in 2 : Ntrials) { + y[dog, trial] ~ bernoulli(exp(alpha * xa[dog, trial] + + beta * xs[dog, trial])); + } + } +} +generated quantities { + real A; + real B; + A = exp(alpha); + B = exp(beta); +} diff --git a/benchmark/stan/bugs_examples/vol1/dogs/makefile b/benchmark/stan/bugs_examples/vol1/dogs/makefile new file mode 100644 index 000000000..c6b9f1b00 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = dogs# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -Wall -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) id=4 data=$(PGM).data.R method=sample num_warmup=1000 num_samples=1000 random seed=1340384924 output sample=samples.csv + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/dogs/post.R b/benchmark/stan/bugs_examples/vol1/dogs/post.R new file mode 100644 index 000000000..d9e1b49bb --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dogs/post.R @@ -0,0 +1,23 @@ + +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#')[, -(1:4)] +summary(as.mcmc(post)) +plot(as.mcmc(post)) + +# run in JAGS, BUGSExamples is needed. +# BUGSExamples package is installed by +# install.packages("BUGSExamples", repos = "http://R-Forge.R-project.org") + +if (!is.element("BUGSExamples", installed.packages()[, 1])) { + cat("Package BUGSExamples is not installed. It is used to get", + "the results from JAGS.", sep = '\n') + quit(); +} +library(BUGSExamples) + +ex <- list(name = "Dogs", parameters = c("alpha", "beta"), + nSample = 2000, nBurnin = 500, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) diff --git a/benchmark/stan/bugs_examples/vol1/dyes/dyes.data.R b/benchmark/stan/bugs_examples/vol1/dyes/dyes.data.R new file mode 100644 index 000000000..4c6d11f58 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/dyes.data.R @@ -0,0 +1,8 @@ +BATCHES <- +6 +SAMPLES <- +5 +y <- +structure(c(1545, 1540, 1595, 1445, 1595, 1520, 1440, 1555, 1550, +1440, 1630, 1455, 1440, 1490, 1605, 1595, 1515, 1450, 1520, 1560, +1510, 1465, 1635, 1480, 1580, 1495, 1560, 1545, 1625, 1445), .Dim = c(6, 5)) diff --git a/benchmark/stan/bugs_examples/vol1/dyes/dyes.data.json b/benchmark/stan/bugs_examples/vol1/dyes/dyes.data.json new file mode 100644 index 000000000..f13c95744 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/dyes.data.json @@ -0,0 +1,12 @@ +{ + "y": [ + [1545, 1440, 1440, 1520, 1580], + [1540, 1555, 1490, 1560, 1495], + [1595, 1550, 1605, 1510, 1560], + [1445, 1440, 1595, 1465, 1545], + [1595, 1630, 1515, 1635, 1625], + [1520, 1455, 1450, 1480, 1445] + ], + "BATCHES": 6, + "SAMPLES": 5 +} diff --git a/benchmark/stan/bugs_examples/vol1/dyes/dyes.init.R b/benchmark/stan/bugs_examples/vol1/dyes/dyes.init.R new file mode 100644 index 000000000..fc6f0624e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/dyes.init.R @@ -0,0 +1,4 @@ +theta <- 1500 +tau_within <- 1 +tau_between <- 1 +mu <- c(1500, 1500, 1500, 1500, 1500, 1500) \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/dyes/dyes.init.json b/benchmark/stan/bugs_examples/vol1/dyes/dyes.init.json new file mode 100644 index 000000000..044a4b8f1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/dyes.init.json @@ -0,0 +1,6 @@ +{ + "theta": 1500, + "mu": [1500, 1500, 1500, 1500, 1500, 1500], + "tau_between": 1, + "tau_within": 1 +} diff --git a/benchmark/stan/bugs_examples/vol1/dyes/dyes.stan b/benchmark/stan/bugs_examples/vol1/dyes/dyes.stan new file mode 100644 index 000000000..df5b3c3ce --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/dyes.stan @@ -0,0 +1,38 @@ +// Dyes: variance components model +// http://www.openbugs.net/Examples/Dyes.html + +data { + int BATCHES; + int SAMPLES; + array[BATCHES, SAMPLES] real y; + // vector[SAMPLES] y[BATCHES]; +} +parameters { + real tau_between; + real tau_within; + real theta; + array[BATCHES] real mu; +} +transformed parameters { + real sigma_between; + real sigma_within; + sigma_between = 1 / sqrt(tau_between); + sigma_within = 1 / sqrt(tau_within); +} +model { + theta ~ normal(0.0, 1E5); + tau_between ~ gamma(.001, .001); + tau_within ~ gamma(.001, .001); + + mu ~ normal(theta, sigma_between); + for (n in 1 : BATCHES) { + y[n] ~ normal(mu[n], sigma_within); + } +} +generated quantities { + real sigmasq_between; + real sigmasq_within; + + sigmasq_between = 1 / tau_between; + sigmasq_within = 1 / tau_within; +} diff --git a/benchmark/stan/bugs_examples/vol1/dyes/makefile b/benchmark/stan/bugs_examples/vol1/dyes/makefile new file mode 100644 index 000000000..2ecbb59af --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = dyes# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/dyes/post.R b/benchmark/stan/bugs_examples/vol1/dyes/post.R new file mode 100644 index 000000000..a8a52f413 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/dyes/post.R @@ -0,0 +1,11 @@ +library(coda) +library(BUGSExamples) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#')[,-(1:3)] +summary(as.mcmc(post)) + +ex <- list(name = "Dyes", parameters = c("theta", "sigma2.with", "sigma2.btw"), + nSample = 2000, nBurnin = 500, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) diff --git a/benchmark/stan/bugs_examples/vol1/epil/epil.data.R b/benchmark/stan/bugs_examples/vol1/epil/epil.data.R new file mode 100644 index 000000000..55f8ecd6f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/epil/epil.data.R @@ -0,0 +1,89 @@ +Age <- +c(31, 30, 25, 36, 22, 29, 31, 42, 37, 28, 36, 24, 23, 36, 26, +26, 28, 31, 32, 21, 29, 21, 32, 25, 30, 40, 19, 22, 18, 32, 20, +30, 18, 24, 30, 35, 27, 20, 22, 28, 23, 40, 33, 21, 35, 25, 26, +25, 22, 32, 25, 35, 21, 41, 32, 26, 21, 36, 37) +Base <- +c(11, 11, 6, 8, 66, 27, 12, 52, 23, 10, 52, 33, 18, 42, 87, 50, +18, 111, 18, 20, 12, 9, 17, 28, 55, 9, 10, 47, 76, 38, 19, 10, +19, 24, 31, 14, 11, 67, 41, 7, 22, 13, 46, 36, 38, 7, 36, 11, +151, 22, 41, 32, 56, 24, 16, 22, 25, 13, 12) +BT <- +c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 2.94443897916644, 2.2512917986065, 1.55814461804655, +0.916290731874155, 1.55814461804655, 1.79175946922805, 2.04769284336526, +1.25276296849537, 1.01160091167848, 2.81839825827108, 2.32727770558442, +0.559615787935423, 1.70474809223843, 1.17865499634165, 2.4423470353692, +2.19722457733622, 2.2512917986065, 0.559615787935423, 2.19722457733622, +1.01160091167848, 3.63098547569503, 1.70474809223843, 2.32727770558442, +2.07944154167984, 2.63905732961526, 1.79175946922805, 1.38629436111989, +1.70474809223843, 1.83258146374831, 1.17865499634165, 1.09861228866811 +) +BT_bar <- +0.948377750564369 +log_Age <- +c(3.43398720448515, 3.40119738166216, 3.2188758248682, 3.58351893845611, +3.09104245335832, 3.36729582998647, 3.43398720448515, 3.73766961828337, +3.61091791264422, 3.3322045101752, 3.58351893845611, 3.17805383034795, +3.13549421592915, 3.58351893845611, 3.25809653802148, 3.25809653802148, +3.3322045101752, 3.43398720448515, 3.46573590279973, 3.04452243772342, +3.36729582998647, 3.04452243772342, 3.46573590279973, 3.2188758248682, +3.40119738166216, 3.68887945411394, 2.94443897916644, 3.09104245335832, +2.89037175789616, 3.46573590279973, 2.99573227355399, 3.40119738166216, +2.89037175789616, 3.17805383034795, 3.40119738166216, 3.55534806148941, +3.29583686600433, 2.99573227355399, 3.09104245335832, 3.3322045101752, +3.13549421592915, 3.68887945411394, 3.49650756146648, 3.04452243772342, +3.55534806148941, 3.2188758248682, 3.25809653802148, 3.2188758248682, +3.09104245335832, 3.46573590279973, 3.2188758248682, 3.55534806148941, +3.04452243772342, 3.71357206670431, 3.46573590279973, 3.25809653802148, +3.04452243772342, 3.58351893845611, 3.61091791264422) +log_Age_bar <- +3.31978350918588 +log_Base4 <- +c(1.01160091167848, 1.01160091167848, 0.405465108108164, 0.693147180559945, +2.80336038090653, 1.90954250488444, 1.09861228866811, 2.56494935746154, +1.74919985480926, 0.916290731874155, 2.56494935746154, 2.11021320034659, +1.50407739677627, 2.35137525716348, 3.07961375753469, 2.52572864430826, +1.50407739677627, 3.32323584019244, 1.50407739677627, 1.6094379124341, +1.09861228866811, 0.810930216216329, 1.44691898293633, 1.94591014905531, +2.62103882411258, 0.810930216216329, 0.916290731874155, 2.46385324059017, +2.94443897916644, 2.2512917986065, 1.55814461804655, 0.916290731874155, +1.55814461804655, 1.79175946922805, 2.04769284336526, 1.25276296849537, +1.01160091167848, 2.81839825827108, 2.32727770558442, 0.559615787935423, +1.70474809223843, 1.17865499634165, 2.4423470353692, 2.19722457733622, +2.2512917986065, 0.559615787935423, 2.19722457733622, 1.01160091167848, +3.63098547569503, 1.70474809223843, 2.32727770558442, 2.07944154167984, +2.63905732961526, 1.79175946922805, 1.38629436111989, 1.70474809223843, +1.83258146374831, 1.17865499634165, 1.09861228866811) +log_Base4_bar <- +1.76795470039604 +N <- +59 +T <- +4 +Trt <- +c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 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) +Trt_bar <- +0.525423728813559 +V4 <- +c(0, 0, 0, 1) +V4_bar <- +0.25 +Visit <- +c(-3, -1, 1, 3) +y <- +structure(c(5, 3, 2, 4, 7, 5, 6, 40, 5, 14, 26, 12, 4, 7, 16, +11, 0, 37, 3, 3, 3, 3, 2, 8, 18, 2, 3, 13, 11, 8, 0, 3, 2, 4, +22, 5, 2, 3, 4, 2, 0, 5, 11, 10, 19, 1, 6, 2, 102, 4, 8, 1, 18, +6, 3, 1, 2, 0, 1, 3, 5, 4, 4, 18, 2, 4, 20, 6, 13, 12, 6, 4, +9, 24, 0, 0, 29, 5, 0, 4, 4, 3, 12, 24, 1, 1, 15, 14, 7, 4, 6, +6, 3, 17, 4, 4, 7, 18, 1, 2, 4, 14, 5, 7, 1, 10, 1, 65, 3, 6, +3, 11, 3, 5, 23, 3, 0, 4, 3, 3, 0, 1, 9, 8, 0, 21, 6, 6, 6, 8, +6, 12, 10, 0, 3, 28, 2, 6, 3, 3, 3, 2, 76, 2, 4, 13, 9, 9, 3, +1, 7, 1, 19, 7, 0, 7, 2, 1, 4, 0, 25, 3, 6, 2, 8, 0, 72, 2, 5, +1, 28, 4, 4, 19, 0, 0, 3, 3, 3, 5, 4, 21, 7, 2, 12, 5, 0, 22, +4, 2, 14, 9, 5, 3, 29, 5, 7, 4, 4, 5, 8, 25, 1, 2, 12, 8, 4, +0, 3, 4, 3, 16, 4, 4, 7, 5, 0, 0, 3, 15, 8, 7, 3, 8, 0, 63, 4, +7, 5, 13, 0, 3, 8, 1, 0, 2), .Dim = c(59, 4)) diff --git a/benchmark/stan/bugs_examples/vol1/epil/epil.data.json b/benchmark/stan/bugs_examples/vol1/epil/epil.data.json new file mode 100644 index 000000000..c41a0d393 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/epil/epil.data.json @@ -0,0 +1,78 @@ +{ + "Age": [31, 30, 25, 36, 22, 29, 31, 42, 37, 28, 36, 24, 23, 36, 26, 26, 28, 31, 32, 21, 29, 21, 32, 25, 30, 40, 19, 22, 18, 32, 20, 30, 18, 24, 30, 35, 27, 20, 22, 28, 23, 40, 33, 21, 35, 25, 26, 25, 22, 32, 25, 35, 21, 41, 32, 26, 21, 36, 37], + "Base": [11, 11, 6, 8, 66, 27, 12, 52, 23, 10, 52, 33, 18, 42, 87, 50, 18, 111, 18, 20, 12, 9, 17, 28, 55, 9, 10, 47, 76, 38, 19, 10, 19, 24, 31, 14, 11, 67, 41, 7, 22, 13, 46, 36, 38, 7, 36, 11, 151, 22, 41, 32, 56, 24, 16, 22, 25, 13, 12], + "y": [ + [5, 3, 3, 3], + [3, 5, 3, 3], + [2, 4, 0, 5], + [4, 4, 1, 4], + [7, 18, 9, 21], + [5, 2, 8, 7], + [6, 4, 0, 2], + [40, 20, 21, 12], + [5, 6, 6, 5], + [14, 13, 6, 0], + [26, 12, 6, 22], + [12, 6, 8, 4], + [4, 4, 6, 2], + [7, 9, 12, 14], + [16, 24, 10, 9], + [11, 0, 0, 5], + [0, 0, 3, 3], + [37, 29, 28, 29], + [3, 5, 2, 5], + [3, 0, 6, 7], + [3, 4, 3, 4], + [3, 4, 3, 4], + [2, 3, 3, 5], + [8, 12, 2, 8], + [18, 24, 76, 25], + [2, 1, 2, 1], + [3, 1, 4, 2], + [13, 15, 13, 12], + [11, 14, 9, 8], + [8, 7, 9, 4], + [0, 4, 3, 0], + [3, 6, 1, 3], + [2, 6, 7, 4], + [4, 3, 1, 3], + [22, 17, 19, 16], + [5, 4, 7, 4], + [2, 4, 0, 4], + [3, 7, 7, 7], + [4, 18, 2, 5], + [2, 1, 1, 0], + [0, 2, 4, 0], + [5, 4, 0, 3], + [11, 14, 25, 15], + [10, 5, 3, 8], + [19, 7, 6, 7], + [1, 1, 2, 3], + [6, 10, 8, 8], + [2, 1, 0, 0], + [102, 65, 72, 63], + [4, 3, 2, 4], + [8, 6, 5, 7], + [1, 3, 1, 5], + [18, 11, 28, 13], + [6, 3, 4, 0], + [3, 5, 4, 3], + [1, 23, 19, 8], + [2, 3, 0, 1], + [0, 0, 0, 0], + [1, 4, 3, 2] + ], + "V4": [0, 0, 0, 1], + "BT_bar": 0.948377750564369, + "BT": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.94443897916644, 2.2512917986065, 1.55814461804655, 0.916290731874155, 1.55814461804655, 1.79175946922805, 2.04769284336526, 1.25276296849537, 1.01160091167848, 2.81839825827108, 2.32727770558442, 0.559615787935423, 1.70474809223843, 1.17865499634165, 2.4423470353692, 2.19722457733622, 2.2512917986065, 0.559615787935423, 2.19722457733622, 1.01160091167848, 3.63098547569503, 1.70474809223843, 2.32727770558442, 2.07944154167984, 2.63905732961526, 1.79175946922805, 1.38629436111989, 1.70474809223843, 1.83258146374831, 1.17865499634165, 1.09861228866811], + "Trt_bar": 0.525423728813559, + "Trt": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], + "log_Base4": [1.01160091167848, 1.01160091167848, 0.405465108108164, 0.693147180559945, 2.80336038090653, 1.90954250488444, 1.09861228866811, 2.56494935746154, 1.74919985480926, 0.916290731874155, 2.56494935746154, 2.11021320034659, 1.50407739677627, 2.35137525716348, 3.07961375753469, 2.52572864430826, 1.50407739677627, 3.32323584019244, 1.50407739677627, 1.6094379124341, 1.09861228866811, 0.810930216216329, 1.44691898293633, 1.94591014905531, 2.62103882411258, 0.810930216216329, 0.916290731874155, 2.46385324059017, 2.94443897916644, 2.2512917986065, 1.55814461804655, 0.916290731874155, 1.55814461804655, 1.79175946922805, 2.04769284336526, 1.25276296849537, 1.01160091167848, 2.81839825827108, 2.32727770558442, 0.559615787935423, 1.70474809223843, 1.17865499634165, 2.4423470353692, 2.19722457733622, 2.2512917986065, 0.559615787935423, 2.19722457733622, 1.01160091167848, 3.63098547569503, 1.70474809223843, 2.32727770558442, 2.07944154167984, 2.63905732961526, 1.79175946922805, 1.38629436111989, 1.70474809223843, 1.83258146374831, 1.17865499634165, 1.09861228866811], + "log_Age": [3.43398720448515, 3.40119738166216, 3.2188758248682, 3.58351893845611, 3.09104245335832, 3.36729582998647, 3.43398720448515, 3.73766961828337, 3.61091791264422, 3.3322045101752, 3.58351893845611, 3.17805383034795, 3.13549421592915, 3.58351893845611, 3.25809653802148, 3.25809653802148, 3.3322045101752, 3.43398720448515, 3.46573590279973, 3.04452243772342, 3.36729582998647, 3.04452243772342, 3.46573590279973, 3.2188758248682, 3.40119738166216, 3.68887945411394, 2.94443897916644, 3.09104245335832, 2.89037175789616, 3.46573590279973, 2.99573227355399, 3.40119738166216, 2.89037175789616, 3.17805383034795, 3.40119738166216, 3.55534806148941, 3.29583686600433, 2.99573227355399, 3.09104245335832, 3.3322045101752, 3.13549421592915, 3.68887945411394, 3.49650756146648, 3.04452243772342, 3.55534806148941, 3.2188758248682, 3.25809653802148, 3.2188758248682, 3.09104245335832, 3.46573590279973, 3.2188758248682, 3.55534806148941, 3.04452243772342, 3.71357206670431, 3.46573590279973, 3.25809653802148, 3.04452243772342, 3.58351893845611, 3.61091791264422], + "V4_bar": 0.25, + "Visit": [-3, -1, 1, 3], + "log_Age_bar": 3.31978350918588, + "N": 59, + "T": 4, + "log_Base4_bar": 1.76795470039604 +} diff --git a/benchmark/stan/bugs_examples/vol1/epil/epil.stan b/benchmark/stan/bugs_examples/vol1/epil/epil.stan new file mode 100644 index 000000000..09fb8db20 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/epil/epil.stan @@ -0,0 +1,78 @@ +// corresponding to JAGS example +// in R package BUGSExamples +// [install.packages("BUGSExamples", repos="http://R-Forge.R-project.org")] +// + +data { + int N; + int T; + array[N, T] int y; + array[N] int Trt; + array[T] int V4; + vector[N] log_Base4; + vector[N] log_Age; + vector[N] BT; + real log_Age_bar; + real Trt_bar; + real BT_bar; + real V4_bar; + real log_Base4_bar; +} +transformed data { + vector[T] V4_c; + vector[N] log_Base4_c; + vector[N] log_Age_c; + vector[N] BT_c; + vector[N] Trt_c; + log_Base4_c = log_Base4 - log_Base4_bar; + log_Age_c = log_Age - log_Age_bar; + BT_c = BT - BT_bar; + for (i in 1 : T) { + V4_c[i] = V4[i] - V4_bar; + } + for (i in 1 : N) { + Trt_c[i] = Trt[i] - Trt_bar; + } +} +parameters { + real a0; + real alpha_Base; + real alpha_Trt; + real alpha_BT; + real alpha_Age; + real alpha_V4; + array[N] real b1; + array[N] vector[T] b; + real sigmasq_b; + real sigmasq_b1; +} +transformed parameters { + real sigma_b; + real sigma_b1; + sigma_b = sqrt(sigmasq_b); + sigma_b1 = sqrt(sigmasq_b1); +} +model { + a0 ~ normal(0, 100); + alpha_Base ~ normal(0, 100); + alpha_Trt ~ normal(0, 100); + alpha_BT ~ normal(0, 100); + alpha_Age ~ normal(0, 100); + alpha_V4 ~ normal(0, 100); + sigmasq_b1 ~ inv_gamma(.001, .001); + sigmasq_b ~ inv_gamma(.001, .001); + b1 ~ normal(0, sigma_b1); + for (n in 1 : N) { + b[n] ~ normal(0, sigma_b); + y[n] ~ poisson_log(a0 + alpha_Base * log_Base4_c[n] + + alpha_Trt * Trt_c[n] + alpha_BT * BT_c[n] + + alpha_Age * log_Age_c[n] + b1[n] + alpha_V4 * V4_c + + b[n]); + } +} +generated quantities { + real alpha0; + // re-calculate intercept on original scale: + alpha0 = a0 - alpha_Base * log_Base4_bar - alpha_Trt * Trt_bar + - alpha_BT * BT_bar - alpha_Age * log_Age_bar - alpha_V4 * V4_bar; +} diff --git a/benchmark/stan/bugs_examples/vol1/epil/post.R b/benchmark/stan/bugs_examples/vol1/epil/post.R new file mode 100644 index 000000000..d6933b24c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/epil/post.R @@ -0,0 +1,20 @@ + +library(coda) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') + +pars <- c("alpha_Age", "alpha_BT", "alpha_Base", "alpha_Trt", "alpha_V4", "alpha0", "sigma_b", "sigma_b1"); + +poi <- post[, pars] +summary(as.mcmc(poi)) + + +library(BUGSExamples); +pars2 <- c("alpha.Age", "alpha.BT", "alpha.Base", "alpha.Trt", "alpha.V4", "alpha0", "sigma.b", "sigma.b1"); +ex <- list(name = "Epil", parameters = pars2, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda); + + diff --git a/benchmark/stan/bugs_examples/vol1/equiv/equiv.data.R b/benchmark/stan/bugs_examples/vol1/equiv/equiv.data.R new file mode 100644 index 000000000..39db66ae0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/equiv.data.R @@ -0,0 +1,12 @@ +N <- +10 +P <- +2 +group <- +c(1, 1, -1, -1, -1, 1, 1, 1, -1, -1) +Y <- +structure(c(1.4, 1.64, 1.44, 1.36, 1.65, 1.08, 1.09, 1.25, 1.25, +1.3, 1.65, 1.57, 1.58, 1.68, 1.69, 1.31, 1.43, 1.44, 1.39, 1.52 +), .Dim = c(10, 2)) +sign <- +c(1, -1) diff --git a/benchmark/stan/bugs_examples/vol1/equiv/equiv.data.json b/benchmark/stan/bugs_examples/vol1/equiv/equiv.data.json new file mode 100644 index 000000000..e5f02d6ac --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/equiv.data.json @@ -0,0 +1,18 @@ +{ + "Y": [ + [1.4, 1.65], + [1.64, 1.57], + [1.44, 1.58], + [1.36, 1.68], + [1.65, 1.69], + [1.08, 1.31], + [1.09, 1.43], + [1.25, 1.44], + [1.25, 1.39], + [1.3, 1.52] + ], + "sign": [1, -1], + "group": [1, 1, -1, -1, -1, 1, 1, 1, -1, -1], + "N": 10, + "P": 2 +} diff --git a/benchmark/stan/bugs_examples/vol1/equiv/equiv.init.R b/benchmark/stan/bugs_examples/vol1/equiv/equiv.init.R new file mode 100644 index 000000000..c2b836e90 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/equiv.init.R @@ -0,0 +1,6 @@ +mu <- 0 +phi <- 0 +pi <- 0 +sigmasq1 <- 1 +sigmasq2 <- 1 +delta <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0) \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/equiv/equiv.init.json b/benchmark/stan/bugs_examples/vol1/equiv/equiv.init.json new file mode 100644 index 000000000..ab57a3d7b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/equiv.init.json @@ -0,0 +1,8 @@ +{ + "mu": 0, + "delta": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "pi": 0, + "phi": 0, + "sigmasq1": 1, + "sigmasq2": 1 +} diff --git a/benchmark/stan/bugs_examples/vol1/equiv/equiv.stan b/benchmark/stan/bugs_examples/vol1/equiv/equiv.stan new file mode 100755 index 000000000..0ba363c11 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/equiv.stan @@ -0,0 +1,54 @@ +// Equiv: bioequivalence in a cross-over trial +// http://www.openbugs.net/Examples/Equiv.html + +data { + int P; + int N; + array[N] int group; + array[N, P] real Y; + array[2] int sign; +} +transformed data { + array[N, P] int T; + for (n in 1 : N) { + for (p in 1 : P) { + T[n, p] = (group[n] * (2 * p - 3) + 3) %/% 2; + } + } +} +parameters { + real mu; + real phi; + real pi; + real sigmasq1; + real sigmasq2; + array[N] real delta; +} +transformed parameters { + real sigma1; + real sigma2; + sigma1 = sqrt(sigmasq1); + sigma2 = sqrt(sigmasq2); +} +model { + for (n in 1 : N) { + vector[P] m; + for (p in 1 : P) { + m[p] = mu + sign[T[n, p]] * phi / 2 + sign[p] * pi / 2 + delta[n]; + } + Y[n] ~ normal(m, sigma1); + } + delta ~ normal(0, sigma2); + sigmasq1 ~ inv_gamma(.001, .001); + sigmasq2 ~ inv_gamma(.001, .001); + mu ~ normal(0.0, 1000); + phi ~ normal(0.0, 1000); + pi ~ normal(0.0, 1000); +} +generated quantities { + real equiv; + real theta; + + theta = exp(phi); + equiv = step(theta - 0.8) - step(theta - 1.2); +} diff --git a/benchmark/stan/bugs_examples/vol1/equiv/makefile b/benchmark/stan/bugs_examples/vol1/equiv/makefile new file mode 100644 index 000000000..9e8e5cc97 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = equiv# +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample num_warmup=1000 num_samples=10000 random seed=1340384924 + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/equiv/post.R b/benchmark/stan/bugs_examples/vol1/equiv/post.R new file mode 100644 index 000000000..7b35df87d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/equiv/post.R @@ -0,0 +1,32 @@ +## take a look at the samples and compare with results computed +## in other program. + +library(coda) + +N <- 10; +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#') + +mystep <- function(x) ifelse(x >= 0, 1, 0) +theta <- exp(post[, "phi"]) +equiv <- mystep(theta - 0.8) - mystep(theta - 1.2) + +summary(as.mcmc(post[, "phi"])) + +poi <- cbind(equiv, post[, c("mu", "phi", "pi", "sigma1", "sigma2")], theta) +pars <- c("equiv", "mu", "phi", "pi", "sigma1", "sigma2", "theta") +colnames(poi) <- pars +summary(as.mcmc(poi)) +plot(as.mcmc(poi)) + + +## run jags + +library(BUGSExamples) + +ex <- list(name = "Equiv", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +plot(jagspost$coda); diff --git a/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.data.R b/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.data.R new file mode 100644 index 000000000..caa2df86b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.data.R @@ -0,0 +1,25 @@ +N <- +286 +T <- +2 +G <- +2 +Npattern <- +16 +Ncut <- +3 +pattern <- +structure(c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 1, +2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4), .Dim = c(16, 2 +)) +Ncum <- +structure(c(59, 157, 173, 175, 186, 253, 270, 271, 271, 278, +280, 281, 282, 285, 285, 286, 122, 170, 173, 175, 226, 268, 270, +271, 278, 280, 281, 281, 284, 285, 286, 286), .Dim = c(16, 2 +)) +treat <- +structure(c(1, -1, -1, 1), .Dim = c(2, 2)) +period <- +structure(c(1, 1, -1, -1), .Dim = c(2, 2)) +carry <- +structure(c(0, 0, -1, 1), .Dim = c(2, 2)) diff --git a/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.data.json b/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.data.json new file mode 100644 index 000000000..1cf5dee28 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.data.json @@ -0,0 +1,55 @@ +{ + "period": [ + [1, -1], + [1, -1] + ], + "Ncum": [ + [59, 122], + [157, 170], + [173, 173], + [175, 175], + [186, 226], + [253, 268], + [270, 270], + [271, 271], + [271, 278], + [278, 280], + [280, 281], + [281, 281], + [282, 284], + [285, 285], + [285, 286], + [286, 286] + ], + "pattern": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4], + [2, 1], + [2, 2], + [2, 3], + [2, 4], + [3, 1], + [3, 2], + [3, 3], + [3, 4], + [4, 1], + [4, 2], + [4, 3], + [4, 4] + ], + "carry": [ + [0, -1], + [0, 1] + ], + "Ncut": 3, + "G": 2, + "Npattern": 16, + "treat": [ + [1, -1], + [-1, 1] + ], + "N": 286, + "T": 2 +} diff --git a/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.stan b/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.stan new file mode 100644 index 000000000..3a8574208 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/inhalers/inhalers.stan @@ -0,0 +1,108 @@ +// Inhaler: ordered categorical data +//# http://www.openbugs.net/Examples/Inhalers.html + +//# FIXME ii: +//# specify using categorical distribution directly +//# done (but x ~ categorical[p], in which x starts +//# from 0). + +data { + int N; + int T; + int G; + int Npattern; + array[16, 2] int Ncum; + array[16, 2] int pattern; + int Ncut; + array[2, 2] int treat; + array[2, 2] int period; + array[2, 2] int carry; +} +transformed data { + // Construct individual response data from contingency table + array[N] int group; + array[N, T] int response; + for (i in 1 : Ncum[1, 1]) { + group[i] = 1; + for (t in 1 : T) { + response[i, t] = pattern[1, t]; + } + } + for (i in (Ncum[1, 1] + 1) : Ncum[1, 2]) { + group[i] = 2; + for (t in 1 : T) { + response[i, t] = pattern[1, t]; + } + } + + for (k in 2 : Npattern) { + for (i in (Ncum[k - 1, 2] + 1) : Ncum[k, 1]) { + group[i] = 1; + for (t in 1 : T) { + response[i, t] = pattern[k, t]; + } + } + for (i in (Ncum[k, 1] + 1) : Ncum[k, 2]) { + group[i] = 2; + for (t in 1 : T) { + response[i, t] = pattern[k, t]; + } + } + } +} +parameters { + real sigmasq; + real beta; + real pi; + real kappa; + real a0; + array[N] real b; + ordered[Ncut] a; +} +transformed parameters { + real sigma; + sigma = sqrt(sigmasq); +} +model { + array[N, T, Ncut] real Q; + array[N, T] vector[Ncut + 1] p; + array[G, T] real mu; + + for (g in 1 : G) { + for (t in 1 : T) { + // logistic mean for group g in period t + mu[g, t] = beta * treat[g, t] * .5 + pi * period[g, t] * .5 + + kappa * carry[g, t]; + } + } + + for (i in 1 : N) { + for (t in 1 : T) { + for (j in 1 : Ncut) { + Q[i, t, j] = inv_logit(-(a[j] + mu[group[i], t] + b[i])); + } + + p[i, t, 1] = 1 - Q[i, t, 1]; + for (j in 2 : Ncut) { + p[i, t, j] = Q[i, t, j - 1] - Q[i, t, j]; + } + p[i, t, Ncut + 1] = Q[i, t, Ncut]; + + response[i, t] ~ categorical(p[i, t]); + } + } + b ~ normal(0, sigma); + + beta ~ normal(0, 1000); + pi ~ normal(0, 1000); + kappa ~ normal(0, 1000); + + a0 ~ normal(0, 1000); + + sigmasq ~ inv_gamma(0.001, 0.001); +} +generated quantities { + real log_sigma; + + log_sigma = log(sigma); +} diff --git a/benchmark/stan/bugs_examples/vol1/inhalers/makefile b/benchmark/stan/bugs_examples/vol1/inhalers/makefile new file mode 100644 index 000000000..c080f96b4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/inhalers/makefile @@ -0,0 +1,17 @@ +STAN_HOME = ../../../../.. +PGM = inhalers# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/inhalers/post.R b/benchmark/stan/bugs_examples/vol1/inhalers/post.R new file mode 100644 index 000000000..a08fa5f9c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/inhalers/post.R @@ -0,0 +1,17 @@ +library(coda) +# library(BUGSExamples) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') + +pars <- c("a.1", "a.2", "a.3", "beta", "pi", "kappa", "sigma"); +poi <- post[, pars]; +summary(as.mcmc(poi)) + + +### It seems that JAGS does not support the version as specified as in BUGS +### regarding to the restriction on a's. +# ex <- list(name = "Inhalers", parameters = c("a", "beta", "kappa", "tau", "sigma", "log.sigma"), +# nSample = 2000, nBurnin = 500, nThin = 1, +# nChain = 3) +# +# jagspost <- runExample(ex, engine = 'JAGS') +# summary(jagspost$coda) diff --git a/benchmark/stan/bugs_examples/vol1/kidney/data_reorg.R b/benchmark/stan/bugs_examples/vol1/kidney/data_reorg.R new file mode 100644 index 000000000..33e2eeef3 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/data_reorg.R @@ -0,0 +1,46 @@ +# turn the two-way array to one-way array. +# so that the splitting could be easier. +# +# split the original data to censored data and right-censored data; + +source('kidney.old.data.R') + +tv <- as.vector(t) +agev <- as.vector(age) +t_cenv <- as.vector(t.cen) + +patient <- rep(1:N, 2) +sex <- c(sex, sex) +disease <- c(disease, disease) + + +idx_rc <- which(is.na(tv)) +idx_uc <- which(!is.na(tv)) + +t_uc <- tv[idx_uc] +t_rc <- t_cenv[idx_rc] + +age_uc <- agev[idx_uc] +age_rc <- agev[idx_rc] + +N_uc <- length(idx_uc) +N_rc <- length(idx_rc) + +patient_uc <- patient[idx_uc] +patient_rc <- patient[idx_rc] + +disease_uc <- disease[idx_uc] +disease_rc <- disease[idx_rc] + +sex_uc <- sex[idx_uc] +sex_rc <- sex[idx_rc] + +# number of patients +NP <- N; + +dump(c("NP", "N_uc", "N_rc", "t_uc", "t_rc", "age_uc", "age_rc", + "sex_uc", "sex_rc", + "patient_uc", "patient_rc", "disease_uc", "disease_rc"), + file = "kidney.data.R") + + diff --git a/benchmark/stan/bugs_examples/vol1/kidney/kidney.data.R b/benchmark/stan/bugs_examples/vol1/kidney/kidney.data.R new file mode 100644 index 000000000..86fa9dbef --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/kidney.data.R @@ -0,0 +1,44 @@ +NP <- +38 +N_uc <- +58 +N_rc <- +18 +t_uc <- +c(8, 23, 22, 447, 30, 24, 7, 511, 53, 15, 7, 141, 96, 536, 17, +185, 292, 15, 152, 402, 13, 39, 12, 132, 34, 2, 130, 27, 152, +190, 119, 63, 16, 28, 318, 12, 245, 9, 30, 196, 154, 333, 38, +177, 114, 562, 66, 40, 201, 156, 30, 25, 26, 58, 43, 30, 8, 78 +) +t_rc <- +c(149, 22, 113, 5, 54, 6, 13, 8, 70, 25, 4, 159, 108, 24, 46, +5, 16, 8) +age_uc <- +c(28, 48, 32, 31, 10, 16, 51, 55, 69, 51, 44, 34, 35, 17, 60, +60, 43, 44, 46, 30, 62, 42, 43, 10, 52, 53, 54, 56, 57, 44, 22, +60, 28, 32, 32, 10, 17, 51, 56, 69, 52, 44, 35, 60, 44, 47, 63, +43, 58, 10, 52, 53, 54, 56, 51, 57, 22, 52) +age_rc <- +c(42, 53, 57, 50, 42, 52, 48, 34, 42, 17, 60, 53, 44, 30, 43, +45, 42, 60) +sex_uc <- +c(0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, +1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, +1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1) +sex_rc <- +c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0) +patient_uc <- +c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, +16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, +31, 33, 34, 35, 38, 1, 3, 4, 5, 6, 7, 8, 9, 10, +11, 13, 17, 18, 21, 23, 25, 26, 27, 28, 29, 30, 31, +32, 33, 35, 37) +patient_rc <- +c(14, 19, 26, 32, 36, 37, 2, 12, 14, 15, 16, 19, +20, 22, 24, 34, 36, 38) +disease_uc <- +c(1, 2, 1, 1, 1, 1, 2, 2, 3, 2, 3, 1, 3, 1, 3, 1, 1, 1, 4, 1, +3, 3, 3, 2, 3, 2, 2, 3, 4, 2, 1, 4, 1, 1, 1, 1, 1, 2, 2, 3, 2, +3, 3, 1, 1, 4, 3, 3, 3, 2, 3, 2, 2, 3, 3, 4, 1, 4) +disease_rc <- +c(3, 2, 3, 3, 1, 4, 2, 1, 3, 1, 3, 2, 1, 1, 3, 2, 1, 4) diff --git a/benchmark/stan/bugs_examples/vol1/kidney/kidney.data.json b/benchmark/stan/bugs_examples/vol1/kidney/kidney.data.json new file mode 100644 index 000000000..c951eafc0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/kidney.data.json @@ -0,0 +1,15 @@ +{ + "age_rc": [42, 53, 57, 50, 42, 52, 48, 34, 42, 17, 60, 53, 44, 30, 43, 45, 42, 60], + "sex_rc": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0], + "patient_rc": [14, 19, 26, 32, 36, 37, 2, 12, 14, 15, 16, 19, 20, 22, 24, 34, 36, 38], + "N_uc": 58, + "disease_uc": [1, 2, 1, 1, 1, 1, 2, 2, 3, 2, 3, 1, 3, 1, 3, 1, 1, 1, 4, 1, 3, 3, 3, 2, 3, 2, 2, 3, 4, 2, 1, 4, 1, 1, 1, 1, 1, 2, 2, 3, 2, 3, 3, 1, 1, 4, 3, 3, 3, 2, 3, 2, 2, 3, 3, 4, 1, 4], + "t_uc": [8, 23, 22, 447, 30, 24, 7, 511, 53, 15, 7, 141, 96, 536, 17, 185, 292, 15, 152, 402, 13, 39, 12, 132, 34, 2, 130, 27, 152, 190, 119, 63, 16, 28, 318, 12, 245, 9, 30, 196, 154, 333, 38, 177, 114, 562, 66, 40, 201, 156, 30, 25, 26, 58, 43, 30, 8, 78], + "patient_uc": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 33, 34, 35, 38, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 18, 21, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 37], + "age_uc": [28, 48, 32, 31, 10, 16, 51, 55, 69, 51, 44, 34, 35, 17, 60, 60, 43, 44, 46, 30, 62, 42, 43, 10, 52, 53, 54, 56, 57, 44, 22, 60, 28, 32, 32, 10, 17, 51, 56, 69, 52, 44, 35, 60, 44, 47, 63, 43, 58, 10, 52, 53, 54, 56, 51, 57, 22, 52], + "N_rc": 18, + "NP": 38, + "sex_uc": [0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], + "t_rc": [149, 22, 113, 5, 54, 6, 13, 8, 70, 25, 4, 159, 108, 24, 46, 5, 16, 8], + "disease_rc": [3, 2, 3, 3, 1, 4, 2, 1, 3, 1, 3, 2, 1, 1, 3, 2, 1, 4] +} diff --git a/benchmark/stan/bugs_examples/vol1/kidney/kidney.old.data.R b/benchmark/stan/bugs_examples/vol1/kidney/kidney.old.data.R new file mode 100644 index 000000000..2ed55ad72 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/kidney.old.data.R @@ -0,0 +1,36 @@ +"age" <- +structure(c(28, 48, 32, 31, 10, 16, 51, 55, 69, 51, 44, 34, 35, +42, 17, 60, 60, 43, 53, 44, 46, 30, 62, 42, 43, 57, 10, 52, 53, +54, 56, 50, 57, 44, 22, 42, 52, 60, 28, 48, 32, 32, 10, 17, 51, +56, 69, 52, 44, 34, 35, 42, 17, 60, 60, 44, 53, 44, 47, 30, 63, +43, 43, 58, 10, 52, 53, 54, 56, 51, 57, 45, 22, 42, 52, 60), .Dim = as.integer(c(38, +2))) +"disease" <- +c(1, 2, 1, 1, 1, 1, 2, 2, 3, 2, 3, 1, 3, 3, 1, 3, 1, 1, 2, 1, +4, 1, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 4, 2, 1, 1, 4, 4) +"censored" <- +structure(c(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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), .Dim = as.integer(c(38, +2))) +"M" <- +2 +"N" <- +38 +"sex" <- +c(0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, +0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0) +"t" <- +structure(c(8, 23, 22, 447, 30, 24, 7, 511, 53, 15, 7, 141, 96, +NA, 536, 17, 185, 292, NA, 15, 152, 402, 13, 39, 12, NA, 132, +34, 2, 130, 27, NA, 152, 190, 119, NA, NA, 63, 16, NA, 28, 318, +12, 245, 9, 30, 196, 154, 333, NA, 38, NA, NA, NA, 177, 114, +NA, NA, 562, NA, 66, NA, 40, 201, 156, 30, 25, 26, 58, 43, 30, +NA, 8, NA, 78, NA), .Dim = as.integer(c(38, 2))) +"t.cen" <- +structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 0, 0, +0, 0, 22, 0, 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, 0, 5, 0, 0, 0, 54, +6, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 70, 25, 4, 0, 0, +159, 108, 0, 24, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 16, +0, 8), .Dim = as.integer(c(38, 2))) diff --git a/benchmark/stan/bugs_examples/vol1/kidney/kidney.stan b/benchmark/stan/bugs_examples/vol1/kidney/kidney.stan new file mode 100644 index 000000000..92ac359d4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/kidney.stan @@ -0,0 +1,77 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Page 51: Kidney: Weibull regression with random efects +// http://www.openbugs.net/Examples/Kidney.html + +data { + int NP; + int N_uc; + int N_rc; + array[N_uc] real t_uc; + array[N_rc] real t_rc; + array[N_uc] int disease_uc; + array[N_rc] int disease_rc; + array[N_uc] int patient_uc; + array[N_rc] int patient_rc; + array[N_uc] int sex_uc; + array[N_rc] int sex_rc; + array[N_uc] int age_uc; + array[N_rc] int age_rc; +} +parameters { + real alpha; + real beta_age; + real beta_sex; + real beta_disease2; + real beta_disease3; + real beta_disease4; + real r; + real tau; + array[NP] real b; +} +transformed parameters { + real sigma; + array[4] real yabeta_disease; + yabeta_disease[1] = 0; + yabeta_disease[2] = beta_disease2; + yabeta_disease[3] = beta_disease3; + yabeta_disease[4] = beta_disease4; + sigma = sqrt(1 / tau); +} +model { + alpha ~ normal(0, 100); + beta_age ~ normal(0, 100); + beta_sex ~ normal(0, 100); + beta_disease2 ~ normal(0, 100); + beta_disease3 ~ normal(0, 100); + beta_disease4 ~ normal(0, 100); + + tau ~ gamma(1.0E-3, 1.0E-3); + r ~ gamma(1, 1.0E-3); + + for (i in 1 : NP) { + b[i] ~ normal(0, sigma); + } + for (i in 1 : N_uc) { + t_uc[i] ~ weibull(r, + exp(-(alpha + beta_age * age_uc[i] + + beta_sex * sex_uc[i] + + yabeta_disease[disease_uc[i]] + + b[patient_uc[i]]) + / r)); + } + for (i in 1 : N_rc) { + 1 ~ bernoulli(exp(-pow(t_rc[i] + / exp(-(alpha + beta_age * age_rc[i] + + beta_sex * sex_rc[i] + + yabeta_disease[disease_rc[i]] + + b[patient_rc[i]]) + / r), + r))); + //TODO: try the weibull_cdf + // 0 ~ bernoulli(weibull_cdf(t_rc[i], exp(-(alpha + beta_age * age_rc[i] + beta_sex * sex_rc[i] + // + yabeta_disease[disease_rc[i]] + b[patient_rc[i]]) / r), r)); + } +} +generated quantities { + +} diff --git a/benchmark/stan/bugs_examples/vol1/kidney/makefile b/benchmark/stan/bugs_examples/vol1/kidney/makefile new file mode 100644 index 000000000..45a63ff7d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = kidney +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample num_samples=2000 + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/kidney/post.R b/benchmark/stan/bugs_examples/vol1/kidney/post.R new file mode 100644 index 000000000..97416b56e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/kidney/post.R @@ -0,0 +1,35 @@ +## take a look at the samples and compare with results computed +## in other program. + +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +# copied from JAGS classic-bugs example +"benchstats" <- +structure(c(-4.7831624, 0.00291866339160000, -1.968915345, 0.265791517214, +0.75342247, -1.0063284139, 1.245859934, 0.7179099125, 0.991958536862955, +0.0167522354569816, 0.545071164414747, 0.613006982741994, 0.612254543123539, +0.834773133087595, 0.179659976299101, 0.362347551415367, 0.0313684832093504, +0.000529752199434935, 0.0172366636643072, 0.0193849828705223, +0.0193611886405616, 0.0263978443007167, 0.00568134729477027, +0.0114584356705753, 0.0521436954261121, 0.000801389725300001, +0.0215086114888169, 0.0260244994849658, 0.0268674571467801, 0.0331471966526037, +0.00953117547520882, 0.0186457130325326), .Dim = as.integer(c(8, +4)), .Dimnames = list(c("alpha", "beta.age", "beta.sex", "beta.disease[2]", +"beta.disease[3]", "beta.disease[4]", "r", "sigma"), c("Mean", +"SD", "Naive SE", "Time-series SE"))) + + +poi.names <- c("alpha", "beta_age", "beta_sex", + "beta_disease2", "beta_disease3", "beta_disease4", + "r", "sigma"); +poi <- post[, poi.names] +poi <- as.mcmc(poi); +summary(poi) + +print(benchstats) + +# [Wed Dec 7 19:55:27 EST 2011] +# the results are closer to those presented by WinBUGS than to +# the JAGS benchstats + diff --git a/benchmark/stan/bugs_examples/vol1/leuk/leuk.data.R b/benchmark/stan/bugs_examples/vol1/leuk/leuk.data.R new file mode 100644 index 000000000..0f3906294 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leuk/leuk.data.R @@ -0,0 +1,20 @@ +N <- +42 +NT <- +17 +obs_t <- +c(1, 1, 2, 2, 3, 4, 4, 5, 5, 8, 8, 8, 8, 11, 11, 12, 12, 15, +17, 22, 23, 6, 6, 6, 6, 7, 9, 10, 10, 11, 13, 16, 17, 19, 20, +22, 23, 25, 32, 32, 34, 35) +fail <- +c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, +0) +Z <- +c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, +0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, -0.5, +-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, +-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5) +t <- +c(1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 22, 23, +35) diff --git a/benchmark/stan/bugs_examples/vol1/leuk/leuk.data.json b/benchmark/stan/bugs_examples/vol1/leuk/leuk.data.json new file mode 100644 index 000000000..e3d51b28e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leuk/leuk.data.json @@ -0,0 +1,8 @@ +{ + "t": [1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 22, 23, 35], + "Z": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + "fail": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0], + "N": 42, + "obs_t": [1, 1, 2, 2, 3, 4, 4, 5, 5, 8, 8, 8, 8, 11, 11, 12, 12, 15, 17, 22, 23, 6, 6, 6, 6, 7, 9, 10, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 32, 32, 34, 35], + "NT": 17 +} diff --git a/benchmark/stan/bugs_examples/vol1/leuk/leuk.stan b/benchmark/stan/bugs_examples/vol1/leuk/leuk.stan new file mode 100644 index 000000000..8481ab12e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leuk/leuk.stan @@ -0,0 +1,59 @@ +/* + * Leuk: Cox regression + * URL of OpenBugs' implementation: + * http://www.openbugs.net/Examples/Leuk.html + */ + +data { + int N; + int NT; + array[N] int obs_t; + array[NT + 1] int t; + array[N] int fail; + array[N] real Z; +} +transformed data { + array[N, NT] int Y; + array[N, NT] int dN; + real c; + real r; + for (i in 1 : N) { + for (j in 1 : NT) { + Y[i, j] = int_step(obs_t[i] - t[j] + .000000001); + dN[i, j] = Y[i, j] * fail[i] + * int_step(t[j + 1] - obs_t[i] - .000000001); + } + } + c = 0.001; + r = 0.1; +} +parameters { + real beta; + array[NT] real dL0; +} +model { + beta ~ normal(0, 1000); + for (j in 1 : NT) { + dL0[j] ~ gamma(r * (t[j + 1] - t[j]) * c, c); + for (i in 1 : N) { + if (Y[i, j] != 0) { + target += poisson_lpmf(dN[i, j] | Y[i, j] * exp(beta * Z[i]) * dL0[j]); + } + } + } +} +generated quantities { + array[NT] real S_placebo; + array[NT] real S_treat; + + for (j in 1 : NT) { + // Survivor function = exp(-Integral{l0(u)du})^exp(beta*z) + real s; + s = 0; + for (i in 1 : j) { + s = s + dL0[i]; + } + S_treat[j] = pow(exp(-s), exp(beta * -0.5)); + S_placebo[j] = pow(exp(-s), exp(beta * 0.5)); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/leuk/leuk.stan.0 b/benchmark/stan/bugs_examples/vol1/leuk/leuk.stan.0 new file mode 100644 index 000000000..8f3be408f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leuk/leuk.stan.0 @@ -0,0 +1,44 @@ +# Leuk: Cox regression +# URL of OpenBugs' implementation: +# http://www.openbugs.net/Examples/Leuk.html +data { + int N; + int NT; + int obs_t[N]; + int t[NT + 1]; + int fail[N]; + real Z[N]; +} + +transformed data { + int Y[N, NT]; + int dN[N, NT]; + real c; + real r; + for(i in 1:N) { + for(j in 1:NT) { + Y[i, j] <- int_step(obs_t[i] - t[j] + .000000001); + dN[i, j] <- Y[i, j] * fail[i] * int_step(t[j + 1] - obs_t[i] - .000000001); + } + } + c <- 0.001; + r <- 0.1; +} + +parameters { + real beta; + real dL0[NT]; +} + +model { + beta ~ normal(0, 1000); + for(j in 1:NT) { + dL0[j] ~ gamma(r * (t[j + 1] - t[j]) * c, c); + for(i in 1:N) { + dN[i, j] ~ poisson(Y[i, j] * exp(beta * Z[i]) * dL0[j]); + } + // Survivor function = exp(-Integral{l0(u)du})^exp(beta*z) + // S.treat[j] <- pow(exp(-sum(dL0[1:j])), exp(beta * -0.5)); + // S.placebo[j] <- pow(exp(-sum(dL0[1:j])), exp(beta * 0.5)); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/leuk/makefile b/benchmark/stan/bugs_examples/vol1/leuk/makefile new file mode 100644 index 000000000..01e0790e6 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leuk/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = leuk +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/leuk/post.R b/benchmark/stan/bugs_examples/vol1/leuk/post.R new file mode 100644 index 000000000..883cbc5a9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leuk/post.R @@ -0,0 +1,38 @@ +## take a look at the samples and compare with results computed +## in other program. + +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); +NT <- 17 +beta <- post[, "beta"] + +S_treat <- matrix(0, ncol = NT, nrow = nrow(post)) +S_placebo <- matrix(0, ncol = NT, nrow = nrow(post)) + + +pow <- function(x, y) x^y; + +dL0_idx <- grep("dL0.[:digits:]*", colnames(post)) + +# the Survior function for in iteration +Sfun <- function(p) { + beta <- p["beta"]; + dL0 <- p[dL0_idx]; + NT <- length(dL0) + S.treat <- numeric(NT) + S.placebo <- numeric(NT) + for (j in 1:length(dL0)) { + S.treat[j] <- pow(exp(-sum(dL0[1:j])), exp(beta * -0.5)); + S.placebo[j] <- pow(exp(-sum(dL0[1:j])), exp(beta * 0.5)); + } + c(S.placebo, S.treat); +} + +S <- apply(post, 1, Sfun) + +poi <- cbind(t(S), beta); +colnames(poi) <- c(paste("S.placebo", 1:NT, sep = ''), + paste("S.treat", 1:NT, sep = ''), "beta") + +summary(as.mcmc(poi)) + diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.data.R b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.data.R new file mode 100644 index 000000000..5389b9b35 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.data.R @@ -0,0 +1,26 @@ +N <- +42 +NT <- +17 +obs_t <- +c(1, 1, 2, 2, 3, 4, 4, 5, 5, 8, 8, 8, 8, 11, 11, 12, 12, 15, +17, 22, 23, 6, 6, 6, 6, 7, 9, 10, 10, 11, 13, 16, 17, 19, 20, +22, 23, 25, 32, 32, 34, 35) +fail <- +c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, +0) +Z <- +c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, +0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, -0.5, +-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, +-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5) +t <- +c(1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 22, 23, +35) +Npair <- +21 +pair <- +c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, +19, 18, 8, 1, 20, 6, 2, 10, 3, 14, 4, 11, 7, 9, 12, 16, 17, 5, 13, 15, 21) + diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.data.json b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.data.json new file mode 100644 index 000000000..c2daca922 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.data.json @@ -0,0 +1,10 @@ +{ + "t": [1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 22, 23, 35], + "Z": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + "pair": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 19, 18, 8, 1, 20, 6, 2, 10, 3, 14, 4, 11, 7, 9, 12, 16, 17, 5, 13, 15, 21], + "Npair": 21, + "fail": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0], + "N": 42, + "obs_t": [1, 1, 2, 2, 3, 4, 4, 5, 5, 8, 8, 8, 8, 11, 11, 12, 12, 15, 17, 22, 23, 6, 6, 6, 6, 7, 9, 10, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 32, 32, 34, 35], + "NT": 17 +} diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.init.R b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.init.R new file mode 100644 index 000000000..7152d020e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.init.R @@ -0,0 +1,7 @@ +beta <- 0.0 +dL0 <- c(1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0, + 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0) +tau <- 1.0 +b <- c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.init.json b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.init.json new file mode 100644 index 000000000..daeacf29b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.init.json @@ -0,0 +1,6 @@ +{ + "dL0": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "b": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "tau": 1, + "beta": 0 +} diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.stan b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.stan new file mode 100644 index 000000000..edce92217 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.stan @@ -0,0 +1,63 @@ +/* + * BUGS example vol 1: LeukFr + * http://mathstat.helsinki.fi/openbugs/Examples/Leukfr.html + * http://www.openbugs.net/Examples/Leukfr.html + * + * The result for sigma is a bit different from those in the + * webpage. + + * But the result for beta on + * http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf + * might not be correct. + */ +data { + int N; + int NT; + array[N] int obs_t; + array[NT + 1] int t; + array[N] int fail; + int Npair; + array[N] int pair; + array[N] real Z; +} +transformed data { + array[N, NT] int Y; + array[N, NT] int dN; + real c; + real r; + + for (i in 1 : N) { + for (j in 1 : NT) { + Y[i, j] = int_step(obs_t[i] - t[j] + .000000001); + dN[i, j] = Y[i, j] * fail[i] + * int_step(t[j + 1] - obs_t[i] - .000000001); + } + } + c = 0.001; + r = 0.1; +} +parameters { + real beta; + real tau; + array[NT] real dL0; + array[Npair] real b; +} +transformed parameters { + real sigma; + sigma = 1 / sqrt(tau); +} +model { + beta ~ normal(0, 1000); + tau ~ gamma(.001, .001); + b ~ normal(0, sigma); + for (j in 1 : NT) { + dL0[j] ~ gamma(r * (t[j + 1] - t[j]) * c, c); + for (i in 1 : N) { + if (Y[i, j] != 0) { + target += poisson_lpmf(dN[i, j] | Y[i, j] + * exp(beta * Z[i] + b[pair[i]]) + * dL0[j]); + } + } + } +} diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.stan.0 b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.stan.0 new file mode 100644 index 000000000..927aa9f89 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/leukfr.stan.0 @@ -0,0 +1,63 @@ +# BUGS example vol 1: LeukFr +# http://mathstat.helsinki.fi/openbugs/Examples/Leukfr.html +# http://www.openbugs.net/Examples/Leukfr.html + +# The result for sigma is a bit different from those in the +# webpage. + +# But the result for beta on +# http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +# might not be correct. + + + +data { + int N; + int NT; + int obs_t[N]; + int t[NT + 1]; + int fail[N]; + int Npair; + int pair[N]; + real Z[N]; +} + +transformed data { + int Y[N, NT]; + int dN[N, NT]; + real c; + real r; + + for(i in 1:N) { + for(j in 1:NT) { + Y[i, j] <- int_step(obs_t[i] - t[j] + .000000001); + dN[i, j] <- Y[i, j] * fail[i] * int_step(t[j + 1] - obs_t[i] - .000000001); + } + } + c <- 0.001; + r <- 0.1; +} + +parameters { + real beta; + real tau; + real dL0[NT]; + real b[Npair]; +} + +transformed parameters { + real sigma; + sigma <- 1 / sqrt(tau); +} + +model { + beta ~ normal(0, 1000); + tau ~ gamma(.001, .001); + for (k in 1:Npair) b[k] ~ normal(0, sigma); + for(j in 1:NT) { + dL0[j] ~ gamma(r * (t[j + 1] - t[j]) * c, c); + for(i in 1:N) { + dN[i, j] ~ poisson(Y[i, j] * exp(beta * Z[i] + b[pair[i]]) * dL0[j]); + } + } +} diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/makefile b/benchmark/stan/bugs_examples/vol1/leukfr/makefile new file mode 100644 index 000000000..d40d5e79a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = leukfr +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/leukfr/post.R b/benchmark/stan/bugs_examples/vol1/leukfr/post.R new file mode 100644 index 000000000..9cb9570ad --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/leukfr/post.R @@ -0,0 +1,20 @@ +## take a look at the samples and compare with results computed +## in other program. + +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + + +pars <- c("beta", "sigma"); +poi <- post[, pars]; + +summary(as.mcmc(poi)) + +library(BUGSExamples); +ex <- list(name = "Leukfr", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +plot(jagspost$coda); diff --git a/benchmark/stan/bugs_examples/vol1/litter/litter.data.R b/benchmark/stan/bugs_examples/vol1/litter/litter.data.R new file mode 100644 index 000000000..793c6df7b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/litter/litter.data.R @@ -0,0 +1,9 @@ +G <- 2 +N <- 16 +r <- +structure(c(13, 12, 12, 11, 9, 10, 9, 9, 8, 10, 8, 9, 12, 9, 11, 8, 9, 8, 9, 4, 8, 7, 11, 4, 4, 5, 5, 3, 7, 3, 7, 0), +.Dim = c(2, 16)) +n <- +structure(c(13, 12, 12, 11, 9, 10, 9, 9, 8, 11, 8, 10, 13, 10, 12, 9, 10, 9, 10, 5, 9, 9, 13, 7, 5, 10, 7, 6, 10, 10, +10, 7), +.Dim = c(2, 16)) diff --git a/benchmark/stan/bugs_examples/vol1/litter/litter.data.json b/benchmark/stan/bugs_examples/vol1/litter/litter.data.json new file mode 100644 index 000000000..186604b04 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/litter/litter.data.json @@ -0,0 +1,12 @@ +{ + "G": 2, + "N": 16, + "n": [ + [13, 12, 9, 9, 8, 8, 13, 12, 10, 10, 9, 13, 5, 7, 10, 10], + [12, 11, 10, 9, 11, 10, 10, 9, 9, 5, 9, 7, 10, 6, 10, 7] + ], + "r": [ + [13, 12, 9, 9, 8, 8, 12, 11, 9, 9, 8, 11, 4, 5, 7, 7], + [12, 11, 10, 9, 10, 9, 9, 8, 8, 4, 7, 4, 5, 3, 3, 0] + ] +} diff --git a/benchmark/stan/bugs_examples/vol1/litter/litter.stan b/benchmark/stan/bugs_examples/vol1/litter/litter.stan new file mode 100644 index 000000000..10df6f78c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/litter/litter.stan @@ -0,0 +1,32 @@ +data { + int G; + int N; + array[G, N] int r; + array[G, N] int n; +} +parameters { + matrix[G, N] p; + vector[G] mu; + vector[G] a_plus_b; +} +transformed parameters { + vector[G] a; + vector[G] b; + a = mu .* a_plus_b; + b = (1 - mu) .* a_plus_b; +} +model { + a_plus_b ~ pareto(0.1, 1.5); + for (g in 1 : G) { + for (i in 1 : N) { + p[g, i] ~ beta(a[g], b[g]); + r[g, i] ~ binomial(n[g, i], p[g, i]); + } + } +} +generated quantities { + vector[G] theta; + for (g in 1 : G) { + theta[g] = 1 / (a[g] + b[g]); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/litter/litter_old_param.stan b/benchmark/stan/bugs_examples/vol1/litter/litter_old_param.stan new file mode 100644 index 000000000..3cb58ec87 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/litter/litter_old_param.stan @@ -0,0 +1,31 @@ +data { + int G; + int N; + array[G, N] int r; + array[G, N] int n; +} +parameters { + matrix[G, N] p; + vector[G] a; + vector[G] b; +} +model { + a ~ gamma(1, 0.001); + b ~ gamma(1, 0.001); + for (g in 1 : G) { + for (i in 1 : N) { + p[g, i] ~ beta(a[g], b[g]); + r[g, i] ~ binomial(n[g, i], p[g, i]); + } + } +} +generated quantities { + vector[G] mu; + vector[G] theta; + for (g in 1 : G) { + mu[g] = a[g] / (a[g] + b[g]); + } + for (g in 1 : G) { + theta[g] = 1 / (a[g] + b[g]); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/litter/makefile b/benchmark/stan/bugs_examples/vol1/litter/makefile new file mode 100644 index 000000000..03ebfaee1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/litter/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = litter# +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/litter/post.R b/benchmark/stan/bugs_examples/vol1/litter/post.R new file mode 100644 index 000000000..eec90738a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/litter/post.R @@ -0,0 +1,25 @@ +## take a look at the samples and compare with results computed +## in other program. + + +library(coda) + +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +summary(as.mcmc(poi)) + +library(BUGSExamples) + + +# theta0 <- theta[1] - theta[2] * mean(X) +ex <- list(name = "Litter", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3); + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) + + + + + diff --git a/benchmark/stan/bugs_examples/vol1/lsat/lsat.data.R b/benchmark/stan/bugs_examples/vol1/lsat/lsat.data.R new file mode 100644 index 000000000..591b37aa5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/lsat/lsat.data.R @@ -0,0 +1,14 @@ +N <- 1000 +R <- 32 +T <- 5 +culm <- c(3, 9, 11, 22, 23, 24, 27, 31, 32, 40, 40, 56, 56, 59, 61, 76, 86, 115, 129, 210, 213, 241, 256, 336, 352, 408, 429, 602, 613, 674, 702, 1000) +"response" <- +structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, +0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, +1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, +0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, +0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, +1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, +1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1), .Dim = c(32, +5)) \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/lsat/lsat.data.json b/benchmark/stan/bugs_examples/vol1/lsat/lsat.data.json new file mode 100644 index 000000000..e437c94b3 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/lsat/lsat.data.json @@ -0,0 +1,40 @@ +{ + "response": [ + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 1], + [0, 0, 0, 1, 0], + [0, 0, 0, 1, 1], + [0, 0, 1, 0, 0], + [0, 0, 1, 0, 1], + [0, 0, 1, 1, 0], + [0, 0, 1, 1, 1], + [0, 1, 0, 0, 0], + [0, 1, 0, 0, 1], + [0, 1, 0, 1, 0], + [0, 1, 0, 1, 1], + [0, 1, 1, 0, 0], + [0, 1, 1, 0, 1], + [0, 1, 1, 1, 0], + [0, 1, 1, 1, 1], + [1, 0, 0, 0, 0], + [1, 0, 0, 0, 1], + [1, 0, 0, 1, 0], + [1, 0, 0, 1, 1], + [1, 0, 1, 0, 0], + [1, 0, 1, 0, 1], + [1, 0, 1, 1, 0], + [1, 0, 1, 1, 1], + [1, 1, 0, 0, 0], + [1, 1, 0, 0, 1], + [1, 1, 0, 1, 0], + [1, 1, 0, 1, 1], + [1, 1, 1, 0, 0], + [1, 1, 1, 0, 1], + [1, 1, 1, 1, 0], + [1, 1, 1, 1, 1] + ], + "culm": [3, 9, 11, 22, 23, 24, 27, 31, 32, 40, 40, 56, 56, 59, 61, 76, 86, 115, 129, 210, 213, 241, 256, 336, 352, 408, 429, 602, 613, 674, 702, 1000], + "N": 1000, + "R": 32, + "T": 5 +} diff --git a/benchmark/stan/bugs_examples/vol1/lsat/lsat.stan b/benchmark/stan/bugs_examples/vol1/lsat/lsat.stan new file mode 100644 index 000000000..01e41247f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/lsat/lsat.stan @@ -0,0 +1,51 @@ +// LSAT: item response +// http://www.openbugs.net/Examples/Lsat.html + +data { + int N; // 1000, number of students + int R; // 32, number of patterns of results: 2^T + int T; // 5, number of questions + array[R] int culm; + array[R, T] int response; +} +transformed data { + array[T, N] int r; + vector[N] ones; + + for (j in 1 : culm[1]) { + for (k in 1 : T) { + r[k, j] = response[1, k]; + } + } + for (i in 2 : R) { + for (j in (culm[i - 1] + 1) : culm[i]) { + for (k in 1 : T) { + r[k, j] = response[i, k]; + } + } + } + for (i in 1 : N) { + ones[i] = 1.0; + } +} +parameters { + array[T] real alpha; + vector[N] theta; + real beta; +} +model { + alpha ~ normal(0, 100.); + theta ~ normal(0, 1); + beta ~ normal(0.0, 100.); + for (k in 1 : T) { + r[k] ~ bernoulli_logit(beta * theta - alpha[k] * ones); + } +} +generated quantities { + real mean_alpha; + array[T] real a; + mean_alpha = mean(alpha); + for (t in 1 : T) { + a[t] = alpha[t] - mean_alpha; + } +} diff --git a/benchmark/stan/bugs_examples/vol1/lsat/makefile b/benchmark/stan/bugs_examples/vol1/lsat/makefile new file mode 100644 index 000000000..deefee61b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/lsat/makefile @@ -0,0 +1,14 @@ +STAN_HOME = ../../../../.. +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +lsat : + $(STAN_HOME)/bin/stanc --name=lsat lsat.stan + g++ -O0 -DNDEBUG $(CPPFLAGS) lsat.cpp -o lsat $(LIBFLAGS) + ./lsat data=lsat.data.R sample + +clean : + rm -f lsat.cpp samples.csv lsat + diff --git a/benchmark/stan/bugs_examples/vol1/lsat/posterior_summary.R b/benchmark/stan/bugs_examples/vol1/lsat/posterior_summary.R new file mode 100644 index 000000000..dffdb2855 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/lsat/posterior_summary.R @@ -0,0 +1,34 @@ +library(coda) +# library(BUGSExamples) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +poi <- post[, c(paste("alpha.", 1:5, sep = ''), paste('a.', 1:5, sep = ''), "beta")] +poi <- as.mcmc(poi) +summary(poi) + +## compare with benchmark from JAGS example +benchstats <- +structure(c(-2.745633835, -1.00315582550000, -0.246628370775000, +-1.3127207735, -2.1066172, 0.7594457955, 0.134599617817441, 0.077534970253042, +0.0741992325942451, 0.084149591609884, 0.108905719330582, 0.0711087756187988, +0.00300973895185289, 0.00173373464119226, 0.00165914527959050, +0.00188164207118547, 0.00243520591561694, 0.00159004056080414, +0.00455924426747034, 0.00290739461757728, 0.0026965506231021, +0.0027963649898875, 0.00380594358630786, 0.00436433796205854), .Dim = as.integer(c(6, +4)), .Dimnames = list(c("alpha[1]", "alpha[2]", "alpha[3]", "alpha[4]", +"alpha[5]", "beta"), c("Mean", "SD", "Naive SE", "Time-series SE" +))) + +print(benchstats) + + +# pars <- c("alpha", "a", "beta", "theta"); +# ex <- list(name = "Lsat", parameters = pars, +# nSample = 10000, nBurnin = 1000, nThin = 1, +# nChain = 3) + +# jagspost <- runExample(ex, engine = 'JAGS') +# summary(jagspost$coda); + + + diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.data.R b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.data.R new file mode 100644 index 000000000..46b528c1a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.data.R @@ -0,0 +1,9 @@ +N_studies <- 8 +rt <- +c(1, 9, 2, 1, 10, 1, 1, 90) +nt <- +c(40, 135, 200, 48, 150, 59, 25, 1159) +rc <- +c(2, 23, 7, 1, 8, 9, 3, 118) +nc <- +c(36, 135, 200, 46, 148, 56, 23, 1157) diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.data.json b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.data.json new file mode 100644 index 000000000..131628c57 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.data.json @@ -0,0 +1,7 @@ +{ + "nc": [36, 135, 200, 46, 148, 56, 23, 1157], + "rc": [2, 23, 7, 1, 8, 9, 3, 118], + "N_studies": 8, + "nt": [40, 135, 200, 48, 150, 59, 25, 1159], + "rt": [1, 9, 2, 1, 10, 1, 1, 90] +} diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.init.R b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.init.R new file mode 100644 index 000000000..fc2140c3b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.init.R @@ -0,0 +1,28 @@ +mu <- c(-0.5, -0.5, -0.5, -0.5, -0.5, -0.5) +sigma <- c(1, 1, 1, 1, 1, 1) +theta <- +structure(c(-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, -0.5), +.Dim = c(6, 8)) +pc <- +structure(c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5), +.Dim = c(6, 8)) +inv_tau_sq_1 <- 1 +tau_sq_2 <- 1 +tau_3 <- 25 +B0 <- 0.5 +D0 <- 0.5 +tau_sq_6 <- 0.36 diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.init.json b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.init.json new file mode 100644 index 000000000..46220a1f4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.init.json @@ -0,0 +1,26 @@ +{ + "theta": [ + [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5] + ], + "B0": 0.5, + "tau_sq_6": 0.36, + "D0": 0.5, + "mu": [-0.5, -0.5, -0.5, -0.5, -0.5, -0.5], + "pc": [ + [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], + [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], + [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], + [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], + [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], + [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] + ], + "sigma": [1, 1, 1, 1, 1, 1], + "inv_tau_sq_1": 1, + "tau_3": 25, + "tau_sq_2": 1 +} diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.stan b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.stan new file mode 100644 index 000000000..031c11fb6 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/magnesium.stan @@ -0,0 +1,88 @@ +// Sensitivity to prior distributions: application to Magnesium meta-analysis +// http://www.openbugs.net/Examples/Magnesium.html + +// prior specification 1, 2, 3, 4, 5, and 6 combined +// in one posterior distribution. +// For individual model specification, see magnesium$i.stan ($i=1,...,6) + +// +// Note: tau is really the standard deviation parameter in the normal distribution. +// +data { + int N_studies; + array[N_studies] int rt; + array[N_studies] int nt; + array[N_studies] int rc; + array[N_studies] int nc; +} +transformed data { + int N_priors; + real s0_sq; + real p0_sigma; + + N_priors = 6; + s0_sq = 0.1272041; + p0_sigma = 1 / sqrt(Phi(0.75) / s0_sq); +} +parameters { + array[N_priors] real mu; + array[N_priors, N_studies] real theta; + array[N_priors, N_studies] real pc; + real inv_tau_sq_1; + real tau_sq_2; + real tau_3; + real B0; + real D0; + real tau_sq_6; +} +transformed parameters { + array[N_priors] real tau; + + tau[1] = 1 / sqrt(inv_tau_sq_1); + tau[2] = sqrt(tau_sq_2); + tau[3] = tau_3; + tau[4] = sqrt(s0_sq * (1 - B0) / B0); + tau[5] = sqrt(s0_sq) * (1 - D0) / D0; + tau[6] = sqrt(tau_sq_6); +} +model { + // prior 1: gamma(0.001, 0.001) on inv_tau_sq + inv_tau_sq_1 ~ gamma(0.001, 0.001); + + // Prior 2: Uniform(0, 50) on tau.sqrd + tau_sq_2 ~ uniform(0, 50); + + // Prior 3: Uniform(0, 50) on tau + tau_3 ~ uniform(0, 50); + + // Prior 4: Uniform shrinkage on tau.sqrd + B0 ~ uniform(0, 1); + + // Prior 5: Dumouchel on tau + D0 ~ uniform(0, 1); + + // Prior 6: Half-Normal on tau.sqrd + tau_sq_6 ~ normal(0, p0_sigma) T[0, ]; + + mu ~ uniform(-10, 10); + + for (prior in 1 : N_priors) { + pc[prior] ~ uniform(0, 1); + theta[prior] ~ normal(mu[prior], tau[prior]); + } + for (prior in 1 : N_priors) { + vector[N_studies] tmpm; + for (i in 1 : N_studies) { + tmpm[i] = theta[prior, i] + logit(pc[prior, i]); + } + rc ~ binomial(nc, pc[prior]); + rt ~ binomial_logit(nt, tmpm); + } +} +generated quantities { + array[N_priors] real OR; + + for (prior in 1 : N_priors) { + OR[prior] = exp(mu[prior]); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/makefile b/benchmark/stan/bugs_examples/vol1/magnesium/makefile new file mode 100644 index 000000000..e91e573d2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/makefile @@ -0,0 +1,17 @@ +STAN_HOME = ../../../../.. +PGM = magnesium# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) + diff --git a/benchmark/stan/bugs_examples/vol1/magnesium/post.R b/benchmark/stan/bugs_examples/vol1/magnesium/post.R new file mode 100644 index 000000000..1dbe2fc4d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/magnesium/post.R @@ -0,0 +1,8 @@ +library(coda); + +## read samples from models specified all-together (magnesium.stan) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') +poi.names <- c(paste("OR.", 1:6, sep = ''), paste("tau.", 1:6, sep = '')); +poi <- post[, poi.names] +summary(as.mcmc(poi)) +plot(as.mcmc(poi)) diff --git a/benchmark/stan/bugs_examples/vol1/mice/data_reorg.R b/benchmark/stan/bugs_examples/vol1/mice/data_reorg.R new file mode 100644 index 000000000..fe6315c7a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/data_reorg.R @@ -0,0 +1,13 @@ +# split the original data to censored data and right-censored data +source('mice.old.data.R') + +N_uncensored <- sum(is_censored == 0); +N_censored <- sum(is_censored == 1); + +group_uncensored <- group[is_censored == 0]; +group_censored <- group[is_censored == 1]; + +t_uncensored <- t[is_censored == 0]; +censor_time <- last_t[is_censored == 1] + +dump(c("N_uncensored", "N_censored", "M", "group_uncensored", "group_censored", "t_uncensored", "censor_time"), file = "mice.data.R"); diff --git a/benchmark/stan/bugs_examples/vol1/mice/makefile b/benchmark/stan/bugs_examples/vol1/mice/makefile new file mode 100644 index 000000000..3e6ad1e48 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = mice +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan +CXX = clang++ + + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/mice/mice.data.R b/benchmark/stan/bugs_examples/vol1/mice/mice.data.R new file mode 100644 index 000000000..706774488 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/mice.data.R @@ -0,0 +1,21 @@ +N_uncensored <- +65L +N_censored <- +15L +M <- +4 +group_uncensored <- +c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, +2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, +3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +4, 4, 4) +group_censored <- +c(1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4) +t_uncensored <- +c(12, 17, 21, 25, 11, 26, 27, 30, 13, 12, 21, 20, 23, 25, 23, +29, 35, 31, 36, 32, 27, 23, 12, 18, 38, 29, 30, 32, 25, 30, 37, +27, 22, 26, 28, 19, 15, 12, 35, 35, 10, 22, 18, 12, 31, 24, 37, +29, 27, 18, 22, 13, 18, 29, 28, 16, 22, 26, 19, 17, 28, 26, 12, +17, 26) +censor_time <- +c(40, 40, 40, 40, 40, 40, 40, 40, 10, 24, 40, 40, 20, 29, 10) diff --git a/benchmark/stan/bugs_examples/vol1/mice/mice.data.json b/benchmark/stan/bugs_examples/vol1/mice/mice.data.json new file mode 100644 index 000000000..4810830d8 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/mice.data.json @@ -0,0 +1,9 @@ +{ + "group_uncensored": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "t_uncensored": [12, 17, 21, 25, 11, 26, 27, 30, 13, 12, 21, 20, 23, 25, 23, 29, 35, 31, 36, 32, 27, 23, 12, 18, 38, 29, 30, 32, 25, 30, 37, 27, 22, 26, 28, 19, 15, 12, 35, 35, 10, 22, 18, 12, 31, 24, 37, 29, 27, 18, 22, 13, 18, 29, 28, 16, 22, 26, 19, 17, 28, 26, 12, 17, 26], + "censor_time": [40, 40, 40, 40, 40, 40, 40, 40, 10, 24, 40, 40, 20, 29, 10], + "group_censored": [1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4], + "N_uncensored": 65, + "M": 4, + "N_censored": 15 +} diff --git a/benchmark/stan/bugs_examples/vol1/mice/mice.old.data.R b/benchmark/stan/bugs_examples/vol1/mice/mice.old.data.R new file mode 100644 index 000000000..131361784 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/mice.old.data.R @@ -0,0 +1,28 @@ +"group" <- +c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, +3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, +4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4) +"is_censored" <- +c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, +0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, +0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0) +"last_t" <- +c(40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, +40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, +40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 10, 40, 40, 40, 40, +40, 40, 40, 40, 40, 24, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, +40, 40, 40, 40, 20, 40, 40, 40, 40, 29, 10, 40, 40, 40, 40, 40, +40) +"M" <- +4 +"N" <- +80 +"t" <- +c(12, 17, 21, 25, 11, 26, 27, 30, 13, 12, 21, 20, 23, 25, 23, +29, 35, NA, 31, 36, 32, 27, 23, 12, 18, NA, NA, 38, 29, 30, NA, +32, NA, NA, NA, NA, 25, 30, 37, 27, 22, 26, NA, 28, 19, 15, 12, +35, 35, 10, 22, 18, NA, 12, NA, NA, 31, 24, 37, 29, 27, 18, 22, +13, 18, 29, 28, NA, 16, 22, 26, 19, NA, NA, 17, 28, 26, 12, 17, +26) diff --git a/benchmark/stan/bugs_examples/vol1/mice/mice.stan b/benchmark/stan/bugs_examples/vol1/mice/mice.stan new file mode 100644 index 000000000..9554df838 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/mice.stan @@ -0,0 +1,48 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Page 48: Mice Weibull regression +// http://www.openbugs.net/Examples/Mice.html + +// note that Stan and JAGS have different parameterization for Weibull +// distribution + +// Data is transformed using data_reorg.R +data { + int N_uncensored; + int N_censored; + int M; + array[N_uncensored] int group_uncensored; + array[N_censored] int group_censored; + array[N_censored] real censor_time; + array[N_uncensored] real t_uncensored; +} +parameters { + real r; + array[M] real beta; + array[N_censored] real t2_censored; // t_censored / censor_time +} +model { + r ~ exponential(0.001); + beta ~ normal(0, 100); + for (n in 1 : N_uncensored) { + t_uncensored[n] ~ weibull(r, exp(-beta[group_uncensored[n]] / r)); + } + for (n in 1 : N_censored) { + t2_censored[n] ~ weibull(r, + exp(-beta[group_censored[n]] / r) + / censor_time[n]); + } +} +generated quantities { + array[M] real median; + real pos_control; + real test_sub; + real veh_control; + + for (m in 1 : M) { + median[m] = pow(log(2) * exp(-beta[m]), 1 / r); + } + + veh_control = beta[2] - beta[1]; + test_sub = beta[3] - beta[1]; + pos_control = beta[4] - beta[1]; +} diff --git a/benchmark/stan/bugs_examples/vol1/mice/post.R b/benchmark/stan/bugs_examples/vol1/mice/post.R new file mode 100644 index 000000000..7345936f2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/mice/post.R @@ -0,0 +1,29 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +M <- 4 + +veh_control <- post[, "veh_control"] +test_sub <- post[, "test_sub"] +post_control <- post[, "pos_control"] + + +poi <- post[, c("veh_control", "test_sub", "pos_control", "r", paste('median.', 1:4, sep = ''))] +summary(as.mcmc(poi)) + +# copied from jags example +"benchstats" <- +structure(c(-1.19050455833999, -0.358970521867199, 0.398739260972799, +3.282505832, 24.4461747099999, 35.2348815999999, 27.29264683, +21.6708317800001, 0.368704952159327, 0.349321013036338, 0.345746877312227, +0.328831602502753, 1.83527934356389, 3.1409202416556, 2.24902141666842, +1.69732778227839, 0.00368704952159327, 0.00349321013036338, 0.00345746877312227, +0.00328831602502753, 0.0183527934356389, 0.031409202416556, 0.0224902141666842, +0.0169732778227839, 0.00370973573935992, 0.00345612641578039, +0.0035520553624397, 0.00593038770326027, 0.0196213658552674, +0.0305511869544568, 0.0234729427497584, 0.017304934105965), .Dim = as.integer(c(8, +4)), .Dimnames = list(c("veh.control", "test.sub", "pos.control", +"r", "median[1]", "median[2]", "median[3]", "median[4]"), c("Mean", +"SD", "Naive SE", "Time-series SE"))) + +print(benchstats) diff --git a/benchmark/stan/bugs_examples/vol1/oxford/makefile b/benchmark/stan/bugs_examples/vol1/oxford/makefile new file mode 100644 index 000000000..afef34659 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = oxford +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample random seed=1340384924 + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/oxford/oxford.data.R b/benchmark/stan/bugs_examples/vol1/oxford/oxford.data.R new file mode 100644 index 000000000..73da07179 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/oxford.data.R @@ -0,0 +1,43 @@ +"K" <- +120 +"r1" <- +c(3, 5, 2, 7, 7, 2, 5, 3, 5, 11, 6, 6, 11, 4, 4, 2, 8, 8, 6, +5, 15, 4, 9, 9, 4, 12, 8, 8, 6, 8, 12, 4, 7, 16, 12, 9, 4, 7, +8, 11, 5, 12, 8, 17, 9, 3, 2, 7, 6, 5, 11, 14, 13, 8, 6, 4, 8, +4, 8, 7, 15, 15, 9, 9, 5, 6, 3, 9, 12, 14, 16, 17, 8, 8, 9, 5, +9, 11, 6, 14, 21, 16, 6, 9, 8, 9, 8, 4, 11, 11, 6, 9, 4, 4, 9, +9, 10, 14, 6, 3, 4, 6, 10, 4, 3, 3, 10, 4, 10, 5, 4, 3, 13, 1, +7, 5, 7, 6, 3, 7) +"n1" <- +c(28, 21, 32, 35, 35, 38, 30, 43, 49, 53, 31, 35, 46, 53, 61, +40, 29, 44, 52, 55, 61, 31, 48, 44, 42, 53, 56, 71, 43, 43, 43, +40, 44, 70, 75, 71, 37, 31, 42, 46, 47, 55, 63, 91, 43, 39, 35, +32, 53, 49, 75, 64, 69, 64, 49, 29, 40, 27, 48, 43, 61, 77, 55, +60, 46, 28, 33, 32, 46, 57, 56, 78, 58, 52, 31, 28, 46, 42, 45, +63, 71, 69, 43, 50, 31, 34, 54, 46, 58, 62, 52, 41, 34, 52, 63, +59, 88, 62, 47, 53, 57, 74, 68, 61, 45, 45, 62, 73, 53, 39, 45, +51, 55, 41, 53, 51, 42, 46, 54, 32) +"r0" <- +c(0, 2, 2, 1, 2, 0, 1, 1, 1, 2, 4, 4, 2, 1, 7, 4, 3, 5, 3, 2, +4, 1, 4, 5, 2, 7, 5, 8, 2, 3, 5, 4, 1, 6, 5, 11, 5, 2, 5, 8, +5, 6, 6, 10, 7, 5, 5, 2, 8, 1, 13, 9, 11, 9, 4, 4, 8, 6, 8, 6, +8, 14, 6, 5, 5, 2, 4, 2, 9, 5, 6, 7, 5, 10, 3, 2, 1, 7, 9, 13, +9, 11, 4, 8, 2, 3, 7, 4, 7, 5, 6, 6, 5, 6, 9, 7, 7, 7, 4, 2, +3, 4, 10, 3, 4, 2, 10, 5, 4, 5, 4, 6, 5, 3, 2, 2, 4, 6, 4, 1) +"n0" <- +c(28, 21, 32, 35, 35, 38, 30, 43, 49, 53, 31, 35, 46, 53, 61, +40, 29, 44, 52, 55, 61, 31, 48, 44, 42, 53, 56, 71, 43, 43, 43, +40, 44, 70, 75, 71, 37, 31, 42, 46, 47, 55, 63, 91, 43, 39, 35, +32, 53, 49, 75, 64, 69, 64, 49, 29, 40, 27, 48, 43, 61, 77, 55, +60, 46, 28, 33, 32, 46, 57, 56, 78, 58, 52, 31, 28, 46, 42, 45, +63, 71, 69, 43, 50, 31, 34, 54, 46, 58, 62, 52, 41, 34, 52, 63, +59, 88, 62, 47, 53, 57, 74, 68, 61, 45, 45, 62, 73, 53, 39, 45, +51, 55, 41, 53, 51, 42, 46, 54, 32) +"year" <- +c(-10, -9, -9, -8, -8, -8, -7, -7, -7, -7, -6, -6, -6, -6, -6, +-5, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -4, -4, -3, -3, -3, +-3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, +-1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, +3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, +6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 10) diff --git a/benchmark/stan/bugs_examples/vol1/oxford/oxford.data.json b/benchmark/stan/bugs_examples/vol1/oxford/oxford.data.json new file mode 100644 index 000000000..113b2289e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/oxford.data.json @@ -0,0 +1,8 @@ +{ + "year": [-10, -9, -9, -8, -8, -8, -7, -7, -7, -7, -6, -6, -6, -6, -6, -5, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 10], + "n0": [28, 21, 32, 35, 35, 38, 30, 43, 49, 53, 31, 35, 46, 53, 61, 40, 29, 44, 52, 55, 61, 31, 48, 44, 42, 53, 56, 71, 43, 43, 43, 40, 44, 70, 75, 71, 37, 31, 42, 46, 47, 55, 63, 91, 43, 39, 35, 32, 53, 49, 75, 64, 69, 64, 49, 29, 40, 27, 48, 43, 61, 77, 55, 60, 46, 28, 33, 32, 46, 57, 56, 78, 58, 52, 31, 28, 46, 42, 45, 63, 71, 69, 43, 50, 31, 34, 54, 46, 58, 62, 52, 41, 34, 52, 63, 59, 88, 62, 47, 53, 57, 74, 68, 61, 45, 45, 62, 73, 53, 39, 45, 51, 55, 41, 53, 51, 42, 46, 54, 32], + "n1": [28, 21, 32, 35, 35, 38, 30, 43, 49, 53, 31, 35, 46, 53, 61, 40, 29, 44, 52, 55, 61, 31, 48, 44, 42, 53, 56, 71, 43, 43, 43, 40, 44, 70, 75, 71, 37, 31, 42, 46, 47, 55, 63, 91, 43, 39, 35, 32, 53, 49, 75, 64, 69, 64, 49, 29, 40, 27, 48, 43, 61, 77, 55, 60, 46, 28, 33, 32, 46, 57, 56, 78, 58, 52, 31, 28, 46, 42, 45, 63, 71, 69, 43, 50, 31, 34, 54, 46, 58, 62, 52, 41, 34, 52, 63, 59, 88, 62, 47, 53, 57, 74, 68, 61, 45, 45, 62, 73, 53, 39, 45, 51, 55, 41, 53, 51, 42, 46, 54, 32], + "r0": [0, 2, 2, 1, 2, 0, 1, 1, 1, 2, 4, 4, 2, 1, 7, 4, 3, 5, 3, 2, 4, 1, 4, 5, 2, 7, 5, 8, 2, 3, 5, 4, 1, 6, 5, 11, 5, 2, 5, 8, 5, 6, 6, 10, 7, 5, 5, 2, 8, 1, 13, 9, 11, 9, 4, 4, 8, 6, 8, 6, 8, 14, 6, 5, 5, 2, 4, 2, 9, 5, 6, 7, 5, 10, 3, 2, 1, 7, 9, 13, 9, 11, 4, 8, 2, 3, 7, 4, 7, 5, 6, 6, 5, 6, 9, 7, 7, 7, 4, 2, 3, 4, 10, 3, 4, 2, 10, 5, 4, 5, 4, 6, 5, 3, 2, 2, 4, 6, 4, 1], + "r1": [3, 5, 2, 7, 7, 2, 5, 3, 5, 11, 6, 6, 11, 4, 4, 2, 8, 8, 6, 5, 15, 4, 9, 9, 4, 12, 8, 8, 6, 8, 12, 4, 7, 16, 12, 9, 4, 7, 8, 11, 5, 12, 8, 17, 9, 3, 2, 7, 6, 5, 11, 14, 13, 8, 6, 4, 8, 4, 8, 7, 15, 15, 9, 9, 5, 6, 3, 9, 12, 14, 16, 17, 8, 8, 9, 5, 9, 11, 6, 14, 21, 16, 6, 9, 8, 9, 8, 4, 11, 11, 6, 9, 4, 4, 9, 9, 10, 14, 6, 3, 4, 6, 10, 4, 3, 3, 10, 4, 10, 5, 4, 3, 13, 1, 7, 5, 7, 6, 3, 7], + "K": 120 +} diff --git a/benchmark/stan/bugs_examples/vol1/oxford/oxford.init.R b/benchmark/stan/bugs_examples/vol1/oxford/oxford.init.R new file mode 100644 index 000000000..e25285ea6 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/oxford.init.R @@ -0,0 +1,28 @@ +alpha <- 0 +beta1 <- 0 +beta2 <- 0 +sigma_sq <- 1 +mu <- c(0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0) +b <- c(0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0) diff --git a/benchmark/stan/bugs_examples/vol1/oxford/oxford.init.json b/benchmark/stan/bugs_examples/vol1/oxford/oxford.init.json new file mode 100644 index 000000000..202eb0d45 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/oxford.init.json @@ -0,0 +1,8 @@ +{ + "beta1": 0, + "beta2": 0, + "alpha": 0, + "mu": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "sigma_sq": 1, + "b": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol1/oxford/oxford.stan b/benchmark/stan/bugs_examples/vol1/oxford/oxford.stan new file mode 100644 index 000000000..77b1068a0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/oxford.stan @@ -0,0 +1,40 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Page 34: Oxford: smooth fit to log-odds ratios + +data { + int K; + array[K] int n0; + array[K] int n1; + array[K] int r0; + array[K] int r1; + vector[K] year; +} +transformed data { + vector[K] yearsq; + yearsq = year .* year; +} +parameters { + vector[K] mu; + real alpha; + real beta1; + real beta2; + real sigma_sq; + vector[K] b; +} +transformed parameters { + real sigma; + sigma = sqrt(sigma_sq); +} +model { + r0 ~ binomial_logit(n0, mu); + r1 ~ binomial_logit(n1, + alpha + mu + beta1 * year + beta2 * (yearsq - 22) + + b * sigma); + b ~ normal(0, 1); + mu ~ normal(0, 1000); + + alpha ~ normal(0.0, 1000); + beta1 ~ normal(0.0, 1000); + beta2 ~ normal(0.0, 1000); + sigma_sq ~ inv_gamma(0.001, 0.001); +} diff --git a/benchmark/stan/bugs_examples/vol1/oxford/post.R b/benchmark/stan/bugs_examples/vol1/oxford/post.R new file mode 100644 index 000000000..463e321c7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/oxford/post.R @@ -0,0 +1,22 @@ +## take a look at the samples and compare with results computed +## in other program. + +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +poi <- post[, c("alpha", "beta1", "beta2", "sigma")] +poi <- as.mcmc(poi) +summary(poi) + +# copied from jags example +"benchstats" <- +structure(c(0.578583954000001, -0.0461005503250001, 0.00702949669105, +0.1230820353658, 0.0654185681985203, 0.0149358418576360, 0.00305161514347347, +0.0859365730618193, 0.00146280365482597, 0.000333975576948609, +6.82361890197445e-05, 0.00192160019119605, 0.00161378145150198, +0.000363947519384889, 7.65060538223112e-05, 0.00267000525994563 +), .Dim = as.integer(c(4, 4)), .Dimnames = list(c("alpha", "beta1", +"beta2", "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE" +))) + +print(benchstats) diff --git a/benchmark/stan/bugs_examples/vol1/pump/makefile b/benchmark/stan/bugs_examples/vol1/pump/makefile new file mode 100644 index 000000000..81971b7c0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = pump +CXX = clang++ +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/pump/post.R b/benchmark/stan/bugs_examples/vol1/pump/post.R new file mode 100644 index 000000000..38fc96843 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/post.R @@ -0,0 +1,29 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +N <- 10; +poi <- post[, c("alpha", "beta", paste("theta.", 1:N, sep = ''))] +summary(as.mcmc(poi)) + +# copied from JAGS +"benchstats" <- +structure(c(0.0601627050740002, 0.100952696924200, 0.08932503773, +0.116273870980000, 0.599003113000001, 0.6082596306, 0.894592907996003, +0.876048990530005, 1.583160045, 1.9833574464, 0.7061573086, 0.94860922336, +0.025231937224413, 0.07805500440382, 0.0378282229082668, 0.0304751902078451, +0.314649498624114, 0.136960663769425, 0.73140082256967, 0.71030782476205, +0.762548883078548, 0.424327039225723, 0.272109766290328, 0.548803924118205, +0.000356833478277114, 0.00110386445838974, 0.000534971858773434, +0.000430984273078343, 0.00444981588348116, 0.00193691628214342, +0.0103435696280886, 0.0100452695923822, 0.0107840697242214, 0.00600089053754638, +0.00384821321941954, 0.0077612595257154, 0.000364275961155716, +0.00114230156859317, 0.000542330603585075, 0.000436139437203953, +0.00451615813238448, 0.00188395836024800, 0.0112388833614326, +0.0106720645433105, 0.0114205076290931, 0.0062359030992733, 0.00671822724764772, +0.0128090520670023), .Dim = as.integer(c(12, 4)), .Dimnames = list( + c("theta[1]", "theta[2]", "theta[3]", "theta[4]", "theta[5]", + "theta[6]", "theta[7]", "theta[8]", "theta[9]", "theta[10]", + "alpha", "beta"), c("Mean", "SD", "Naive SE", "Time-series SE" + ))) + +print(benchstats) diff --git a/benchmark/stan/bugs_examples/vol1/pump/pump.R b/benchmark/stan/bugs_examples/vol1/pump/pump.R new file mode 100644 index 000000000..672334a2f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/pump.R @@ -0,0 +1,51 @@ +# BUGS pump example (Vol 1, Example 2) +# http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +library(rstan) +rstan_options(auto_write = TRUE) +options(mc.cores = parallel::detectCores(logical = FALSE)) + +chains = 4 +iter = 1500 + +sourceToList = function(file){ + source(file, local = TRUE) + d = mget(ls()) + d$file = NULL + d +} +# Data are the same for all models +data = sourceToList("pump.data.R") +init = rep(list(sourceToList("pump.init.R")), chains) + +# Original init +pump = stan(file = "pump.stan", data = data, chains = chains, + warmup = 500, init = init, iter = iter, seed = 4711) +plot(pump, ask = FALSE) +pump + +# Random (default) init +pump_random = stan(file = "pump.stan", data = data, chains = chains, + warmup = 500, iter = iter, seed = 4711) +plot(pump_random, ask = FALSE) +pump_random + +# Get parameters as listed in manual +pars = c("alpha","beta","theta[1]","theta[2]","theta[9]", "theta[10]") +bugs_results = as.matrix(data.frame( + bugs_mean = c(0.73, 0.98, 0.06, 0.10, 1.58, 1.97), + bugs_2_5 = c(0.28, 0.24, 0.02, 0.01, 0.47, 1.24), + bugs_97_5 = c(1.38, 2.36, 0.12, 0.30, 3.39, 2.93) +)) + +pump_random_summary = summary(pump_random, probs = c(.025,0.975), + pars = pars)$summary[,c(1,3,4,5,6)] + +cbind(pump_random_summary, bugs_results)[,c(1,6,3,7,4,8,5)] + +# mean bugs_mean 2.5% bugs_2_5 97.5% bugs_97_5 n_eff +# alpha 0.6891 0.73 0.28885 0.28 1.314 1.38 2372 +# beta 0.9250 0.98 0.18769 0.24 2.295 2.36 2316 +# theta[1] 0.0596 0.06 0.02045 0.02 0.117 0.12 3537 +# theta[2] 0.1012 0.10 0.00754 0.01 0.316 0.30 4000 +# theta[9] 1.5872 1.58 0.50311 0.47 3.487 3.39 4000 +# theta[10] 1.9848 1.97 1.22120 1.24 2.883 2.93 4000 diff --git a/benchmark/stan/bugs_examples/vol1/pump/pump.data.R b/benchmark/stan/bugs_examples/vol1/pump/pump.data.R new file mode 100644 index 000000000..1a19e9f2a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/pump.data.R @@ -0,0 +1,6 @@ +"N" <- +10 +"t" <- +c(94.3, 15.7, 62.9, 126, 5.24, 31.4, 1.05, 1.05, 2.1, 10.5) +"x" <- +c(5, 1, 5, 14, 3, 19, 1, 1, 4, 22) diff --git a/benchmark/stan/bugs_examples/vol1/pump/pump.data.json b/benchmark/stan/bugs_examples/vol1/pump/pump.data.json new file mode 100644 index 000000000..365f3dc6d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/pump.data.json @@ -0,0 +1,5 @@ +{ + "t": [94.3, 15.7, 62.9, 126, 5.24, 31.4, 1.05, 1.05, 2.1, 10.5], + "x": [5, 1, 5, 14, 3, 19, 1, 1, 4, 22], + "N": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/pump/pump.init.R b/benchmark/stan/bugs_examples/vol1/pump/pump.init.R new file mode 100644 index 000000000..e00f4ca70 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/pump.init.R @@ -0,0 +1,3 @@ +alpha <- 1 +beta <- 1 +theta <- c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1) diff --git a/benchmark/stan/bugs_examples/vol1/pump/pump.init.json b/benchmark/stan/bugs_examples/vol1/pump/pump.init.json new file mode 100644 index 000000000..3aa15640b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/pump.init.json @@ -0,0 +1,5 @@ +{ + "theta": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "alpha": 1, + "beta": 1 +} diff --git a/benchmark/stan/bugs_examples/vol1/pump/pump.stan b/benchmark/stan/bugs_examples/vol1/pump/pump.stan new file mode 100644 index 000000000..bc738c767 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/pump/pump.stan @@ -0,0 +1,17 @@ +// BUGS pump example (Vol 1, Example 2) +data { + int N; + array[N] int x; + vector[N] t; +} +parameters { + real alpha; + real beta; + vector[N] theta; +} +model { + alpha ~ exponential(1.0); + beta ~ gamma(0.1, 1.0); + theta ~ gamma(alpha, beta); + x ~ poisson(theta .* t); +} diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats.R b/benchmark/stan/bugs_examples/vol1/rats/rats.R new file mode 100644 index 000000000..72372b43e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats.R @@ -0,0 +1,74 @@ +# BUGS rats example (Vol 1, Example 1) +# http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +library(rstan) +rstan_options(auto_write = TRUE) +options(mc.cores = parallel::detectCores(logical = FALSE)) +devAskNewPage(ask = FALSE) +chains = 4 +iter = 1000 + +sourceToList = function(file){ + source(file, local = TRUE) + d = mget(ls()) + d$file = NULL + d +} +# Data are the same for all models +data = sourceToList("rats.data.R") +init = rep(list(sourceToList("rats.init.R")), chains) + +# Indexed data for use with rats_stanified.stan +dataIndexed = with(data, list( + N = N, + Npts = length(y), + rat = rep(1:nrow(y), ncol(y)), + x = rep(x, each = nrow(y)), + y = as.numeric(y), + xbar = xbar +)) + + +# With BUGS init +rats = stan(file = "rats.stan", data = data, chains = chains, + init = init, iter = iter) +plot(rats, ask = FALSE) + +# With random init +rats = stan(file = "rats.stan", data = data, chains = chains, iter = iter) +plot(rats, ask = FALSE) +# traceplot(rats, inc_warmup = FALSE) + +# rats_vec.stan +rats_vec = stan(file = "rats_vec.stan", data = data, chains = chains, + init = init, iter = iter) +plot(rats_vec, ask = FALSE) + +# rats_vec.stan_unit + +# TODO: This gives an increment_log_prob() warning. +rats_vec_unit = stan(file = "rats_vec_unit.stan", data = data, chains = chains, + init = init, iter = iter) +plot(rats_vec_unit, ask = FALSE) + + +# Indexed and simplified rats example, using random initialization +rats_stanified = stan(file = "rats_stanified.stan", data = dataIndexed, chains = chains, + iter = iter) +plot(rats_stanified, ask = FALSE) + +# Compare with BUGS and Gelfand +c( + rats_mu_beta = mean(extract(rats, "mu_beta")[[1]]), + rats_vec_mu_beta = mean(extract(rats_vec, "mu_beta")[[1]]), + rats_vec_unit_mu_beta = mean(extract(rats_vec_unit, "mu_beta")[[1]])*100, + rats_stanified_mu_beta = mean(extract(rats_stanified, "mu_beta")[[1]]), + BUGS_mu_beta = 6.183, + Gelfand_mu_beta = 6.19) + +c( + rats_sigma_beta = mean(extract(rats, "sigma_beta")[[1]]), + rats_vec_sigma_beta = mean(extract(rats_vec, "sigma_beta")[[1]]), + rats_vec_unit_sigma_beta = mean(extract(rats_vec_unit, "sigma_beta")[[1]]), + rats_stanified_sigma_beta = mean(extract(rats_stanified, "sigma_beta")[[1]]) +) + diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats.data.R b/benchmark/stan/bugs_examples/vol1/rats/rats.data.R new file mode 100644 index 000000000..c112eacab --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats.data.R @@ -0,0 +1,22 @@ +N <- +30 +T <- +5 +y <- +structure(c(151, 145, 147, 155, 135, 159, 141, 159, 177, 134, +160, 143, 154, 171, 163, 160, 142, 156, 157, 152, 154, 139, 146, +157, 132, 160, 169, 157, 137, 153, 199, 199, 214, 200, 188, 210, +189, 201, 236, 182, 208, 188, 200, 221, 216, 207, 187, 203, 212, +203, 205, 190, 191, 211, 185, 207, 216, 205, 180, 200, 246, 249, +263, 237, 230, 252, 231, 248, 285, 220, 261, 220, 244, 270, 242, +248, 234, 243, 259, 246, 253, 225, 229, 250, 237, 257, 261, 248, +219, 244, 283, 293, 312, 272, 280, 298, 275, 297, 350, 260, 313, +273, 289, 326, 281, 288, 280, 283, 307, 286, 298, 267, 272, 285, +286, 303, 295, 289, 258, 286, 320, 354, 328, 297, 323, 331, 305, +338, 376, 296, 352, 314, 325, 358, 312, 324, 316, 317, 336, 321, +334, 302, 302, 323, 331, 345, 333, 316, 291, 324), .Dim = c(30, +5)) +x <- +c(8.0, 15.0, 22.0, 29.0, 36.0) +xbar <- +22.0 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats.data.json b/benchmark/stan/bugs_examples/vol1/rats/rats.data.json new file mode 100644 index 000000000..0efe61e80 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats.data.json @@ -0,0 +1,38 @@ +{ + "x": [8, 15, 22, 29, 36], + "y": [ + [151, 199, 246, 283, 320], + [145, 199, 249, 293, 354], + [147, 214, 263, 312, 328], + [155, 200, 237, 272, 297], + [135, 188, 230, 280, 323], + [159, 210, 252, 298, 331], + [141, 189, 231, 275, 305], + [159, 201, 248, 297, 338], + [177, 236, 285, 350, 376], + [134, 182, 220, 260, 296], + [160, 208, 261, 313, 352], + [143, 188, 220, 273, 314], + [154, 200, 244, 289, 325], + [171, 221, 270, 326, 358], + [163, 216, 242, 281, 312], + [160, 207, 248, 288, 324], + [142, 187, 234, 280, 316], + [156, 203, 243, 283, 317], + [157, 212, 259, 307, 336], + [152, 203, 246, 286, 321], + [154, 205, 253, 298, 334], + [139, 190, 225, 267, 302], + [146, 191, 229, 272, 302], + [157, 211, 250, 285, 323], + [132, 185, 237, 286, 331], + [160, 207, 257, 303, 345], + [169, 216, 261, 295, 333], + [157, 205, 248, 289, 316], + [137, 180, 219, 258, 291], + [153, 200, 244, 286, 324] + ], + "xbar": 22, + "N": 30, + "T": 5 +} diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats.init.R b/benchmark/stan/bugs_examples/vol1/rats/rats.init.R new file mode 100644 index 000000000..6b2848155 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats.init.R @@ -0,0 +1,9 @@ +alpha <- c(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, + 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250) +beta <- c(6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6) +mu_alpha <- 150 +mu_beta <- 10 +sigmasq_y <- 1 +sigmasq_alpha <- 1 +sigmasq_beta <- 1 diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats.init.json b/benchmark/stan/bugs_examples/vol1/rats/rats.init.json new file mode 100644 index 000000000..ed5a74009 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats.init.json @@ -0,0 +1,9 @@ +{ + "alpha": [250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250], + "sigmasq_alpha": 1, + "sigmasq_beta": 1, + "mu_alpha": 150, + "sigmasq_y": 1, + "beta": [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], + "mu_beta": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats.stan b/benchmark/stan/bugs_examples/vol1/rats/rats.stan new file mode 100644 index 000000000..7254bb743 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats.stan @@ -0,0 +1,47 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Page 3: Rats +data { + int N; + int T; + array[T] real x; + array[N, T] real y; + real xbar; +} +parameters { + array[N] real alpha; + array[N] real beta; + + real mu_alpha; + real mu_beta; // beta.c in original bugs model + + real sigmasq_y; + real sigmasq_alpha; + real sigmasq_beta; +} +transformed parameters { + real sigma_y; // sigma in original bugs model + real sigma_alpha; + real sigma_beta; + + sigma_y = sqrt(sigmasq_y); + sigma_alpha = sqrt(sigmasq_alpha); + sigma_beta = sqrt(sigmasq_beta); +} +model { + mu_alpha ~ normal(0, 100); + mu_beta ~ normal(0, 100); + sigmasq_y ~ inv_gamma(0.001, 0.001); + sigmasq_alpha ~ inv_gamma(0.001, 0.001); + sigmasq_beta ~ inv_gamma(0.001, 0.001); + alpha ~ normal(mu_alpha, sigma_alpha); // vectorized + beta ~ normal(mu_beta, sigma_beta); // vectorized + for (n in 1 : N) { + for (t in 1 : T) { + y[n, t] ~ normal(alpha[n] + beta[n] * (x[t] - xbar), sigma_y); + } + } +} +generated quantities { + real alpha0; + alpha0 = mu_alpha - xbar * mu_beta; +} diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats_stanified.stan b/benchmark/stan/bugs_examples/vol1/rats/rats_stanified.stan new file mode 100644 index 000000000..4422251ab --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats_stanified.stan @@ -0,0 +1,36 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Model simplified +data { + int N; // Number of rats + int Npts; // Number of data points + array[Npts] int rat; // Lookup index -> rat + array[Npts] real x; + array[Npts] real y; + real xbar; +} +parameters { + array[N] real alpha; + array[N] real beta; + + real mu_alpha; + real mu_beta; // beta.c in original bugs model + real sigma_y; // sigma in original bugs model + real sigma_alpha; + real sigma_beta; +} +model { + mu_alpha ~ normal(0, 100); + mu_beta ~ normal(0, 100); + // sigma_y, sigma_alpha, sigma_beta : flat + alpha ~ normal(mu_alpha, sigma_alpha); // vectorized + beta ~ normal(mu_beta, sigma_beta); // vectorized + for (n in 1 : Npts) { + int irat; + irat = rat[n]; + y[n] ~ normal(alpha[irat] + beta[irat] * (x[n] - xbar), sigma_y); + } +} +generated quantities { + real alpha0; + alpha0 = mu_alpha - xbar * mu_beta; +} diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats_vec.stan b/benchmark/stan/bugs_examples/vol1/rats/rats_vec.stan new file mode 100644 index 000000000..5ca3f4f77 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats_vec.stan @@ -0,0 +1,62 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Page 3: Rats +data { + int N; + int T; + array[T] real x; + array[N, T] real y; + real xbar; +} +transformed data { + array[T] real x_minus_xbar; + array[N * T] real y_linear; + + for (t in 1 : T) { + x_minus_xbar[t] = x[t] - xbar; + } + + for (n in 1 : N) { + for (t in 1 : T) { + y_linear[(n - 1) * T + t] = y[n, t]; + } + } +} +parameters { + array[N] real alpha; + array[N] real beta; + + real mu_alpha; + real mu_beta; + + real sigmasq_y; + real sigmasq_alpha; + real sigmasq_beta; +} +transformed parameters { + real sigma_y; + real sigma_alpha; + real sigma_beta; + + sigma_y = sqrt(sigmasq_y); + sigma_alpha = sqrt(sigmasq_alpha); + sigma_beta = sqrt(sigmasq_beta); +} +model { + array[N * T] real pred; + + for (n in 1 : N) { + for (t in 1 : T) { + pred[(n - 1) * T + t] = fma(beta[n], x_minus_xbar[t], alpha[n]); + } + } + + mu_alpha ~ normal(0, 100); + mu_beta ~ normal(0, 100); + sigmasq_y ~ inv_gamma(0.001, 0.001); + sigmasq_alpha ~ inv_gamma(0.001, 0.001); + sigmasq_beta ~ inv_gamma(0.001, 0.001); + alpha ~ normal(mu_alpha, sigma_alpha); // vectorized + beta ~ normal(mu_beta, sigma_beta); // vectorized + + y_linear ~ normal(pred, sigma_y); // vectorized +} diff --git a/benchmark/stan/bugs_examples/vol1/rats/rats_vec_unit.stan b/benchmark/stan/bugs_examples/vol1/rats/rats_vec_unit.stan new file mode 100644 index 000000000..74e7aedcc --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/rats/rats_vec_unit.stan @@ -0,0 +1,50 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +// Page 3: Rats +data { + int N; + int T; + vector[T] x; + matrix[N, T] y; + real xbar; +} +parameters { + vector[N] alpha_z; + vector[N] beta_z; + + real mu_alpha; + real mu_beta; + + real sigmasq_y; + real sigmasq_alpha; + real sigmasq_beta; +} +transformed parameters { + real sigma_y; // sigma in original bugs model + real sigma_alpha; + real sigma_beta; + vector[N] alpha; + vector[N] beta; + + sigma_y = sqrt(sigmasq_y); + sigma_alpha = sqrt(sigmasq_alpha); + sigma_beta = sqrt(sigmasq_beta); + + alpha = (mu_alpha * 100.0) + alpha_z * sigma_alpha; + beta = (mu_beta * 100.0) + beta_z * sigma_beta; +} +model { + mu_alpha ~ normal(0, 1); + mu_beta ~ normal(0, 1); + sigmasq_y ~ inv_gamma(0.001, 0.001); + sigmasq_alpha ~ inv_gamma(0.001, 0.001); + sigmasq_beta ~ inv_gamma(0.001, 0.001); + alpha_z ~ normal(0, 1); + beta_z ~ normal(0, 1); + for (t in 1 : T) { + col(y, t) ~ normal(alpha + beta * (x[t] - xbar), sigma_y); + } +} +generated quantities { + real alpha0; + alpha0 = mu_alpha - xbar * mu_beta; +} diff --git a/benchmark/stan/bugs_examples/vol1/salm/makefile b/benchmark/stan/bugs_examples/vol1/salm/makefile new file mode 100644 index 000000000..8ce4bc22d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = salm2# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol1/salm/post.R b/benchmark/stan/bugs_examples/vol1/salm/post.R new file mode 100644 index 000000000..ee0d02c60 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/post.R @@ -0,0 +1,25 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#') +summary(as.mcmc(post)) + +# run in JAGS, BUGSExamples is needed. +# BUGSExamples package is installed by +# install.packages("BUGSExamples", repos = "http://R-Forge.R-project.org") + +if (!is.element("BUGSExamples", installed.packages()[, 1])) { + cat("Package BUGSExamples is not installed. It is used to get", + "the results from JAGS.", sep = '\n') + quit(); +} + + +## For some reason, the package BUGSExamples could not +## run this example. + +# library(BUGSExamples) +# ex <- list(name = "Salm", parameters = c("alpha", "beta", "gamma", "tau", "sigma"), +# nSample = 2000, nBurnin = 500, nThin = 1, +# nChain = 3) +# +# jagspost <- runExample(ex, engine = 'JAGS') +# summary(jagspost$coda) diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm.data.R b/benchmark/stan/bugs_examples/vol1/salm/salm.data.R new file mode 100644 index 000000000..ebf07bef3 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm.data.R @@ -0,0 +1,9 @@ +Ndoses <- +6 +Nplates <- +3 +y <- +structure(c(15, 16, 16, 27, 33, 20, 21, 18, 26, 41, 38, 27, 29, +21, 33, 60, 41, 42), .Dim = c(6, 3)) +x <- +c(0, 10, 33, 100, 333, 1000) diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm.data.json b/benchmark/stan/bugs_examples/vol1/salm/salm.data.json new file mode 100644 index 000000000..db7413ad9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm.data.json @@ -0,0 +1,13 @@ +{ + "Nplates": 3, + "x": [0, 10, 33, 100, 333, 1000], + "y": [ + [15, 21, 29], + [16, 18, 21], + [16, 26, 33], + [27, 41, 60], + [33, 38, 41], + [20, 27, 42] + ], + "Ndoses": 6 +} diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm.init.R b/benchmark/stan/bugs_examples/vol1/salm/salm.init.R new file mode 100644 index 000000000..f544c2897 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm.init.R @@ -0,0 +1,11 @@ +alpha_star <- 0 +beta <- 0 +gamma <- 0 +tau <- 0.1 +lambda <- +structure(c(0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0), .Dim = c(6, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm.init.json b/benchmark/stan/bugs_examples/vol1/salm/salm.init.json new file mode 100644 index 000000000..8c0cb3843 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm.init.json @@ -0,0 +1,14 @@ +{ + "lambda": [ + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0] + ], + "tau": 0.1, + "beta": 0, + "gamma": 0, + "alpha_star": 0 +} diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm.stan b/benchmark/stan/bugs_examples/vol1/salm/salm.stan new file mode 100644 index 000000000..17909ab71 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm.stan @@ -0,0 +1,53 @@ +//# http://www.openbugs.net/Examples/Salm.html +//# this matches the jags implementation +data { + int Ndoses; + int Nplates; + array[Ndoses, Nplates] int y; + array[Ndoses] real x; +} +transformed data { + array[Ndoses] real logx; + real mean_x; + real mean_logx; + array[Ndoses] real centered_x; + array[Ndoses] real centered_logx; + + mean_x = mean(x); + for (dose in 1 : Ndoses) { + centered_x[dose] = x[dose] - mean_x; + } + + for (dose in 1 : Ndoses) { + logx[dose] = log(x[dose] + 10); + } + mean_logx = mean(logx); + for (dose in 1 : Ndoses) { + centered_logx[dose] = logx[dose] - mean_logx; + } +} +parameters { + real alpha_star; + real beta; + real gamma; + real tau; + array[Ndoses] vector[Nplates] lambda; +} +transformed parameters { + real sigma; + real alpha; + + alpha = alpha_star - beta * mean_logx - gamma * mean_x; + sigma = 1.0 / sqrt(tau); +} +model { + alpha_star ~ normal(0.0, 1.0E3); + beta ~ normal(0.0, 1000); + gamma ~ normal(0.0, 1000); + tau ~ gamma(0.001, 0.001); + for (dose in 1 : Ndoses) { + lambda[dose] ~ normal(0.0, sigma); + y[dose] ~ poisson_log(alpha_star + beta * centered_logx[dose] + + gamma * centered_x[dose] + lambda[dose]); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm2.data.R b/benchmark/stan/bugs_examples/vol1/salm/salm2.data.R new file mode 100644 index 000000000..ebf07bef3 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm2.data.R @@ -0,0 +1,9 @@ +Ndoses <- +6 +Nplates <- +3 +y <- +structure(c(15, 16, 16, 27, 33, 20, 21, 18, 26, 41, 38, 27, 29, +21, 33, 60, 41, 42), .Dim = c(6, 3)) +x <- +c(0, 10, 33, 100, 333, 1000) diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm2.data.json b/benchmark/stan/bugs_examples/vol1/salm/salm2.data.json new file mode 100644 index 000000000..db7413ad9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm2.data.json @@ -0,0 +1,13 @@ +{ + "Nplates": 3, + "x": [0, 10, 33, 100, 333, 1000], + "y": [ + [15, 21, 29], + [16, 18, 21], + [16, 26, 33], + [27, 41, 60], + [33, 38, 41], + [20, 27, 42] + ], + "Ndoses": 6 +} diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm2.init.R b/benchmark/stan/bugs_examples/vol1/salm/salm2.init.R new file mode 100644 index 000000000..2b12069ea --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm2.init.R @@ -0,0 +1,11 @@ +alpha <- 0 +beta <- 0 +gamma <- 0 +tau <- 0.1 +lambda <- +structure(c(0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0), .Dim = c(6, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm2.init.json b/benchmark/stan/bugs_examples/vol1/salm/salm2.init.json new file mode 100644 index 000000000..193b6e335 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm2.init.json @@ -0,0 +1,14 @@ +{ + "alpha": 0, + "lambda": [ + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0] + ], + "tau": 0.1, + "beta": 0, + "gamma": 0 +} diff --git a/benchmark/stan/bugs_examples/vol1/salm/salm2.stan b/benchmark/stan/bugs_examples/vol1/salm/salm2.stan new file mode 100644 index 000000000..1834f4c8f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/salm/salm2.stan @@ -0,0 +1,31 @@ +//# http://www.openbugs.net/Examples/Salm.html + +//# the version without centering x's +data { + int Ndoses; + int Nplates; + array[Ndoses, Nplates] int y; + array[Ndoses] real x; +} +parameters { + real alpha; + real beta; + real gamma; + real tau; + array[Ndoses] vector[Nplates] lambda; +} +transformed parameters { + real sigma; + sigma = 1.0 / sqrt(tau); +} +model { + alpha ~ normal(0.0, 100); + beta ~ normal(0.0, 100); + gamma ~ normal(0.0, 1.0E5); + tau ~ gamma(0.001, 0.001); + for (dose in 1 : Ndoses) { + lambda[dose] ~ normal(0.0, sigma); + y[dose] ~ poisson_log(alpha + beta * log(x[dose] + 10) + gamma * x[dose] + + lambda[dose]); + } +} diff --git a/benchmark/stan/bugs_examples/vol1/seeds/makefile b/benchmark/stan/bugs_examples/vol1/seeds/makefile new file mode 100644 index 000000000..b7d6874e5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = seeds# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=seeds seeds.stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./seeds data=seeds.data.R sample + +clean : + rm -f seeds.cpp samples.csv seeds diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds.R b/benchmark/stan/bugs_examples/vol1/seeds/seeds.R new file mode 100644 index 000000000..d8c7d4877 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds.R @@ -0,0 +1,107 @@ +# BUGS seeds example (Vol 1, Example 3) +# http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol1.pdf +library(rstan) +rstan_options(auto_write = TRUE) +options(mc.cores = parallel::detectCores(logical = FALSE)) +chains = 4 +iter = 1000 +set.seed(4711) + +sourceToList = function(file){ + source(file, local = TRUE) + d = mget(ls()) + d$file = NULL + d +} +# Data are the same for all models +data = sourceToList("seeds.data.R") +init = rep(list(sourceToList("seeds.init.R")), chains) + +# Original init +seeds = stan(file = "seeds.stan", data = data, chains = chains, + init = init, iter = iter) +plot(seeds, ask = FALSE) +pars = c("alpha0", "alpha1","alpha2", "alpha12","sigma") +seeds_summary = summary(seeds,probs = c(.025,0.975), + pars = pars)$summary[,c(1,3,4,5,6)] + +# Default random init +seeds_random = stan(file = "seeds.stan", data = data, chains = chains, + iter = iter) +plot(seeds_random, ask = FALSE) +seeds_random_summary = summary(seeds_random,probs = c(.025,0.975), + pars = pars)$summary[,c(1,3,4,5,6)] + +# Removed tau, using sigma direct +seeds_stanified = stan(file = "seeds_stanified.stan", data = data, chains = chains, + iter = iter) +plot(seeds_stanified, ask = FALSE) +seeds_stanified_summary = summary(seeds_stanified, probs = c(.025,0.975), + pars = pars)$summary[,c(1,3,4,5,6)] + + +(seeds_summary) +(seeds_random_summary) +(seeds_stanified_summary) + +# alpha1: seed type +# alpha2: root extract +# +# (seeds_summary) +# mean sd 2.5% 97.5% n_eff +# alpha0 -0.5643 0.207 -0.9630 -0.156 470 +# alpha1 0.0917 0.335 -0.5626 0.727 435 +# alpha2 1.3642 0.285 0.7954 1.957 500 +# alpha12 -0.8303 0.450 -1.6577 0.088 552 +# sigma 0.2982 0.137 0.0869 0.621 163 + +# (seeds_random_summary) +# mean sd 2.5% 97.5% n_eff +# alpha0 -0.5511 0.201 -0.9639 -0.1554 665 +# alpha1 0.0785 0.320 -0.5598 0.6876 762 +# alpha2 1.3459 0.291 0.7932 1.9299 689 +# alpha12 -0.8084 0.447 -1.7063 0.0684 767 +# sigma 0.3066 0.136 0.0859 0.6213 118 + +# (seeds_stanified_summary) +# mean sd 2.5% 97.5% n_eff +# alpha0 -0.5399 0.230 -1.004 -0.0897 563 +# alpha1 0.0597 0.353 -0.683 0.7364 627 +# alpha2 1.3545 0.316 0.766 2.0405 618 +# alpha12 -0.8432 0.488 -1.833 0.1024 740 +# sigma 0.3638 0.140 0.141 0.6681 183 + +bugs_results = as.matrix(data.frame( + bugs_mean = c(-0.542, 0.028, 1.37, -0.79, 0.29), + bugs_se = c(0.18, .34,.25, .43, .15))) + +cbind(seeds_random_summary[,1:2], bugs_results) +# mean sd bugs_mean bugs_se +# alpha0 -0.5511 0.201 -0.542 0.18 +# alpha1 0.0785 0.320 0.028 0.34 +# alpha2 1.3459 0.291 1.370 0.25 +# alpha12 -0.8084 0.447 -0.790 0.43 +# sigma 0.3066 0.136 0.290 0.15 + +# 3.1 Constraining random effects to sum to zero +# There is an example in the bugs manual how to constrain parameters to sum +# up to 0. +# This does not improve convergence and n_eff +seeds_centered = stan(file = "seeds_centered.stan", data = data, chains = chains, + iter = iter) +plot(seeds_centered, ask = FALSE) +seeds_centered_summary = summary(seeds_centered, probs = c(.025,0.975), + pars = pars)$summary[,c(1,3,4,5,6)] +(seeds_centered_summary) +par(mfcol = c(3,1)) +b_centered = as.numeric(extract(seeds_centered, pars = "b")$b) +hist(b_centered, main = paste("Mean of centered b=", signif(mean(b_centered),2)), + xlim = c(-1.5,1.5)) +b_stan = as.numeric(extract(seeds, pars = "b")$b) +hist(b_stan, main = paste("Mean of default model b=", signif(mean(b_stan),2)), + xlim = c(-1.5,1.5)) +b_stanified = as.numeric(extract(seeds_stanified, pars = "b")$b) +hist(b_stanified, main = paste("Mean of stanified b=", signif(mean(b_stanified),2)), + xlim = c(-1.5,1.5)) + + diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds.data.R b/benchmark/stan/bugs_examples/vol1/seeds/seeds.data.R new file mode 100644 index 000000000..ac897d34b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds.data.R @@ -0,0 +1,14 @@ +"I" <- +21 +"n" <- +c(10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0, +3, 22, 15, 32, 3) +"N" <- +c(39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45, +4, 12, 41, 30, 51, 7) +"x1" <- +c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1) +"x2" <- +c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, +1) diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds.data.json b/benchmark/stan/bugs_examples/vol1/seeds/seeds.data.json new file mode 100644 index 000000000..bd87198be --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds.data.json @@ -0,0 +1,7 @@ +{ + "I": 21, + "N": [39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45, 4, 12, 41, 30, 51, 7], + "n": [10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0, 3, 22, 15, 32, 3], + "x1": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "x2": [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1] +} diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds.init.R b/benchmark/stan/bugs_examples/vol1/seeds/seeds.init.R new file mode 100644 index 000000000..d5d7c4839 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds.init.R @@ -0,0 +1,23 @@ +alpha0 <- 0 +alpha1 <- 0 +alpha2 <- 0 +alpha12 <- 0 +tau <- 10 +b <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0) + +"I" <- +21 +"n" <- +c(10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0, +3, 22, 15, 32, 3) +"N" <- +c(39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45, +4, 12, 41, 30, 51, 7) +"x1" <- +c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1) +"x2" <- +c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, +1) diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds.init.json b/benchmark/stan/bugs_examples/vol1/seeds/seeds.init.json new file mode 100644 index 000000000..c3f5e03c8 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds.init.json @@ -0,0 +1,13 @@ +{ + "alpha0": 0, + "alpha1": 0, + "b": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "alpha2": 0, + "I": 21, + "tau": 10, + "N": [39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45, 4, 12, 41, 30, 51, 7], + "n": [10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0, 3, 22, 15, 32, 3], + "x1": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "x2": [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], + "alpha12": 0 +} diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds.stan b/benchmark/stan/bugs_examples/vol1/seeds/seeds.stan new file mode 100644 index 000000000..2d1130054 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds.stan @@ -0,0 +1,36 @@ +//# +//# http://www.openbugs.net/Examples/Seeds.html +data { + int I; + array[I] int n; + array[I] int N; + vector[I] x1; + vector[I] x2; +} +transformed data { + vector[I] x1x2; + x1x2 = x1 .* x2; +} +parameters { + real alpha0; + real alpha1; + real alpha12; + real alpha2; + real tau; + vector[I] b; +} +transformed parameters { + real sigma; + sigma = 1.0 / sqrt(tau); +} +model { + alpha0 ~ normal(0.0, 1.0E3); + alpha1 ~ normal(0.0, 1.0E3); + alpha2 ~ normal(0.0, 1.0E3); + alpha12 ~ normal(0.0, 1.0E3); + tau ~ gamma(1.0E-3, 1.0E-3); + + b ~ normal(0.0, sigma); + n ~ binomial_logit(N, + alpha0 + alpha1 * x1 + alpha2 * x2 + alpha12 * x1x2 + b); +} diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds_centered.stan b/benchmark/stan/bugs_examples/vol1/seeds/seeds_centered.stan new file mode 100644 index 000000000..652e00f37 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds_centered.stan @@ -0,0 +1,38 @@ +// http://www.openbugs.net/Examples/Seeds.html +// tau replaced by sigma direct estimation +// using narrower semi-informative priors +// Centered coefficients as in BUGS manual chapter 3.1 +data { + int I; + array[I] int n; + array[I] int N; + vector[I] x1; // seed type + vector[I] x2; // root extract +} +transformed data { + vector[I] x1x2; + x1x2 = x1 .* x2; +} +parameters { + real alpha0; + real alpha1; + real alpha12; + real alpha2; + vector[I] c; + real sigma; +} +transformed parameters { + vector[I] b; + b = c - mean(c); +} +model { + alpha0 ~ normal(0.0, 1.0); // Narrower priors + alpha1 ~ normal(0.0, 1.0); + alpha2 ~ normal(0.0, 1.0); + alpha12 ~ normal(0.0, 1.0); + sigma ~ cauchy(0, 1); + + c ~ normal(0.0, sigma); + n ~ binomial_logit(N, + alpha0 + alpha1 * x1 + alpha2 * x2 + alpha12 * x1x2 + b); +} diff --git a/benchmark/stan/bugs_examples/vol1/seeds/seeds_stanified.stan b/benchmark/stan/bugs_examples/vol1/seeds/seeds_stanified.stan new file mode 100644 index 000000000..2e457173e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/seeds/seeds_stanified.stan @@ -0,0 +1,33 @@ +//# http://www.openbugs.net/Examples/Seeds.html +//# tau replaced by sigma direct estimation +//# using narrower semi-informative priors +data { + int I; + array[I] int n; + array[I] int N; + vector[I] x1; // seed type + vector[I] x2; // root extract +} +transformed data { + vector[I] x1x2; + x1x2 = x1 .* x2; +} +parameters { + real alpha0; + real alpha1; + real alpha12; + real alpha2; + vector[I] b; + real sigma; +} +model { + alpha0 ~ normal(0.0, 1.0); // Narrower priors + alpha1 ~ normal(0.0, 1.0); + alpha2 ~ normal(0.0, 1.0); + alpha12 ~ normal(0.0, 1.0); + sigma ~ cauchy(0, 1); + + b ~ normal(0.0, sigma); + n ~ binomial_logit(N, + alpha0 + alpha1 * x1 + alpha2 * x2 + alpha12 * x1x2 + b); +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.data.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.data.R new file mode 100644 index 000000000..21605c465 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.data.R @@ -0,0 +1,13 @@ +p <- +3 +N <- +21 +Y <- +c(43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, +7, 8, 8, 9, 15, 15) +x <- +structure(c(80, 80, 75, 62, 62, 62, 62, 62, 59, 58, 58, 58, 58, +58, 50, 50, 50, 50, 50, 56, 70, 27, 27, 25, 24, 22, 23, 24, 24, +23, 18, 18, 17, 18, 19, 18, 18, 19, 19, 20, 20, 20, 89, 88, 90, +87, 87, 87, 93, 93, 87, 80, 89, 88, 82, 93, 89, 86, 72, 79, 80, +82, 91), .Dim = c(21, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.data.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.data.json new file mode 100644 index 000000000..58ac90a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.data.json @@ -0,0 +1,28 @@ +{ + "Y": [43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, 7, 8, 8, 9, 15, 15], + "x": [ + [80, 27, 89], + [80, 27, 88], + [75, 25, 90], + [62, 24, 87], + [62, 22, 87], + [62, 23, 87], + [62, 24, 93], + [62, 24, 93], + [59, 23, 87], + [58, 18, 80], + [58, 18, 89], + [58, 17, 88], + [58, 18, 82], + [58, 19, 93], + [50, 18, 89], + [50, 18, 86], + [50, 19, 72], + [50, 19, 79], + [50, 20, 80], + [56, 20, 82], + [70, 20, 91] + ], + "N": 21, + "p": 3 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.init.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.init.R new file mode 100644 index 000000000..2f3f33322 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.init.R @@ -0,0 +1,4 @@ +beta0 <- 10 +beta <- c(0, 0, 0) +sigmasq <- 10 +phi <- 0.316 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.init.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.init.json new file mode 100644 index 000000000..7cf148309 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.init.json @@ -0,0 +1,6 @@ +{ + "beta0": 10, + "beta": [0, 0, 0], + "phi": 0.316, + "sigmasq": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.stan b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.stan new file mode 100644 index 000000000..b344d1924 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_a_normal.stan @@ -0,0 +1,56 @@ +// Stacks: robust regression and ridge regression +// http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html +// Model a) normal error + +data { + int N; + int p; + array[N] real Y; + matrix[N, p] x; +} +// to standardize the x's +transformed data { + matrix[N, p] z; + row_vector[p] mean_x; + array[p] real sd_x; + for (j in 1 : p) { + mean_x[j] = mean(col(x, j)); + sd_x[j] = sd(col(x, j)); + for (i in 1 : N) { + z[i, j] = (x[i, j] - mean_x[j]) / sd_x[j]; + } + } +} +parameters { + real beta0; + vector[p] beta; + real sigmasq; +} +transformed parameters { + real sigma; + vector[N] mu; + sigma = sqrt(sigmasq); + mu = beta0 + z * beta; +} +model { + beta0 ~ normal(0, 316); + beta ~ normal(0, 316); + sigmasq ~ inv_gamma(.001, .001); + Y ~ normal(mu, sigma); +} +generated quantities { + real b0; + vector[p] b; + real outlier_3; + real outlier_4; + real outlier_21; + + for (j in 1 : p) { + b[j] = beta[j] / sd_x[j]; + } + b0 = beta0 - mean_x * b; + + outlier_3 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_4 = step(abs((Y[4] - mu[4]) / sigma) - 2.5); + outlier_21 = step(abs((Y[21] - mu[21]) / sigma) - 2.5); +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.data.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.data.R new file mode 100644 index 000000000..21605c465 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.data.R @@ -0,0 +1,13 @@ +p <- +3 +N <- +21 +Y <- +c(43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, +7, 8, 8, 9, 15, 15) +x <- +structure(c(80, 80, 75, 62, 62, 62, 62, 62, 59, 58, 58, 58, 58, +58, 50, 50, 50, 50, 50, 56, 70, 27, 27, 25, 24, 22, 23, 24, 24, +23, 18, 18, 17, 18, 19, 18, 18, 19, 19, 20, 20, 20, 89, 88, 90, +87, 87, 87, 93, 93, 87, 80, 89, 88, 82, 93, 89, 86, 72, 79, 80, +82, 91), .Dim = c(21, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.data.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.data.json new file mode 100644 index 000000000..58ac90a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.data.json @@ -0,0 +1,28 @@ +{ + "Y": [43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, 7, 8, 8, 9, 15, 15], + "x": [ + [80, 27, 89], + [80, 27, 88], + [75, 25, 90], + [62, 24, 87], + [62, 22, 87], + [62, 23, 87], + [62, 24, 93], + [62, 24, 93], + [59, 23, 87], + [58, 18, 80], + [58, 18, 89], + [58, 17, 88], + [58, 18, 82], + [58, 19, 93], + [50, 18, 89], + [50, 18, 86], + [50, 19, 72], + [50, 19, 79], + [50, 20, 80], + [56, 20, 82], + [70, 20, 91] + ], + "N": 21, + "p": 3 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.init.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.init.R new file mode 100644 index 000000000..2f3f33322 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.init.R @@ -0,0 +1,4 @@ +beta0 <- 10 +beta <- c(0, 0, 0) +sigmasq <- 10 +phi <- 0.316 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.init.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.init.json new file mode 100644 index 000000000..7cf148309 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.init.json @@ -0,0 +1,6 @@ +{ + "beta0": 10, + "beta": [0, 0, 0], + "phi": 0.316, + "sigmasq": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.stan b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.stan new file mode 100644 index 000000000..e7b335122 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_b_dexp.stan @@ -0,0 +1,59 @@ +// Stacks: robust regression and ridge regression +// http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html +// Model b) double exponential error + +data { + int N; + int p; + array[N] real Y; + matrix[N, p] x; +} +// to standardize the x's +transformed data { + matrix[N, p] z; + row_vector[p] mean_x; + array[p] real sd_x; + for (j in 1 : p) { + mean_x[j] = mean(col(x, j)); + sd_x[j] = sd(col(x, j)); + for (i in 1 : N) { + z[i, j] = (x[i, j] - mean_x[j]) / sd_x[j]; + } + } +} +parameters { + real beta0; + vector[p] beta; + real sigmasq; +} +transformed parameters { + real sigma; + vector[N] mu; + + sigma = sqrt(2) * sigmasq; + mu = beta0 + z * beta; +} +model { + beta0 ~ normal(0, 316); + beta ~ normal(0, 316); + sigmasq ~ inv_gamma(.001, .001); + Y ~ double_exponential(mu, sigmasq); +} +generated quantities { + real b0; + vector[p] b; + real outlier_1; + real outlier_3; + real outlier_4; + real outlier_21; + + for (j in 1 : p) { + b[j] = beta[j] / sd_x[j]; + } + b0 = beta0 - mean_x * b; + + outlier_1 = step(abs((Y[1] - mu[1]) / sigma) - 2.5); + outlier_3 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_4 = step(abs((Y[4] - mu[4]) / sigma) - 2.5); + outlier_21 = step(abs((Y[21] - mu[21]) / sigma) - 2.5); +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.data.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.data.R new file mode 100644 index 000000000..21605c465 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.data.R @@ -0,0 +1,13 @@ +p <- +3 +N <- +21 +Y <- +c(43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, +7, 8, 8, 9, 15, 15) +x <- +structure(c(80, 80, 75, 62, 62, 62, 62, 62, 59, 58, 58, 58, 58, +58, 50, 50, 50, 50, 50, 56, 70, 27, 27, 25, 24, 22, 23, 24, 24, +23, 18, 18, 17, 18, 19, 18, 18, 19, 19, 20, 20, 20, 89, 88, 90, +87, 87, 87, 93, 93, 87, 80, 89, 88, 82, 93, 89, 86, 72, 79, 80, +82, 91), .Dim = c(21, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.data.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.data.json new file mode 100644 index 000000000..58ac90a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.data.json @@ -0,0 +1,28 @@ +{ + "Y": [43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, 7, 8, 8, 9, 15, 15], + "x": [ + [80, 27, 89], + [80, 27, 88], + [75, 25, 90], + [62, 24, 87], + [62, 22, 87], + [62, 23, 87], + [62, 24, 93], + [62, 24, 93], + [59, 23, 87], + [58, 18, 80], + [58, 18, 89], + [58, 17, 88], + [58, 18, 82], + [58, 19, 93], + [50, 18, 89], + [50, 18, 86], + [50, 19, 72], + [50, 19, 79], + [50, 20, 80], + [56, 20, 82], + [70, 20, 91] + ], + "N": 21, + "p": 3 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.init.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.init.R new file mode 100644 index 000000000..2f3f33322 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.init.R @@ -0,0 +1,4 @@ +beta0 <- 10 +beta <- c(0, 0, 0) +sigmasq <- 10 +phi <- 0.316 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.init.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.init.json new file mode 100644 index 000000000..7cf148309 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.init.json @@ -0,0 +1,6 @@ +{ + "beta0": 10, + "beta": [0, 0, 0], + "phi": 0.316, + "sigmasq": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.stan b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.stan new file mode 100644 index 000000000..bf68a934d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_c_t4.stan @@ -0,0 +1,60 @@ +// Stacks: robust regression and ridge regression +// http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html +// Model c) t error + +data { + int N; + int p; + array[N] real Y; + matrix[N, p] x; +} +// to standardize the x's +transformed data { + matrix[N, p] z; + row_vector[p] mean_x; + array[p] real sd_x; + real d; + + for (j in 1 : p) { + mean_x[j] = mean(col(x, j)); + sd_x[j] = sd(col(x, j)); + for (i in 1 : N) { + z[i, j] = (x[i, j] - mean_x[j]) / sd_x[j]; + } + } + d = 4; // degrees of freedom for t +} +parameters { + real beta0; + vector[p] beta; + real sigmasq; +} +transformed parameters { + real sigma; + vector[N] mu; + + sigma = sqrt(d * sigmasq / (d - 2)); // t errors on d degrees of freedom + mu = beta0 + z * beta; +} +model { + beta0 ~ normal(0, 316); + beta ~ normal(0, 316); + sigmasq ~ inv_gamma(.001, .001); + Y ~ student_t(d, mu, sqrt(sigmasq)); +} +generated quantities { + real b0; + vector[p] b; + real outlier_3; + real outlier_4; + real outlier_21; + + for (j in 1 : p) { + b[j] = beta[j] / sd_x[j]; + } + b0 = beta0 - mean_x * b; + + outlier_3 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_4 = step(abs((Y[4] - mu[4]) / sigma) - 2.5); + outlier_21 = step(abs((Y[21] - mu[21]) / sigma) - 2.5); +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.data.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.data.R new file mode 100644 index 000000000..21605c465 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.data.R @@ -0,0 +1,13 @@ +p <- +3 +N <- +21 +Y <- +c(43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, +7, 8, 8, 9, 15, 15) +x <- +structure(c(80, 80, 75, 62, 62, 62, 62, 62, 59, 58, 58, 58, 58, +58, 50, 50, 50, 50, 50, 56, 70, 27, 27, 25, 24, 22, 23, 24, 24, +23, 18, 18, 17, 18, 19, 18, 18, 19, 19, 20, 20, 20, 89, 88, 90, +87, 87, 87, 93, 93, 87, 80, 89, 88, 82, 93, 89, 86, 72, 79, 80, +82, 91), .Dim = c(21, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.data.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.data.json new file mode 100644 index 000000000..58ac90a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.data.json @@ -0,0 +1,28 @@ +{ + "Y": [43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, 7, 8, 8, 9, 15, 15], + "x": [ + [80, 27, 89], + [80, 27, 88], + [75, 25, 90], + [62, 24, 87], + [62, 22, 87], + [62, 23, 87], + [62, 24, 93], + [62, 24, 93], + [59, 23, 87], + [58, 18, 80], + [58, 18, 89], + [58, 17, 88], + [58, 18, 82], + [58, 19, 93], + [50, 18, 89], + [50, 18, 86], + [50, 19, 72], + [50, 19, 79], + [50, 20, 80], + [56, 20, 82], + [70, 20, 91] + ], + "N": 21, + "p": 3 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.init.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.init.R new file mode 100644 index 000000000..2f3f33322 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.init.R @@ -0,0 +1,4 @@ +beta0 <- 10 +beta <- c(0, 0, 0) +sigmasq <- 10 +phi <- 0.316 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.init.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.init.json new file mode 100644 index 000000000..7cf148309 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.init.json @@ -0,0 +1,6 @@ +{ + "beta0": 10, + "beta": [0, 0, 0], + "phi": 0.316, + "sigmasq": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.stan b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.stan new file mode 100644 index 000000000..89dd08325 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_d_normal_ridge.stan @@ -0,0 +1,59 @@ +// Stacks: robust regression and ridge regression +// http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html +// Model d) normal error ridge regression + +data { + int N; + int p; + array[N] real Y; + matrix[N, p] x; +} +// to standardize the x's +transformed data { + matrix[N, p] z; + row_vector[p] mean_x; + array[p] real sd_x; + for (j in 1 : p) { + mean_x[j] = mean(col(x, j)); + sd_x[j] = sd(col(x, j)); + for (i in 1 : N) { + z[i, j] = (x[i, j] - mean_x[j]) / sd_x[j]; + } + } +} +parameters { + real beta0; + vector[p] beta; + real sigmasq; + real phi; +} +transformed parameters { + real sigma; + vector[N] mu; + + sigma = sqrt(sigmasq); + mu = beta0 + z * beta; +} +model { + beta0 ~ normal(0, 316); + phi ~ gamma(0.01, 0.01); + beta ~ normal(0, sqrt(phi)); + sigmasq ~ inv_gamma(.001, .001); + Y ~ normal(mu, sigma); +} +generated quantities { + real b0; + vector[p] b; + real outlier_3; + real outlier_4; + real outlier_21; + + for (j in 1 : p) { + b[j] = beta[j] / sd_x[j]; + } + b0 = beta0 - mean_x * b; + + outlier_3 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_4 = step(abs((Y[4] - mu[4]) / sigma) - 2.5); + outlier_21 = step(abs((Y[21] - mu[21]) / sigma) - 2.5); +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.data.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.data.R new file mode 100644 index 000000000..21605c465 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.data.R @@ -0,0 +1,13 @@ +p <- +3 +N <- +21 +Y <- +c(43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, +7, 8, 8, 9, 15, 15) +x <- +structure(c(80, 80, 75, 62, 62, 62, 62, 62, 59, 58, 58, 58, 58, +58, 50, 50, 50, 50, 50, 56, 70, 27, 27, 25, 24, 22, 23, 24, 24, +23, 18, 18, 17, 18, 19, 18, 18, 19, 19, 20, 20, 20, 89, 88, 90, +87, 87, 87, 93, 93, 87, 80, 89, 88, 82, 93, 89, 86, 72, 79, 80, +82, 91), .Dim = c(21, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.data.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.data.json new file mode 100644 index 000000000..58ac90a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.data.json @@ -0,0 +1,28 @@ +{ + "Y": [43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, 7, 8, 8, 9, 15, 15], + "x": [ + [80, 27, 89], + [80, 27, 88], + [75, 25, 90], + [62, 24, 87], + [62, 22, 87], + [62, 23, 87], + [62, 24, 93], + [62, 24, 93], + [59, 23, 87], + [58, 18, 80], + [58, 18, 89], + [58, 17, 88], + [58, 18, 82], + [58, 19, 93], + [50, 18, 89], + [50, 18, 86], + [50, 19, 72], + [50, 19, 79], + [50, 20, 80], + [56, 20, 82], + [70, 20, 91] + ], + "N": 21, + "p": 3 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.init.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.init.R new file mode 100644 index 000000000..2f3f33322 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.init.R @@ -0,0 +1,4 @@ +beta0 <- 10 +beta <- c(0, 0, 0) +sigmasq <- 10 +phi <- 0.316 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.init.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.init.json new file mode 100644 index 000000000..7cf148309 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.init.json @@ -0,0 +1,6 @@ +{ + "beta0": 10, + "beta": [0, 0, 0], + "phi": 0.316, + "sigmasq": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.stan b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.stan new file mode 100644 index 000000000..7149f43df --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_e_dexp_ridge.stan @@ -0,0 +1,65 @@ +// Stacks: robust regression and ridge regression +// http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html +// Model e) double exponential error ridge regression + +data { + int N; + int p; + array[N] real Y; + matrix[N, p] x; +} +// to standardize the x's +transformed data { + array[N, p] real z; + array[p] real mean_x; + array[p] real sd_x; + for (j in 1 : p) { + mean_x[j] = mean(col(x, j)); + sd_x[j] = sd(col(x, j)); + for (i in 1 : N) { + z[i, j] = (x[i, j] - mean_x[j]) / sd_x[j]; + } + } +} +parameters { + real beta0; + array[p] real beta; + real sigmasq; + real phi; +} +transformed parameters { + real sigma; + array[N] real mu; + + sigma = sqrt(2) * sigmasq; + for (n in 1 : N) { + mu[n] = beta0 + beta[1] * z[n, 1] + beta[2] * z[n, 2] + beta[3] * z[n, 3]; + } +} +model { + beta0 ~ normal(0, 316); + phi ~ gamma(0.01, 0.01); + beta ~ normal(0, sqrt(phi)); + sigmasq ~ inv_gamma(.001, .001); + for (n in 1 : N) { + Y[n] ~ double_exponential(mu[n], sigmasq); + } +} +generated quantities { + real b0; + array[p] real b; + real outlier_1; + real outlier_3; + real outlier_4; + real outlier_21; + + for (j in 1 : p) { + b[j] = beta[j] / sd_x[j]; + } + b0 = beta0 - b[1] * mean_x[1] - b[2] * mean_x[2] - b[3] * mean_x[3]; + + outlier_1 = step(abs((Y[1] - mu[1]) / sigma) - 2.5); + outlier_3 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_4 = step(abs((Y[4] - mu[4]) / sigma) - 2.5); + outlier_21 = step(abs((Y[21] - mu[21]) / sigma) - 2.5); +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.data.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.data.R new file mode 100644 index 000000000..21605c465 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.data.R @@ -0,0 +1,13 @@ +p <- +3 +N <- +21 +Y <- +c(43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, +7, 8, 8, 9, 15, 15) +x <- +structure(c(80, 80, 75, 62, 62, 62, 62, 62, 59, 58, 58, 58, 58, +58, 50, 50, 50, 50, 50, 56, 70, 27, 27, 25, 24, 22, 23, 24, 24, +23, 18, 18, 17, 18, 19, 18, 18, 19, 19, 20, 20, 20, 89, 88, 90, +87, 87, 87, 93, 93, 87, 80, 89, 88, 82, 93, 89, 86, 72, 79, 80, +82, 91), .Dim = c(21, 3)) diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.data.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.data.json new file mode 100644 index 000000000..58ac90a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.data.json @@ -0,0 +1,28 @@ +{ + "Y": [43, 37, 37, 28, 18, 18, 19, 20, 15, 14, 14, 13, 11, 12, 8, 7, 8, 8, 9, 15, 15], + "x": [ + [80, 27, 89], + [80, 27, 88], + [75, 25, 90], + [62, 24, 87], + [62, 22, 87], + [62, 23, 87], + [62, 24, 93], + [62, 24, 93], + [59, 23, 87], + [58, 18, 80], + [58, 18, 89], + [58, 17, 88], + [58, 18, 82], + [58, 19, 93], + [50, 18, 89], + [50, 18, 86], + [50, 19, 72], + [50, 19, 79], + [50, 20, 80], + [56, 20, 82], + [70, 20, 91] + ], + "N": 21, + "p": 3 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.init.R b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.init.R new file mode 100644 index 000000000..2f3f33322 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.init.R @@ -0,0 +1,4 @@ +beta0 <- 10 +beta <- c(0, 0, 0) +sigmasq <- 10 +phi <- 0.316 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.init.json b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.init.json new file mode 100644 index 000000000..7cf148309 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.init.json @@ -0,0 +1,6 @@ +{ + "beta0": 10, + "beta": [0, 0, 0], + "phi": 0.316, + "sigmasq": 10 +} diff --git a/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.stan b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.stan new file mode 100644 index 000000000..efe128a23 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/stacks/stacks_f_t4_ridge.stan @@ -0,0 +1,64 @@ +// Stacks: robust regression and ridge regression +// http://mathstat.helsinki.fi/openbugs/Examples/Stacks.html +// Model f) t error ridge regression + +data { + int N; + int p; + array[N] real Y; + matrix[N, p] x; +} +// to standardize the x's +transformed data { + matrix[N, p] z; + row_vector[p] mean_x; + array[p] real sd_x; + real d; + + for (j in 1 : p) { + mean_x[j] = mean(col(x, j)); + sd_x[j] = sd(col(x, j)); + for (i in 1 : N) { + z[i, j] = (x[i, j] - mean_x[j]) / sd_x[j]; + } + } + d = 4; // degrees of freedom for t +} +parameters { + real beta0; + vector[p] beta; + real sigmasq; + real phi; +} +transformed parameters { + real sigma; + vector[N] mu; + + sigma = sqrt(d * sigmasq / (d - 2)); // t errors on d degrees of freedom + mu = beta0 + z * beta; +} +model { + beta0 ~ normal(0, 316); + phi ~ gamma(0.01, 0.01); + beta ~ normal(0, sqrt(phi)); + sigmasq ~ inv_gamma(.001, .001); + Y ~ student_t(d, mu, sqrt(sigmasq)); +} +generated quantities { + real b0; + vector[p] b; + real outlier_1; + real outlier_3; + real outlier_4; + real outlier_21; + + for (j in 1 : p) { + b[j] = beta[j] / sd_x[j]; + } + b0 = beta0 - mean_x * b; + + outlier_1 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_3 = step(abs((Y[3] - mu[3]) / sigma) - 2.5); + outlier_4 = step(abs((Y[4] - mu[4]) / sigma) - 2.5); + outlier_21 = step(abs((Y[21] - mu[21]) / sigma) - 2.5); +} diff --git a/benchmark/stan/bugs_examples/vol1/surgical/post.R b/benchmark/stan/bugs_examples/vol1/surgical/post.R new file mode 100644 index 000000000..a2fc1a080 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/post.R @@ -0,0 +1,34 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#')[, -(1:3)] +summary(as.mcmc(post)) + +# run in JAGS, BUGSExamples is needed. +# BUGSExamples package is installed by +# install.packages("BUGSExamples", repos = "http://R-Forge.R-project.org") + +if (!is.element("BUGSExamples", installed.packages()[, 1])) { + cat("Package BUGSExamples is not installed. It is used to get", + "the results from JAGS.", sep = '\n') + quit(); +} + + +## For some reason, the package BUGSExamples could not +## run this example. + +library(BUGSExamples) +# the simple model +ex <- list(name = "Surgical", parameters = c("p"), + nSample = 2000, nBurnin = 500, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) + + +ex <- list(name = "Surgicalrand", parameters = c("p", "mu", "sigma", "pop.mean"), + nSample = 2000, nBurnin = 500, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical.R b/benchmark/stan/bugs_examples/vol1/surgical/surgical.R new file mode 100644 index 000000000..68f34468a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical.R @@ -0,0 +1,65 @@ +# BUGS surgical example (Vol 1, Example 4) +# http://www.mrc-bsu.cam.ac.uk/wp-content/uploads/WinBUGS_Vol1.pdf +library(rstan) +rstan_options(auto_write = TRUE) +options(mc.cores = parallel::detectCores(logical = FALSE)) +chains = 4 +iter = 1000 +set.seed(4711) + +sourceToList = function(file){ + source(file, local = TRUE) + d = mget(ls()) + d$file = NULL + d +} +# Data are the same for all models +data = sourceToList("surgical.data.R") +init = rep(list(sourceToList("surgical.init.R")), chains) + +# Original init +surgical = stan(file = "surgical.stan", data = data, chains = chains, + init = init, iter = iter) +plot(surgical, ask = FALSE) + +surgical_summary = summary(surgical,probs = c(.025,0.975), + pars = "p")$summary[,c(1,3,4,5,6)] + +# Stanified, default random init +surgical_stanified = stan(file = "surgical_stanified.stan", data = data, chains = chains, + iter = iter) +plot(surgical_stanified, ask = FALSE) +surgical_stanified_summary = + summary(surgical_stanified,probs = c(.025,0.975), + pars = "p")$summary[,c(1,3,4,5,6)] + +# Stanified has better n_eff, no big differences otherwise +(surgical_summary) +(surgical_stanified_summary) + +# Plot Figure 6 in manual +library(ggplot2) +theme_set(theme_bw()) +sss = data.frame(surgical_stanified_summary[,c(1,3,4)]) +sss$hospital = as.factor(paste0(LETTERS[1:length(data$n)],"(",data$r,"/",data$n,")")) +colnames(sss)[2:3] = c("min","max") +sss$hospital = reorder(sss$hospital, sss$min) +pop_mean = get_posterior_mean(surgical_stanified, pars="pop_mean")[,"mean-all chains"] +ggplot(data = sss) + + geom_errorbarh(aes(y = hospital, x = mean, xmin = min, xmax = max), size = 1, height = .2) + + geom_point(aes(y = hospital, x = mean), shape = 21, fill = "white", size = 4) + + xlab("Proportion of deaths") + geom_vline(xintercept = pop_mean, col = "gray") + + ggtitle("BUGS Vol 1, Example 4: Hospital mortality") + +# Figure 7 in manual +ssr = data.frame(summary(surgical_stanified,probs = c(.025,0.975), + pars = "ranks")$summary[,c(1,4,5)]) +ssr$hospital = as.factor(paste0(LETTERS[1:length(data$n)],"(",data$r,"/",data$n,")")) +colnames(ssr)[2:3] = c("min","max") +ssr$hospital = reorder(ssr$hospital, ssr$mean) +ggplot(data = ssr) + + geom_errorbarh(aes(y = hospital, x = mean, xmin = min, xmax = max), size = 1, height = .2) + + geom_point(aes(y = hospital, x = mean), shape = 21, fill = "white", size = 4) + + xlab("Rank of Hospital") + + ggtitle("BUGS Vol 1, Example 4: Hospital mortality") + diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical.data.R b/benchmark/stan/bugs_examples/vol1/surgical/surgical.data.R new file mode 100644 index 000000000..3dc64a15e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical.data.R @@ -0,0 +1,3 @@ +n <- c(47, 148, 119, 810, 211, 196, 148, 215, 207, 97, 256, 360) +r <- c(0, 18, 8, 46, 8, 13, 9, 31, 14, 8, 29, 24) +N <- 12 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical.data.json b/benchmark/stan/bugs_examples/vol1/surgical/surgical.data.json new file mode 100644 index 000000000..603cf5c08 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical.data.json @@ -0,0 +1,5 @@ +{ + "N": 12, + "n": [47, 148, 119, 810, 211, 196, 148, 215, 207, 97, 256, 360], + "r": [0, 18, 8, 46, 8, 13, 9, 31, 14, 8, 29, 24] +} diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical.init.R b/benchmark/stan/bugs_examples/vol1/surgical/surgical.init.R new file mode 100644 index 000000000..c65b31b92 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical.init.R @@ -0,0 +1,3 @@ +b <- c( 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1) +sigmasq <- 1 +mu <- 0 diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical.init.json b/benchmark/stan/bugs_examples/vol1/surgical/surgical.init.json new file mode 100644 index 000000000..1ca7721fd --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical.init.json @@ -0,0 +1,5 @@ +{ + "mu": 0, + "b": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], + "sigmasq": 1 +} diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical.stan b/benchmark/stan/bugs_examples/vol1/surgical/surgical.stan new file mode 100644 index 000000000..da31b0cca --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical.stan @@ -0,0 +1,30 @@ +//# http://openbugs.net/Examples/Surgical.html +//# random effects model +data { + int N; + array[N] int r; + array[N] int n; +} +parameters { + real mu; + real sigmasq; + array[N] real b; +} +transformed parameters { + real sigma; + array[N] real p; + sigma = sqrt(sigmasq); + for (i in 1 : N) { + p[i] = inv_logit(b[i]); + } +} +model { + mu ~ normal(0.0, 1000.0); + sigmasq ~ inv_gamma(0.001, 0.001); + b ~ normal(mu, sigma); + r ~ binomial_logit(n, b); +} +generated quantities { + real pop_mean; + pop_mean = inv_logit(mu); +} diff --git a/benchmark/stan/bugs_examples/vol1/surgical/surgical_stanified.stan b/benchmark/stan/bugs_examples/vol1/surgical/surgical_stanified.stan new file mode 100644 index 000000000..054dceb3e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol1/surgical/surgical_stanified.stan @@ -0,0 +1,30 @@ +// http://openbugs.net/Examples/Surgical.html +// random effects model +// Stanified: use sigma instead of squared, move p to generated quantitites +// Narrower priors on mu and sigma +data { + int N; + array[N] int r; + array[N] int n; +} +parameters { + real mu; + array[N] real b; + real sigma; +} +model { + mu ~ normal(0.0, 20); + sigma ~ cauchy(0, 1); // remove sigma-squared + b ~ normal(mu, sigma); + r ~ binomial_logit(n, b); +} +generated quantities { + array[N] real p; + array[N] real ranks; + real pop_mean; + pop_mean = inv_logit(mu); + for (i in 1 : N) { + p[i] = inv_logit(b[i]); + ranks[i] = rank(b, i); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/air/air.data.R b/benchmark/stan/bugs_examples/vol2/air/air.data.R new file mode 100644 index 000000000..4bb240882 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/air/air.data.R @@ -0,0 +1,10 @@ +"alpha" <- 4.48 +"beta" <- 0.76 +"sigma2" <- 81.14 +"J" <- 3 +"y" <- +c(21, 20, 15) +"n" <- +c(48, 34, 21) +"Z" <- +c(10, 30, 50) diff --git a/benchmark/stan/bugs_examples/vol2/air/air.data.json b/benchmark/stan/bugs_examples/vol2/air/air.data.json new file mode 100644 index 000000000..50f42f160 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/air/air.data.json @@ -0,0 +1,9 @@ +{ + "sigma2": 81.14, + "Z": [10, 30, 50], + "alpha": 4.48, + "y": [21, 20, 15], + "J": 3, + "beta": 0.76, + "n": [48, 34, 21] +} diff --git a/benchmark/stan/bugs_examples/vol2/air/air.stan b/benchmark/stan/bugs_examples/vol2/air/air.stan new file mode 100644 index 000000000..c95ac78a5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/air/air.stan @@ -0,0 +1,25 @@ +data { + real alpha; + real beta; + real sigma2; + int J; + array[J] int y; + vector[J] Z; + array[J] int n; +} +transformed data { + real sigma; + sigma = sqrt(sigma2); +} +parameters { + real theta1; + real theta2; + vector[J] X; +} +model { + array[J] real p; + theta1 ~ normal(0, 32); // 32^2 = 1024 + theta2 ~ normal(0, 32); + X ~ normal(alpha + beta * Z, sigma); + y ~ binomial_logit(n, theta1 + theta2 * X); +} diff --git a/benchmark/stan/bugs_examples/vol2/air/makefile b/benchmark/stan/bugs_examples/vol2/air/makefile new file mode 100644 index 000000000..36a3e675f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/air/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = air +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample num_warmup=1000 num_samples=10000 + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/air/post.R b/benchmark/stan/bugs_examples/vol2/air/post.R new file mode 100644 index 000000000..7f7148fb7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/air/post.R @@ -0,0 +1,27 @@ + +library(coda) +J <- 3; +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#')[, -(1:3)] +summary(as.mcmc(post)) + +# run in JAGS +library(BUGSExamples) + + +# theta0 <- theta[1] - theta[2] * mean(X) +ex <- list(name = "Air", parameters = c("theta[1]", "theta[2]", paste("X[", 1:J, "]", sep = '')), + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3); + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) + + +# P.S. (from the Readme of the corresponding JAGS example) +# ----- +# The posterior distributions of theta0 and theta have a very heavy tail. +# Excursions into the tail are rare, but have a strong influence on +# the mean. +# +# theta0 <- theta[1] - theta[2] * mean(X) + diff --git a/benchmark/stan/bugs_examples/vol2/alli/alli1.stan.old b/benchmark/stan/bugs_examples/vol2/alli/alli1.stan.old new file mode 100644 index 000000000..20f979082 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/alli1.stan.old @@ -0,0 +1,7 @@ + +# Alligators: multinomial - logistic regression +# http://www.openbugs.net/Examples/Aligators.html + +## specify the model using multinomial distribution + + diff --git a/benchmark/stan/bugs_examples/vol2/alli/alli2.data.R b/benchmark/stan/bugs_examples/vol2/alli/alli2.data.R new file mode 100644 index 000000000..871351cd5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/alli2.data.R @@ -0,0 +1,10 @@ +I <- +4 +J <- +2 +K <- +5 +X <- +structure(c(23, 5, 5, 16, 7, 13, 8, 17, 4, 11, 11, 19, 0, 8, +7, 1, 2, 1, 2, 1, 1, 6, 6, 0, 2, 0, 1, 2, 3, 1, 3, 1, 8, 3, 5, +3, 5, 0, 5, 3), .Dim = c(4, 2, 5)) diff --git a/benchmark/stan/bugs_examples/vol2/alli/alli2.data.json b/benchmark/stan/bugs_examples/vol2/alli/alli2.data.json new file mode 100644 index 000000000..7d828b031 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/alli2.data.json @@ -0,0 +1,23 @@ +{ + "X": [ + [ + [23, 4, 2, 2, 8], + [7, 0, 1, 3, 5] + ], + [ + [5, 11, 1, 0, 3], + [13, 8, 6, 1, 0] + ], + [ + [5, 11, 2, 1, 5], + [8, 7, 6, 3, 5] + ], + [ + [16, 19, 1, 2, 3], + [17, 1, 0, 1, 3] + ] + ], + "I": 4, + "J": 2, + "K": 5 +} diff --git a/benchmark/stan/bugs_examples/vol2/alli/alli2.init.R b/benchmark/stan/bugs_examples/vol2/alli/alli2.init.R new file mode 100644 index 000000000..848328ec4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/alli2.init.R @@ -0,0 +1,12 @@ +alpha0 <- c(0,0,0,0) +beta0 <- structure(c(0,0,0,0, + 0,0,0,0, + 0,0,0,0), + .Dim=c(3,4)) +gamma0 <- structure(c(0,0,0,0), + .Dim=c(1,4)) +lambda <- structure(c(0,0,0,0, + 0,0,0,0), + .Dim=c(4,2)) + + diff --git a/benchmark/stan/bugs_examples/vol2/alli/alli2.init.json b/benchmark/stan/bugs_examples/vol2/alli/alli2.init.json new file mode 100644 index 000000000..e85a52590 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/alli2.init.json @@ -0,0 +1,17 @@ +{ + "gamma0": [ + [0, 0, 0, 0] + ], + "beta0": [ + [0, 0, 0, 0], + [0, 0, 0, 0], + [0, 0, 0, 0] + ], + "lambda": [ + [0, 0], + [0, 0], + [0, 0], + [0, 0] + ], + "alpha0": [0, 0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/alli/alli2.stan b/benchmark/stan/bugs_examples/vol2/alli/alli2.stan new file mode 100644 index 000000000..bdf949f92 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/alli2.stan @@ -0,0 +1,101 @@ +// Alligators: multinomial - logistic regression +// http://www.openbugs.net/Examples/Aligators.html + +//# specify the model using Poisson distribution + +data { + int I; // 4 + int J; // 2 + int K; // 5 + array[I, J, K] int X; +} +parameters { + vector[K - 1] alpha0; + matrix[I - 1, K - 1] beta0; + matrix[J - 1, K - 1] gamma0; + matrix[I, J] lambda; +} +transformed parameters { + vector[K] alpha; + array[I] vector[K] beta; + array[J] vector[K] gamma; + + alpha[1] = 0; + for (k in 1 : (K - 1)) { + alpha[k + 1] = alpha0[k]; + } + + for (i in 1 : I) { + beta[i, 1] = 0; + } + for (k in 1 : K) { + beta[1, k] = 0; + } + + for (i in 1 : (I - 1)) { + for (k in 1 : (K - 1)) { + beta[i + 1, k + 1] = beta0[i, k]; + } + } + + for (j in 1 : J) { + gamma[j, 1] = 0; + } + for (k in 1 : K) { + gamma[1, k] = 0; + } + + for (j in 1 : (J - 1)) { + for (k in 1 : (K - 1)) { + gamma[j + 1, k + 1] = gamma0[j, k]; + } + } +} +model { + for (k in 2 : K) { + alpha[k] ~ normal(0, 320); + for (i in 2 : I) { + beta[i, k] ~ normal(0, 320); + } + for (j in 2 : J) { + gamma[j, k] ~ normal(0, 320); + } + } + + // LIKELIHOOD + for (i in 1 : I) { + for (j in 1 : J) { + lambda[i, j] ~ normal(0, 320); + X[i, j] ~ poisson_log(lambda[i, j] + alpha + beta[i] + gamma[j]); + } + } +} +generated quantities { + matrix[I, K] b; + matrix[J, K] g; + + for (k in 1 : K) { + for (i in 1 : I) { + b[i, k] = beta[i, k]; + } + for (j in 1 : J) { + g[j, k] = gamma[j, k]; + } + } + + for (k in 1 : K) { + real mean_beta_k; + mean_beta_k = mean(col(b, k)); + for (i in 1 : I) { + b[i, k] = beta[i, k] - mean_beta_k; + } + } + + for (k in 1 : K) { + real mean_gamma_k; + mean_gamma_k = mean(col(g, k)); + for (j in 1 : J) { + g[j, k] = gamma[j, k] - mean_gamma_k; + } + } +} diff --git a/benchmark/stan/bugs_examples/vol2/alli/makefile b/benchmark/stan/bugs_examples/vol2/alli/makefile new file mode 100644 index 000000000..e3cc80bdd --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = alli2# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) --data=$(PGM).data.R --samples=samples.csv + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/alli/post.R b/benchmark/stan/bugs_examples/vol2/alli/post.R new file mode 100644 index 000000000..8b7a6eae7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/alli/post.R @@ -0,0 +1,35 @@ +# +library(coda) +I <- 4 +J <- 2 +K <- 5 +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#')[, -(1:3)] + +tmpfun <- function(x, y) { + paste("[", x, ", ", y, "]", sep = ''); +} + +# summary(as.mcmc(post[-(1:1000),])) ## for save_warmup=1 +summary(as.mcmc(post)) + +library(BUGSExamples); +pars <- c("alpha", "beta", "gamma"); +ex <- list(name = "Alligators", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +plot(jagspost$coda); + + +# note that in the stan version of this example, +# alpha[1] corresponds to alpha[2] in JAGS in which alpha[1] = 0, +# and the same for other parameters. + +library(rstan) + +fit <- rstan:::read_stan_csv('samples.csv') +print(fit, digits = 4) + + diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.data.R b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.data.R new file mode 100644 index 000000000..c487eb124 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.data.R @@ -0,0 +1,4 @@ +x <- c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839) +n <- c(59, 60, 62, 56, 63, 59, 62, 60) +r <- c(6, 13, 18, 28, 52, 53, 61, 60) +N <- 8 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.data.json b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.data.json new file mode 100644 index 000000000..49e8984e9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.data.json @@ -0,0 +1,6 @@ +{ + "x": [1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.861, 1.8839], + "N": 8, + "n": [59, 60, 62, 56, 63, 59, 62, 60], + "r": [6, 13, 18, 28, 52, 53, 61, 60] +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.init.R b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.init.R new file mode 100644 index 000000000..ac6a01ede --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.init.R @@ -0,0 +1,3 @@ +alpha_star <- 0 +beta <- 0 + diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.init.json b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.init.json new file mode 100644 index 000000000..d927f5bfc --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.init.json @@ -0,0 +1,4 @@ +{ + "beta": 0, + "alpha_star": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.stan b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.stan new file mode 100644 index 000000000..9ffaa1385 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_cloglog.stan @@ -0,0 +1,37 @@ +data { + int N; + array[N] int n; + array[N] int r; + vector[N] x; +} +transformed data { + vector[N] centered_x; + real mean_x; + mean_x = mean(x); + centered_x = x - mean_x; +} +parameters { + real alpha_star; + real beta; +} +transformed parameters { + array[N] real p; + for (i in 1 : N) { + p[i] = inv_cloglog(alpha_star + beta * centered_x[i]); + } +} +model { + alpha_star ~ normal(0.0, 1.0E4); + beta ~ normal(0.0, 1.0E4); + r ~ binomial(n, p); +} +generated quantities { + real alpha; + array[N] real llike; + array[N] real rhat; + alpha = alpha_star - beta * mean_x; + for (i in 1 : N) { + llike[i] = r[i] * log(p[i]) + (n[i] - r[i]) * log(1 - p[i]); + rhat[i] = p[i] * n[i]; // fitted values + } +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.data.R b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.data.R new file mode 100644 index 000000000..c487eb124 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.data.R @@ -0,0 +1,4 @@ +x <- c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839) +n <- c(59, 60, 62, 56, 63, 59, 62, 60) +r <- c(6, 13, 18, 28, 52, 53, 61, 60) +N <- 8 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.data.json b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.data.json new file mode 100644 index 000000000..49e8984e9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.data.json @@ -0,0 +1,6 @@ +{ + "x": [1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.861, 1.8839], + "N": 8, + "n": [59, 60, 62, 56, 63, 59, 62, 60], + "r": [6, 13, 18, 28, 52, 53, 61, 60] +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.init.R b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.init.R new file mode 100644 index 000000000..ac6a01ede --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.init.R @@ -0,0 +1,3 @@ +alpha_star <- 0 +beta <- 0 + diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.init.json b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.init.json new file mode 100644 index 000000000..d927f5bfc --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.init.json @@ -0,0 +1,4 @@ +{ + "beta": 0, + "alpha_star": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.stan b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.stan new file mode 100644 index 000000000..0c9a6d593 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_logit.stan @@ -0,0 +1,37 @@ +data { + int N; + array[N] int n; + array[N] int r; + vector[N] x; +} +transformed data { + vector[N] centered_x; + real mean_x; + mean_x = mean(x); + centered_x = x - mean_x; +} +parameters { + real alpha_star; + real beta; +} +transformed parameters { + vector[N] m; + m = alpha_star + beta * centered_x; +} +model { + alpha_star ~ normal(0.0, 1.0E4); + beta ~ normal(0.0, 1.0E4); + r ~ binomial_logit(n, m); +} +generated quantities { + real alpha; + array[N] real p; + array[N] real llike; + array[N] real rhat; + for (i in 1 : N) { + p[i] = inv_logit(m[i]); + llike[i] = r[i] * log(p[i]) + (n[i] - r[i]) * log(1 - p[i]); + rhat[i] = p[i] * n[i]; // fitted values + } + alpha = alpha_star - beta * mean_x; +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.data.R b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.data.R new file mode 100644 index 000000000..c487eb124 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.data.R @@ -0,0 +1,4 @@ +x <- c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839) +n <- c(59, 60, 62, 56, 63, 59, 62, 60) +r <- c(6, 13, 18, 28, 52, 53, 61, 60) +N <- 8 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.data.json b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.data.json new file mode 100644 index 000000000..49e8984e9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.data.json @@ -0,0 +1,6 @@ +{ + "x": [1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.861, 1.8839], + "N": 8, + "n": [59, 60, 62, 56, 63, 59, 62, 60], + "r": [6, 13, 18, 28, 52, 53, 61, 60] +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.init.R b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.init.R new file mode 100644 index 000000000..ac6a01ede --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.init.R @@ -0,0 +1,3 @@ +alpha_star <- 0 +beta <- 0 + diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.init.json b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.init.json new file mode 100644 index 000000000..d927f5bfc --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.init.json @@ -0,0 +1,4 @@ +{ + "beta": 0, + "alpha_star": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.stan b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.stan new file mode 100644 index 000000000..c7ff24791 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/beetles_probit.stan @@ -0,0 +1,39 @@ +data { + int N; + array[N] int n; + array[N] int r; + vector[N] x; +} +transformed data { + vector[N] centered_x; + real mean_x; + mean_x = mean(x); + centered_x = x - mean_x; +} +parameters { + real alpha_star; + real beta; +} +transformed parameters { + array[N] real p; + for (i in 1 : N) { + p[i] = Phi(alpha_star + beta * centered_x[i]); + } +} +model { + alpha_star ~ normal(0.0, 1.0); + beta ~ normal(0.0, 1.0E4); + r ~ binomial(n, p); +} +generated quantities { + real alpha; + array[N] real llike; + array[N] real rhat; + + alpha = alpha_star - beta * mean_x; + + for (i in 1 : N) { + llike[i] = r[i] * log(p[i]) + (n[i] - r[i]) * log(1 - p[i]); + rhat[i] = p[i] * n[i]; + } +} diff --git a/benchmark/stan/bugs_examples/vol2/beetles/makefile b/benchmark/stan/bugs_examples/vol2/beetles/makefile new file mode 100644 index 000000000..c4c929700 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/makefile @@ -0,0 +1,23 @@ +STAN_HOME = ../../../../.. +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +beetles_logit : + $(STAN_HOME)/bin/stanc --name=beetles_logit beetles_logit.stan + g++ -O0 -DNDEBUG $(CPPFLAGS) beetles_logit.cpp -o beetles_logit $(LIBFLAGS) + ./beetles_logit data=beetles_logit.data.R sample + +beetles_probit : + $(STAN_HOME)/bin/stanc --name=beetles_probit beetles_probit.stan + g++ -O0 -DNDEBUG $(CPPFLAGS) beetles_probit.cpp -o beetles_probit $(LIBFLAGS) + ./beetles_probit data=beetles_probit.data.R sample + +beetles_cloglog : + $(STAN_HOME)/bin/stanc --name=beetles_cloglog beetles_cloglog.stan + g++ -O0 -DNDEBUG $(CPPFLAGS) beetles_cloglog.cpp -o beetles_cloglog $(LIBFLAGS) + ./beetles_cloglog data=beetles_cloglog.data.R sample + +clean : + rm -f beetles*.cpp samples.csv beetles_logit beetles_probit beetles_cloglog diff --git a/benchmark/stan/bugs_examples/vol2/beetles/posterior_summary.R b/benchmark/stan/bugs_examples/vol2/beetles/posterior_summary.R new file mode 100644 index 000000000..9521af574 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/beetles/posterior_summary.R @@ -0,0 +1,16 @@ +## transform alpha.star back to alpha +## note that three models can be fitted, i.e., logit, probit and cloglog + +library(coda) +logit <- function(x) log(x / (1 - x)); +mean_x <- mean(c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839)) +psamp <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); +alpha <- psamp["alpha"]; beta <- psamp["beta"] +rhat <- psamp[paste("rhat", 1:8, sep=".")] +poi <- cbind(alpha, beta, rhat) + +poi <- as.mcmc(poi) +summary(poi) + + + diff --git a/benchmark/stan/bugs_examples/vol2/biopsies/biopsies.stan.0 b/benchmark/stan/bugs_examples/vol2/biopsies/biopsies.stan.0 new file mode 100644 index 000000000..b7c0ddb73 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/biopsies/biopsies.stan.0 @@ -0,0 +1 @@ +# http://www.openbugs.net/Examples/Biopsies.html diff --git a/benchmark/stan/bugs_examples/vol2/birats/birats.data.R b/benchmark/stan/bugs_examples/vol2/birats/birats.data.R new file mode 100644 index 000000000..d533cafbb --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/birats.data.R @@ -0,0 +1,22 @@ +N <- +30 +T <- +5 +y <- +structure(c(151, 145, 147, 155, 135, 159, 141, 159, 177, 134, +160, 143, 154, 171, 163, 160, 142, 156, 157, 152, 154, 139, 146, +157, 132, 160, 169, 157, 137, 153, 199, 199, 214, 200, 188, 210, +189, 201, 236, 182, 208, 188, 200, 221, 216, 207, 187, 203, 212, +203, 205, 190, 191, 211, 185, 207, 216, 205, 180, 200, 246, 249, +263, 237, 230, 252, 231, 248, 285, 220, 261, 220, 244, 270, 242, +248, 234, 243, 259, 246, 253, 225, 229, 250, 237, 257, 261, 248, +219, 244, 283, 293, 312, 272, 280, 298, 275, 297, 350, 260, 313, +273, 289, 326, 281, 288, 280, 283, 307, 286, 298, 267, 272, 285, +286, 303, 295, 289, 258, 286, 320, 354, 328, 297, 323, 331, 305, +338, 376, 296, 352, 314, 325, 358, 312, 324, 316, 317, 336, 321, +334, 302, 302, 323, 331, 345, 333, 316, 291, 324), .Dim = c(30, +5)) +x <- c(8.0, 15.0, 22.0, 29.0, 36.0) +xbar <- 22 +Omega <- +structure(c(0.005, 0, 0, 5), .Dim = c(2, 2)) diff --git a/benchmark/stan/bugs_examples/vol2/birats/birats.data.json b/benchmark/stan/bugs_examples/vol2/birats/birats.data.json new file mode 100644 index 000000000..084794407 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/birats.data.json @@ -0,0 +1,42 @@ +{ + "x": [8, 15, 22, 29, 36], + "Omega": [ + [0.005, 0], + [0, 5] + ], + "y": [ + [151, 199, 246, 283, 320], + [145, 199, 249, 293, 354], + [147, 214, 263, 312, 328], + [155, 200, 237, 272, 297], + [135, 188, 230, 280, 323], + [159, 210, 252, 298, 331], + [141, 189, 231, 275, 305], + [159, 201, 248, 297, 338], + [177, 236, 285, 350, 376], + [134, 182, 220, 260, 296], + [160, 208, 261, 313, 352], + [143, 188, 220, 273, 314], + [154, 200, 244, 289, 325], + [171, 221, 270, 326, 358], + [163, 216, 242, 281, 312], + [160, 207, 248, 288, 324], + [142, 187, 234, 280, 316], + [156, 203, 243, 283, 317], + [157, 212, 259, 307, 336], + [152, 203, 246, 286, 321], + [154, 205, 253, 298, 334], + [139, 190, 225, 267, 302], + [146, 191, 229, 272, 302], + [157, 211, 250, 285, 323], + [132, 185, 237, 286, 331], + [160, 207, 257, 303, 345], + [169, 216, 261, 295, 333], + [157, 205, 248, 289, 316], + [137, 180, 219, 258, 291], + [153, 200, 244, 286, 324] + ], + "xbar": 22, + "N": 30, + "T": 5 +} diff --git a/benchmark/stan/bugs_examples/vol2/birats/birats.init.R b/benchmark/stan/bugs_examples/vol2/birats/birats.init.R new file mode 100644 index 000000000..9ea16aaf1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/birats.init.R @@ -0,0 +1,17 @@ +mu_beta <- c(0,0) +sigmasq_y <- 1 +beta <- structure(c(100,100,100,100,100, + 100,100,100,100,100, + 100,100,100,100,100, + 100,100,100,100,100, + 100,100,100,100,100, + 100,100,100,100,100, + 6,6,6,6,6, + 6,6,6,6,6, + 6,6,6,6,6, + 6,6,6,6,6, + 6,6,6,6,6, + 6,6,6,6,6), + .Dim = c(30, 2)) +Sigma_beta <- structure(c(1,0,0,1), + .Dim=c(2,2)) diff --git a/benchmark/stan/bugs_examples/vol2/birats/birats.init.json b/benchmark/stan/bugs_examples/vol2/birats/birats.init.json new file mode 100644 index 000000000..2d0df3b76 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/birats.init.json @@ -0,0 +1,40 @@ +{ + "Sigma_beta": [ + [1, 0], + [0, 1] + ], + "beta": [ + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6], + [100, 6] + ], + "sigmasq_y": 1, + "mu_beta": [0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/birats/birats.stan b/benchmark/stan/bugs_examples/vol2/birats/birats.stan new file mode 100644 index 000000000..8fa3209b1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/birats.stan @@ -0,0 +1,45 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol2.pdf +// Page 23: Birats +//# + +data { + int N; + int T; + array[T] real x; + real xbar; + array[N, T] real y; + cov_matrix[2] Omega; +} +parameters { + array[N] vector[2] beta; + vector[2] mu_beta; + real sigmasq_y; + cov_matrix[2] Sigma_beta; +} +// transformed parameters { +// real rho; +// real alpha0; +// //rho <- Sigma_beta[1, 2] / sqrt(Sigma_beta[1, 1] * Sigma_beta[2, 2]); +// //alpha0 <- mu_beta[1] - mu_beta[2] * xbar; +// } +transformed parameters { + real sigma_y; + sigma_y = sqrt(sigmasq_y); +} +model { + sigmasq_y ~ inv_gamma(0.001, 0.001); + mu_beta ~ normal(0, 100); + Sigma_beta ~ inv_wishart(2, Omega); + for (n in 1 : N) { + beta[n] ~ multi_normal(mu_beta, Sigma_beta); + } + for (n in 1 : N) { + for (t in 1 : T) { + // centeralize x[] + // y[n,t] ~ normal(beta[n, 1] + beta[n, 2] * (x[t] - xbar), sqrt(sigmasq_y)); + + // NOT-centeralize x[] + y[n, t] ~ normal(beta[n, 1] + beta[n, 2] * x[t], sigma_y); + } + } +} diff --git a/benchmark/stan/bugs_examples/vol2/birats/makefile b/benchmark/stan/bugs_examples/vol2/birats/makefile new file mode 100644 index 000000000..b6f85bfc1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = birats +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) --data=$(PGM).data.R --iter=10000 + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/birats/post.R b/benchmark/stan/bugs_examples/vol2/birats/post.R new file mode 100644 index 000000000..bee5cc4a4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/birats/post.R @@ -0,0 +1,29 @@ +library(coda) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') + +beginwith <- function(vstr, patterns) { + patterns <- paste(patterns, ".*", sep = ''); + a <- lapply(patterns, FUN = function(p) {grep(p, vstr)}) + do.call("c", a) +} + + +sigma_beta <- post[, beginwith(colnames(post), "Sigma_beta\\.")] +inv_sigma_beta <- t(apply(sigma_beta, 1, FUN = function(x) { m <- matrix(x, ncol = 2); as.vector(solve(m))})) +colnames(inv_sigma_beta) <- paste('inv_', colnames(sigma_beta), sep = '') + +poi <- cbind(post[, c("mu_beta.1", "mu_beta.2", "sigma_y")], sigma_beta, inv_sigma_beta) +summary(as.mcmc(poi)) + +library(BUGSExamples); +pars <- c("mu.beta", "sigma", "R"); +ex <- list(name = "BiRats", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda); + + + + diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix.data.R b/benchmark/stan/bugs_examples/vol2/cervix/cervix.data.R new file mode 100644 index 000000000..9a8452130 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix.data.R @@ -0,0 +1,211 @@ +Ni <- +1929 +Nc <- +115 +dc <- +c(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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, 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, 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, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix.data.json b/benchmark/stan/bugs_examples/vol2/cervix/cervix.data.json new file mode 100644 index 000000000..e29ad9aed --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix.data.json @@ -0,0 +1,9 @@ +{ + "wc": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "wi": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix.stan.0 b/benchmark/stan/bugs_examples/vol2/cervix/cervix.stan.0 new file mode 100644 index 000000000..e6d3da8f2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix.stan.0 @@ -0,0 +1,60 @@ + +# Cervix: case - control study with errors in covariates +# http://www.openbugs.net/Examples/Cervix.html + +# from the JAGS readme in classic-bugs/vol2/cervix: + +## ``The epidemiology in this example is a little out of date. It is now known +## that Human Papillomavirus (HPV) is a necessary cause of cervical cancer. +## Although HSV-2 may have a role as a cofactor in some cases, trying to +## model its effect on cervical cancer without taking into account HPV is +## rather pointless.'' + + +# status: +# 1. there is discrete parameters +# + +## For the time being, the discrete parameters part are commented +## out so the only part of the data are modeled in this example. + +data { + int Nc; + int Ni; + int xc[Nc]; + int wc[Nc]; + int dc[Nc]; + int wi[Ni]; + int di[Ni]; +} + +parameters { + real phi[2, 2]; + real q; + real beta0C; + real beta; + # note that xi is discrete parameters with support {0, 1} + //int xi[Ni]; +} + +model { + for (n in 1:Nc) { + xc[n] ~ bernoulli(q); + dc[n] ~ bernoulli(inv_logit(beta0C + beta * xc[n])); + wc[n] ~ bernoulli(phi[xc[n] + 1, dc[n] + 1]); + } +/* + for (n in 1:Ni) { + xi[n] ~ bernoulli(q); + di[n] ~ bernoulli(inv_logit(beta0C + beta * xi[n])); + wi[n] ~ bernoulli(phi[xi[n] + 1, di[n] + 1]); + } +*/ + q ~ uniform(0, 1); + beta0C ~ normal(0, 320); + beta ~ normal(0, 320); + for (i in 1:2) for (j in 1:2) + phi[i, j] ~ uniform(0, 1); +} + + diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix2.data.R b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.data.R new file mode 100644 index 000000000..9a8452130 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.data.R @@ -0,0 +1,211 @@ +Ni <- +1929 +Nc <- +115 +dc <- +c(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, 1, 1, 1, 1, 1, 1, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0,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 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) diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix2.data.json b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.data.json new file mode 100644 index 000000000..e29ad9aed --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.data.json @@ -0,0 +1,9 @@ +{ + "wc": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "wi": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix2.init.R b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.init.R new file mode 100644 index 000000000..af5bcda8a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.init.R @@ -0,0 +1,4 @@ +beta0C <- 0 +beta <- 0 +q <- 0.5 +phi <- structure(c(.5,.5,.5,.5), .Dim = c(2, 2))) diff --git a/benchmark/stan/bugs_examples/vol2/cervix/cervix2.stan b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.stan new file mode 100644 index 000000000..49a093bc5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/cervix2.stan @@ -0,0 +1,62 @@ +// Cervix: case - control study with errors in covariates +// http://www.openbugs.net/Examples/Cervix.html + +// from the JAGS readme in classic-bugs/vol2/cervix: + +//# ``The epidemiology in this example is a little out of date. It is now known +//# that Human Papillomavirus (HPV) is a necessary cause of cervical cancer. +//# Although HSV-2 may have a role as a cofactor in some cases, trying to +//# model its effect on cervical cancer without taking into account HPV is +//# rather pointless.'' + +//# In this version, the binary missing x's are integrated out. + +data { + int Nc; + int Ni; + array[Nc] int xc; + array[Nc] int wc; + array[Nc] int dc; + array[Ni] int wi; + array[Ni] int di; +} +parameters { + array[2, 2] real phi; + real q; + real beta0C; + real beta; + // note that xi is discrete parameters with support {0, 1} + // integrated out here + //int xi[Ni]; +} +model { + for (n in 1 : Nc) { + xc[n] ~ bernoulli(q); + dc[n] ~ bernoulli_logit(beta0C + beta * xc[n]); + wc[n] ~ bernoulli(phi[xc[n] + 1, dc[n] + 1]); + } + for (n in 1 : Ni) { + // xi[n] ~ bernoulli(q); + di[n] ~ bernoulli(inv_logit(beta0C + beta) * q + + inv_logit(beta0C) * (1 - q)); + wi[n] ~ bernoulli(phi[1, di[n] + 1] * (1 - q) + phi[2, di[n] + 1] * q); + } + q ~ uniform(0, 1); + beta0C ~ normal(0, 320); + beta ~ normal(0, 320); + for (i in 1 : 2) { + for (j in 1 : 2) { + phi[i, j] ~ uniform(0, 1); + } + } +} +generated quantities { + real gamma1; + real gamma2; + // calculate gamma1 = P(x=1|d=0) and gamma2 = P(x=1|d=1) + gamma1 = 1 + / (1 + (1 + exp(beta0C + beta)) / (1 + exp(beta0C)) * (1 - q) / q); + gamma2 = 1 + / (1 + + (1 + exp(-beta0C - beta)) / (1 + exp(-beta0C)) * (1 - q) / q); +} diff --git a/benchmark/stan/bugs_examples/vol2/cervix/makefile b/benchmark/stan/bugs_examples/vol2/cervix/makefile new file mode 100644 index 000000000..374868976 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = cervix# +PGM = cervix2# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample num_samples=10000 num_warmup=1000 thin=1 + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/cervix/post.R b/benchmark/stan/bugs_examples/vol2/cervix/post.R new file mode 100644 index 000000000..b7386a545 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/cervix/post.R @@ -0,0 +1,15 @@ +library(coda) +library(BUGSExamples); + + +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#')[, -(1:3)] +summary(as.mcmc(post)) + +pars <- c("q", "beta0C", "beta", "phi") +ex <- list(name = "Cervix", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +# jagspost <- runExample(ex, engine = 'JAGS') +# summary(jagspost$coda) +# plot(jagspost$coda); diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.data.R b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.data.R new file mode 100644 index 000000000..5dc5d0676 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.data.R @@ -0,0 +1,8 @@ +"N" <- 27 +"x" <- +c(1, 1.5, 1.5, 1.5, 2.5, 4, 5, 5, 7, 8, 8.5, 9, 9.5, 9.5, 10, +12, 12, 13, 13, 14.5, 15.5, 15.5, 16.5, 17, 22.5, 29, 31.5) +"Y" <- +c(1.8, 1.85, 1.87, 1.77, 2.02, 2.27, 2.15, 2.26, 2.47, 2.19, +2.26, 2.4, 2.39, 2.41, 2.5, 2.32, 2.32, 2.43, 2.47, 2.56, 2.65, +2.47, 2.64, 2.56, 2.7, 2.72, 2.57) diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.data.json b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.data.json new file mode 100644 index 000000000..31456cdf2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.data.json @@ -0,0 +1,5 @@ +{ + "Y": [1.8, 1.85, 1.87, 1.77, 2.02, 2.27, 2.15, 2.26, 2.47, 2.19, 2.26, 2.4, 2.39, 2.41, 2.5, 2.32, 2.32, 2.43, 2.47, 2.56, 2.65, 2.47, 2.64, 2.56, 2.7, 2.72, 2.57], + "x": [1, 1.5, 1.5, 1.5, 2.5, 4, 5, 5, 7, 8, 8.5, 9, 9.5, 9.5, 10, 12, 12, 13, 13, 14.5, 15.5, 15.5, 16.5, 17, 22.5, 29, 31.5], + "N": 27 +} diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.init.R b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.init.R new file mode 100644 index 000000000..5999195e1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.init.R @@ -0,0 +1,4 @@ +alpha <- 1 +beta <- 1 +tau <- 1 +lambda <- 0.9 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.init.json b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.init.json new file mode 100644 index 000000000..12db001b8 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.init.json @@ -0,0 +1,6 @@ +{ + "alpha": 1, + "lambda": 0.9, + "tau": 1, + "beta": 1 +} diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.stan b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.stan new file mode 100644 index 000000000..cd2e3e57b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/dugongs.stan @@ -0,0 +1,37 @@ +// https://www.mrc-bsu.cam.ac.uk/wp-content/uploads/WinBUGS_Vol2.pdf +// Page 2: Dugongs +// +// +// note that in the original example, the parameter +// called gamma is called lambda here. +// + +data { + int N; + array[N] real x; + array[N] real Y; +} +parameters { + real alpha; + real beta; + real lambda; // orginal gamma in the JAGS example + real tau; +} +transformed parameters { + real sigma; + real U3; + sigma = 1 / sqrt(tau); + U3 = logit(lambda); +} +model { + array[N] real m; + for (i in 1 : N) { + m[i] = alpha - beta * pow(lambda, x[i]); + } + Y ~ normal(m, sigma); + + alpha ~ normal(0.0, 1000); + beta ~ normal(0.0, 1000); + lambda ~ uniform(.5, 1); + tau ~ gamma(.0001, .0001); +} diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/makefile b/benchmark/stan/bugs_examples/vol2/dugongs/makefile new file mode 100644 index 000000000..9a9db84d9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = dugongs +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/dugongs/post.R b/benchmark/stan/bugs_examples/vol2/dugongs/post.R new file mode 100644 index 000000000..d4f7bd473 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/dugongs/post.R @@ -0,0 +1,35 @@ +## take a look at the samples and compare with results computed +## in other program. + + +library(coda) +logit <- function(x) log(x / (1 - x)); + +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +U3 <- logit(post[, 'lambda']) +names(U3) <- "U3"; + +sigma <- 1 / sqrt(post[, "tau"]) +names(sigma) <- "sigma" + +poi <- cbind(U3, post[, c("alpha", "beta", "lambda")], sigma); + +poi <- as.mcmc(poi) +summary(poi) + + +# copied from jags example +# changed the name of gamma to lambda +"benchstats" <- +structure(c(1.86734593050999, 2.65550706999999, 0.976866162000004, +0.862622853, 0.0993965308999997, 0.288028864815654, 0.0738703034051412, +0.0788082243785414, 0.0361326586182234, 0.0155265477362125, 0.00288028864815654, +0.000738703034051412, 0.000788082243785414, 0.000361326586182234, +0.000155265477362125, 0.00505762524854399, 0.00129773683846219, +0.00135515901718672, 0.000634560717168502, 0.000184674606469514 +), .Dim = as.integer(c(5, 4)), .Dimnames = list(c("U3", "alpha", +"beta", "lambda", "sigma"), c("Mean", "SD", "Naive SE", "Time-series SE" +))) + +print(benchstats) diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo1.data.R b/benchmark/stan/bugs_examples/vol2/endo/endo1.data.R new file mode 100644 index 000000000..892d3662b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo1.data.R @@ -0,0 +1,10 @@ +n10 <- +43 +n01 <- +7 +n11 <- +12 +I <- +183 +J <- +2 diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo1.data.json b/benchmark/stan/bugs_examples/vol2/endo/endo1.data.json new file mode 100644 index 000000000..c9be03847 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo1.data.json @@ -0,0 +1,7 @@ +{ + "n01": 7, + "I": 183, + "J": 2, + "n10": 43, + "n11": 12 +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo1.init.R b/benchmark/stan/bugs_examples/vol2/endo/endo1.init.R new file mode 100644 index 000000000..133667bc0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo1.init.R @@ -0,0 +1 @@ +beta <- 0 diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo1.init.json b/benchmark/stan/bugs_examples/vol2/endo/endo1.init.json new file mode 100644 index 000000000..5585dcf5d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo1.init.json @@ -0,0 +1,3 @@ +{ + "beta": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo1.stan b/benchmark/stan/bugs_examples/vol2/endo/endo1.stan new file mode 100644 index 000000000..51bbf6a93 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo1.stan @@ -0,0 +1,49 @@ +// Endo: conditional inference in case-contrl studies +// http://www.openbugs.net/Examples/Endo.html + +// In this example, three methods of different +// model specifications are used for one equivalent +// model. This is method 1. + +data { + int n10; + int n01; + int n11; + int I; +} +transformed data { + int J; + array[2, I] int Y; + array[2] vector[I] est; + vector[I] est1m2; + J = 2; + for (i in 1 : I) { + Y[1, i] = 1; + Y[2, i] = 0; + } + for (i in 1 : n10) { + est[1, i] = 1; + est[2, i] = 0; + } + for (i in (n10 + 1) : (n10 + n01)) { + est[1, i] = 0; + est[2, i] = 1; + } + for (i in (n10 + n01 + 1) : (n10 + n01 + n11)) { + est[1, i] = 1; + est[2, i] = 1; + } + for (i in (n10 + n01 + n11 + 1) : I) { + est[1, i] = 0; + est[2, i] = 0; + } + est1m2 = est[1] - est[2]; +} +parameters { + real beta; +} +model { + // METHOD 1: Logistic regression + beta ~ normal(0, 1000); + Y[1] ~ binomial_logit(1, beta * est1m2); +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo2.data.R b/benchmark/stan/bugs_examples/vol2/endo/endo2.data.R new file mode 100644 index 000000000..892d3662b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo2.data.R @@ -0,0 +1,10 @@ +n10 <- +43 +n01 <- +7 +n11 <- +12 +I <- +183 +J <- +2 diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo2.data.json b/benchmark/stan/bugs_examples/vol2/endo/endo2.data.json new file mode 100644 index 000000000..c9be03847 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo2.data.json @@ -0,0 +1,7 @@ +{ + "n01": 7, + "I": 183, + "J": 2, + "n10": 43, + "n11": 12 +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo2.init.R b/benchmark/stan/bugs_examples/vol2/endo/endo2.init.R new file mode 100644 index 000000000..133667bc0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo2.init.R @@ -0,0 +1 @@ +beta <- 0 diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo2.init.json b/benchmark/stan/bugs_examples/vol2/endo/endo2.init.json new file mode 100644 index 000000000..5585dcf5d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo2.init.json @@ -0,0 +1,3 @@ +{ + "beta": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo2.stan b/benchmark/stan/bugs_examples/vol2/endo/endo2.stan new file mode 100644 index 000000000..c7e019ad3 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo2.stan @@ -0,0 +1,61 @@ +/* + * Endo: conditional inference in case-contrl studies + * http://www.openbugs.net/Examples/Endo.html + * + * In this example, three methods of different + * model specifications are used for one equivalent + * model. This is method 2. + + * FIXME: using the multinomial specification + */ +data { + int n10; + int n01; + int n11; + int I; + int J; +} +transformed data { + array[I, 2] int Y; + array[I, 2] int est; + for (i in 1 : I) { + Y[i, 1] = 1; + Y[i, 2] = 0; + } + for (i in 1 : n10) { + est[i, 1] = 1; + est[i, 2] = 0; + } + for (i in (n10 + 1) : (n10 + n01)) { + est[i, 1] = 0; + est[i, 2] = 1; + } + for (i in (n10 + n01 + 1) : (n10 + n01 + n11)) { + est[i, 1] = 1; + est[i, 2] = 1; + } + for (i in (n10 + n01 + n11 + 1) : I) { + est[i, 1] = 0; + est[i, 2] = 0; + } +} +parameters { + real beta; +} +model { + array[I, 2] real p; + + // METHOD 2 - conditional likelihoods + beta ~ normal(0, 1000); + + for (i in 1 : I) { + p[i, 1] = exp(beta * est[i, 1]); + p[i, 2] = exp(beta * est[i, 2]); + p[i, 1] = p[i, 1] / (p[i, 1] + p[i, 2]); + p[i, 2] = 1 - p[i, 1]; + + // using the multinomial log-pmf explicitly + target += log(p[i, 1]) * Y[i, 1]; + target += log(p[i, 2]) * Y[i, 2]; + } +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo3.data.R b/benchmark/stan/bugs_examples/vol2/endo/endo3.data.R new file mode 100644 index 000000000..892d3662b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo3.data.R @@ -0,0 +1,10 @@ +n10 <- +43 +n01 <- +7 +n11 <- +12 +I <- +183 +J <- +2 diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo3.data.json b/benchmark/stan/bugs_examples/vol2/endo/endo3.data.json new file mode 100644 index 000000000..c9be03847 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo3.data.json @@ -0,0 +1,7 @@ +{ + "n01": 7, + "I": 183, + "J": 2, + "n10": 43, + "n11": 12 +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo3.init.R b/benchmark/stan/bugs_examples/vol2/endo/endo3.init.R new file mode 100644 index 000000000..cd8e7af4b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo3.init.R @@ -0,0 +1,20 @@ +beta <- 0 +beta0 <- c(0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0, + 0,0,0) diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo3.init.json b/benchmark/stan/bugs_examples/vol2/endo/endo3.init.json new file mode 100644 index 000000000..98470c4a8 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo3.init.json @@ -0,0 +1,4 @@ +{ + "beta0": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "beta": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/endo3.stan b/benchmark/stan/bugs_examples/vol2/endo/endo3.stan new file mode 100644 index 000000000..841a76968 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/endo3.stan @@ -0,0 +1,51 @@ +// Endo: conditional inference in case-contrl studies +// http://www.openbugs.net/Examples/Endo.html + +// In this example, three methods of different +// model specifications are used for one equivalent +// model. This is method 3. + +data { + int n10; + int n01; + int n11; + int I; +} +transformed data { + int J; + array[2, I] int Y; + array[2] vector[I] est; + J = 2; + for (i in 1 : I) { + Y[1, i] = 1; + Y[2, i] = 0; + } + for (i in 1 : n10) { + est[1, i] = 1; + est[2, i] = 0; + } + for (i in (n10 + 1) : (n10 + n01)) { + est[1, i] = 0; + est[2, i] = 1; + } + for (i in (n10 + n01 + 1) : (n10 + n01 + n11)) { + est[1, i] = 1; + est[2, i] = 1; + } + for (i in (n10 + n01 + n11 + 1) : I) { + est[1, i] = 0; + est[2, i] = 0; + } +} +parameters { + real beta; + vector[I] beta0; +} +model { + // METHOD 3 fit standard Poisson regressions relative to baseline + beta ~ normal(0, 1000); + beta0 ~ normal(0, 1000); + for (j in 1 : J) { + Y[j] ~ poisson_log(beta0 + beta * est[j]); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/endo/makefile b/benchmark/stan/bugs_examples/vol2/endo/makefile new file mode 100644 index 000000000..b3d3b205c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/makefile @@ -0,0 +1,32 @@ +STAN_HOME = ../../../../.. +PGM = endo# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +.PHONY : one two three + +one : + $(STAN_HOME)/bin/stanc --name=$(PGM)1 $(PGM)1.stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM)1.cpp -o $(PGM)1 $(LIBFLAGS) + ./$(PGM)1 --data=$(PGM)1.data.R --samples=samples1.csv + +two : + $(STAN_HOME)/bin/stanc --name=$(PGM)2 $(PGM)2.stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM)2.cpp -o $(PGM)2 $(LIBFLAGS) + ./$(PGM)2 --data=$(PGM)2.data.R --samples=samples2.csv + +three : + $(STAN_HOME)/bin/stanc --name=$(PGM)3 $(PGM)3.stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM)3.cpp -o $(PGM)3 $(LIBFLAGS) + ./$(PGM)3 --data=$(PGM)3.data.R --samples=samples3.csv + +.PHONY : clean + +clean : + rm -f $(PGM)1.cpp samples1.csv $(PGM)1 + rm -f $(PGM)2.cpp samples2.csv $(PGM)2 + rm -f $(PGM)3.cpp samples3.csv $(PGM)3 diff --git a/benchmark/stan/bugs_examples/vol2/endo/post.R b/benchmark/stan/bugs_examples/vol2/endo/post.R new file mode 100644 index 000000000..3f2fdc039 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/endo/post.R @@ -0,0 +1,17 @@ +library(coda) +post <- read.csv(file = 'samples1.csv', header = TRUE, comment.char = '#') +poi <- post[, 'beta'] + +summary(as.mcmc(poi)); +quit('no') + + +library(BUGSExamples); +pars <- c("beta"); +ex <- list(name = "Endo", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +plot(jagspost$coda); diff --git a/benchmark/stan/bugs_examples/vol2/eyes/eyes.data.R b/benchmark/stan/bugs_examples/vol2/eyes/eyes.data.R new file mode 100644 index 000000000..fbee4009d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/eyes.data.R @@ -0,0 +1,11 @@ +N <- +48 +y <- +c(529, 530, 532, 533.1, 533.4, 533.6, 533.7, 534.1, 534.8, 535.3, +535.4, 535.9, 536.1, 536.3, 536.4, 536.6, 537, 537.4, 537.5, +538.3, 538.5, 538.6, 539.4, 539.6, 540.4, 540.8, 542, 542.8, +543, 543.5, 543.8, 543.9, 545.3, 546.2, 548.8, 548.7, 548.9, +549, 549.4, 549.9, 550.6, 551.2, 551.4, 551.5, 551.6, 552.8, +552.9, 553.2) +alpha <- +c(1., 1.) diff --git a/benchmark/stan/bugs_examples/vol2/eyes/eyes.data.json b/benchmark/stan/bugs_examples/vol2/eyes/eyes.data.json new file mode 100644 index 000000000..34e300e2e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/eyes.data.json @@ -0,0 +1,5 @@ +{ + "alpha": [1, 1], + "y": [529, 530, 532, 533.1, 533.4, 533.6, 533.7, 534.1, 534.8, 535.3, 535.4, 535.9, 536.1, 536.3, 536.4, 536.6, 537, 537.4, 537.5, 538.3, 538.5, 538.6, 539.4, 539.6, 540.4, 540.8, 542, 542.8, 543, 543.5, 543.8, 543.9, 545.3, 546.2, 548.8, 548.7, 548.9, 549, 549.4, 549.9, 550.6, 551.2, 551.4, 551.5, 551.6, 552.8, 552.9, 553.2], + "N": 48 +} diff --git a/benchmark/stan/bugs_examples/vol2/eyes/eyes.init.R b/benchmark/stan/bugs_examples/vol2/eyes/eyes.init.R new file mode 100644 index 000000000..dbdb0701b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/eyes.init.R @@ -0,0 +1,4 @@ +lambda_1 <- 535 +theta <- 5 +sigmasq <- 10 +p1 <- 0.5 \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol2/eyes/eyes.init.json b/benchmark/stan/bugs_examples/vol2/eyes/eyes.init.json new file mode 100644 index 000000000..76cdc6ba0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/eyes.init.json @@ -0,0 +1,6 @@ +{ + "theta": 5, + "p1": 0.5, + "sigmasq": 10, + "lambda_1": 535 +} diff --git a/benchmark/stan/bugs_examples/vol2/eyes/eyes.stan b/benchmark/stan/bugs_examples/vol2/eyes/eyes.stan new file mode 100644 index 000000000..7c73d5771 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/eyes.stan @@ -0,0 +1,41 @@ +/* + * http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol2.pdf + * Page 11: Eyes: Normal Mixture Model + * + + * works using the mixture distribution form instead of + * latent indicators + */ +data { + int N; + array[N] real y; +} +parameters { + real sigmasq; + real theta; + real lambda_1; + real p1; +} +transformed parameters { + array[2] real lambda; + real sigma; + sigma = sqrt(sigmasq); + lambda[1] = lambda_1; + lambda[2] = lambda[1] + theta; +} +model { + theta ~ normal(0, 100); + lambda_1 ~ normal(0, 1e3); + sigmasq ~ inv_gamma(1e-3, 1e-3); + + { + real log_p1; + real log1m_p1; + log_p1 = log(p1); + log1m_p1 = log1m(p1); + for (n in 1 : N) { + target += log_sum_exp(log_p1 + normal_lpdf(y[n] | lambda[1], sigma), + log1m_p1 + normal_lpdf(y[n] | lambda[2], sigma)); + } + } +} diff --git a/benchmark/stan/bugs_examples/vol2/eyes/makefile b/benchmark/stan/bugs_examples/vol2/eyes/makefile new file mode 100644 index 000000000..433bec36a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = eyes +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/eyes/post.R b/benchmark/stan/bugs_examples/vol2/eyes/post.R new file mode 100644 index 000000000..05696a905 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/eyes/post.R @@ -0,0 +1,13 @@ +library(coda) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#')[, -(1:3)] +summary(as.mcmc(post)) + +library(BUGSExamples); +pars <- c("P", "sigma", "lambda"); +ex <- list(name = "Eyes", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda); + diff --git a/benchmark/stan/bugs_examples/vol2/hearts/hearts.data.R b/benchmark/stan/bugs_examples/vol2/hearts/hearts.data.R new file mode 100644 index 000000000..0c4f62b7b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/hearts.data.R @@ -0,0 +1,8 @@ +N <- +12 +t <- +c(11, 11, 17, 22, 9, 6, 5, 14, 9, 7, 22, 51) +x <- +c(6, 9, 17, 22, 7, 5, 5, 14, 9, 7, 9, 51) +y <- +c(5, 2, 0, 0, 2, 1, 0, 0, 0, 0, 13, 0) diff --git a/benchmark/stan/bugs_examples/vol2/hearts/hearts.data.json b/benchmark/stan/bugs_examples/vol2/hearts/hearts.data.json new file mode 100644 index 000000000..f765902a9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/hearts.data.json @@ -0,0 +1,6 @@ +{ + "t": [11, 11, 17, 22, 9, 6, 5, 14, 9, 7, 22, 51], + "x": [6, 9, 17, 22, 7, 5, 5, 14, 9, 7, 9, 51], + "y": [5, 2, 0, 0, 2, 1, 0, 0, 0, 0, 13, 0], + "N": 12 +} diff --git a/benchmark/stan/bugs_examples/vol2/hearts/hearts.init.R b/benchmark/stan/bugs_examples/vol2/hearts/hearts.init.R new file mode 100644 index 000000000..f3211730b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/hearts.init.R @@ -0,0 +1,3 @@ +alpha <- 0 +delta <- 0 + diff --git a/benchmark/stan/bugs_examples/vol2/hearts/hearts.init.json b/benchmark/stan/bugs_examples/vol2/hearts/hearts.init.json new file mode 100644 index 000000000..b597e0fd9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/hearts.init.json @@ -0,0 +1,4 @@ +{ + "alpha": 0, + "delta": 0 +} diff --git a/benchmark/stan/bugs_examples/vol2/hearts/hearts.stan b/benchmark/stan/bugs_examples/vol2/hearts/hearts.stan new file mode 100644 index 000000000..2c5c59a0d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/hearts.stan @@ -0,0 +1,45 @@ +/** + * Hearts: a mixture model for count data + * http://www.openbugs.net/Examples/Hearts.html + * + * integrate out the binary parameters in hearts.stan.0 + */ +data { + int N; + array[N] int x; + array[N] int y; + array[N] int t; +} +parameters { + real alpha; + real delta; +} +transformed parameters { + real theta; + theta = inv_logit(delta); +} +model { + real p; + real log1m_theta; + p = inv_logit(alpha); + log1m_theta = log1m(theta); + + alpha ~ normal(0, 100); + delta ~ normal(0, 100); + for (i in 1 : N) { + // P(y_i = 0 | t_i) + // = theta + (1 - theta) * (1 - p)^{t_i} + // p(y_i | t_i) + // = (1 - theta) * Binomial(y_i|t_i, p) for y_i = 1,2,...,t_i + + if (y[i] == 0) { + target += log(theta + (1 - theta) * pow(1 - p, t[i])); + } else { + target += log1m_theta + binomial_lpmf(y[i] | t[i], p); + } + } +} +generated quantities { + real beta; + beta = exp(alpha); +} diff --git a/benchmark/stan/bugs_examples/vol2/hearts/hearts.stan.0 b/benchmark/stan/bugs_examples/vol2/hearts/hearts.stan.0 new file mode 100644 index 000000000..ba3bc987d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/hearts.stan.0 @@ -0,0 +1,36 @@ +# Hearts: a mixture model for count data +# http://www.openbugs.net/Examples/Hearts.html +# + +## status: not work (there are discrete parameters) +## see hearts.stan +data { + int N; + int x[N]; + int y[N]; + int t[N]; +} + +parameters { + real alpha; + real delta; + int state[N]; // these are discrete parameters. the support is 0 or 1 actually. ?? +} + +transformed parameters { + real theta; + theta <- inv_logit(delta); +} + +model { + real yap[2]; + yap[1] <- inv_logit(alpha); + yap[2] <- 0; + + alpha ~ normal(0, 100); + delta ~ normal(0, 100); + for (i in 1:N) { + state[i] ~ bernoulli(theta); // either 0 or 1 + y[i] ~ binomial(t[i], yap[state[i] + 1]); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/hearts/makefile b/benchmark/stan/bugs_examples/vol2/hearts/makefile new file mode 100644 index 000000000..b8fd83475 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = hearts# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/hearts/post.R b/benchmark/stan/bugs_examples/vol2/hearts/post.R new file mode 100644 index 000000000..57999dc74 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/hearts/post.R @@ -0,0 +1,16 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#', skip = 19); + +pars <- c("alpha", "delta", "theta"); + +summary(as.mcmc(post[, pars])) + +library(BUGSExamples); +ex <- list(name = "Hearts", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +plot(jagspost$coda); + diff --git a/benchmark/stan/bugs_examples/vol2/ice/ice.data.R b/benchmark/stan/bugs_examples/vol2/ice/ice.data.R new file mode 100644 index 000000000..db4597783 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/ice.data.R @@ -0,0 +1,32 @@ +"N" <- 77 +"Nage" <- 13 +"K" <- 11 +"age" <- +c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, +3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, +7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, +10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, +13, 13, 13, 13) +"cases" <- +c(2, 0, 1, 1, 1, 2, 0, 2, 1, 1, 5, 5, 1, 1, 3, 7, +12, 10, 6, 11, 9, 14, 20, 14, 7, 14, 22, 25, 29, 37, 21, 11, +29, 33, 57, 24, 15, 8, 22, 27, 38, 52, 10, 15, 22, 26, 47, 31, +8, 11, 17, 23, 31, 38, 8, 10, 24, 30, 53, 26, 5, 3, 10, 18, 22, +30, 1, 7, 11, 26, 32, 17, 5, 8, 17, 32, 31) +"pyr" <- +c(41380, 43650, 49810, 58105, 57105, 76380, 39615, +42205, 48315, 56785, 55965, 33955, 29150, 38460, 40810, 47490, +55720, 55145, 27950, 37375, 39935, 46895, 54980, 27810, 25055, +27040, 36400, 39355, 46280, 54350, 24040, 26290, 35480, 38725, +45595, 25710, 22890, 23095, 25410, 34420, 37725, 44740, 21415, +21870, 24240, 33175, 36345, 21320, 17450, 19765, 20255, 22760, +31695, 34705, 15350, 17720, 18280, 20850, 29600, 15635, 9965, +12850, 15015, 15725, 18345, 26400, 8175, 11020, 13095, 14050, +16480, 10885, 7425, 10810, 12260, 14780, 13600) +"year" <- +c(6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 5, 6, 7, +8, 9, 10, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, +9, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 2, 3, +4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5 +) +alpha1 <- 0 diff --git a/benchmark/stan/bugs_examples/vol2/ice/ice.data.json b/benchmark/stan/bugs_examples/vol2/ice/ice.data.json new file mode 100644 index 000000000..d1d497b57 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/ice.data.json @@ -0,0 +1,10 @@ +{ + "year": [6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5], + "alpha1": 0, + "pyr": [41380, 43650, 49810, 58105, 57105, 76380, 39615, 42205, 48315, 56785, 55965, 33955, 29150, 38460, 40810, 47490, 55720, 55145, 27950, 37375, 39935, 46895, 54980, 27810, 25055, 27040, 36400, 39355, 46280, 54350, 24040, 26290, 35480, 38725, 45595, 25710, 22890, 23095, 25410, 34420, 37725, 44740, 21415, 21870, 24240, 33175, 36345, 21320, 17450, 19765, 20255, 22760, 31695, 34705, 15350, 17720, 18280, 20850, 29600, 15635, 9965, 12850, 15015, 15725, 18345, 26400, 8175, 11020, 13095, 14050, 16480, 10885, 7425, 10810, 12260, 14780, 13600], + "Nage": 13, + "age": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13], + "K": 11, + "cases": [2, 0, 1, 1, 1, 2, 0, 2, 1, 1, 5, 5, 1, 1, 3, 7, 12, 10, 6, 11, 9, 14, 20, 14, 7, 14, 22, 25, 29, 37, 21, 11, 29, 33, 57, 24, 15, 8, 22, 27, 38, 52, 10, 15, 22, 26, 47, 31, 8, 11, 17, 23, 31, 38, 8, 10, 24, 30, 53, 26, 5, 3, 10, 18, 22, 30, 1, 7, 11, 26, 32, 17, 5, 8, 17, 32, 31], + "N": 77 +} diff --git a/benchmark/stan/bugs_examples/vol2/ice/ice.init.R b/benchmark/stan/bugs_examples/vol2/ice/ice.init.R new file mode 100644 index 000000000..8f2ccaad4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/ice.init.R @@ -0,0 +1,3 @@ +alpha <- c(0,0,0,0,0,0,0,0,0,0,0,0) +beta <- c(0.05,0.1,0,0,0,0,0,0,0,0,0) +sigma <- 0.5 diff --git a/benchmark/stan/bugs_examples/vol2/ice/ice.init.json b/benchmark/stan/bugs_examples/vol2/ice/ice.init.json new file mode 100644 index 000000000..9093e9454 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/ice.init.json @@ -0,0 +1,5 @@ +{ + "alpha": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "sigma": 0.5, + "beta": [0.05, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/ice/ice.stan b/benchmark/stan/bugs_examples/vol2/ice/ice.stan new file mode 100644 index 000000000..a3048add4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/ice.stan @@ -0,0 +1,55 @@ +// http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol2.pdf +// Page 29: Ice: non-parametric smoothing in an age-cohort model + +// The model is the same specified here as in JAGS example, +// but this example's JAGS version is different from that of +// WinBUGS because JAGS does not support some feature. +// TODO: +// Maybe we should check if we could specify +// the model the same as WinBUGS? + +// status: the results are farely cose to those +// from JAGS +data { + int N; + int Nage; + int K; + array[N] int year; + array[N] int cases; + array[N] int age; + array[N] int pyr; + real alpha1; +} +parameters { + array[Nage - 1] real alpha; + array[K] real beta; + real sigma; +} +model { + vector[N] r; + + sigma ~ uniform(0, 1); + for (k in 1 : 2) { + beta[k] ~ normal(0, sigma * 1E3); + } + for (k in 3 : K) { + beta[k] ~ normal(2 * beta[k - 1] - beta[k - 2], sigma); + } + alpha ~ normal(0, 1000); + + for (i in 1 : N) { + if (age[i] == 1) { + r[i] = alpha1 + log(pyr[i]) + beta[year[i]]; + } else { + r[i] = alpha[age[i] - 1] + log(pyr[i]) + beta[year[i]]; + } + } + + cases ~ poisson_log(r); +} +generated quantities { + array[K] real logRR; + for (k in 1 : K) { + logRR[k] = beta[k] - beta[5]; + } +} diff --git a/benchmark/stan/bugs_examples/vol2/ice/makefile b/benchmark/stan/bugs_examples/vol2/ice/makefile new file mode 100644 index 000000000..dc1cdb793 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/makefile @@ -0,0 +1,17 @@ +STAN_HOME = ../../../../.. +PGM = pineapple_ice +PGM = ice# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) --data=$(PGM).data.R + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.data.R b/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.data.R new file mode 100644 index 000000000..d8f2cdea7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.data.R @@ -0,0 +1,33 @@ +"N" <- 77 +"Nage" <- 13 +"None" <- 6 +"K" <- 11 +"age" <- +c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, +3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, +7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, +10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, +13, 13, 13, 13) +"cases" <- +c(2, 0, 1, 1, 1, 2, 0, 2, 1, 1, 5, 5, 1, 1, 3, 7, +12, 10, 6, 11, 9, 14, 20, 14, 7, 14, 22, 25, 29, 37, 21, 11, +29, 33, 57, 24, 15, 8, 22, 27, 38, 52, 10, 15, 22, 26, 47, 31, +8, 11, 17, 23, 31, 38, 8, 10, 24, 30, 53, 26, 5, 3, 10, 18, 22, +30, 1, 7, 11, 26, 32, 17, 5, 8, 17, 32, 31) +"pyr" <- +c(41380, 43650, 49810, 58105, 57105, 76380, 39615, +42205, 48315, 56785, 55965, 33955, 29150, 38460, 40810, 47490, +55720, 55145, 27950, 37375, 39935, 46895, 54980, 27810, 25055, +27040, 36400, 39355, 46280, 54350, 24040, 26290, 35480, 38725, +45595, 25710, 22890, 23095, 25410, 34420, 37725, 44740, 21415, +21870, 24240, 33175, 36345, 21320, 17450, 19765, 20255, 22760, +31695, 34705, 15350, 17720, 18280, 20850, 29600, 15635, 9965, +12850, 15015, 15725, 18345, 26400, 8175, 11020, 13095, 14050, +16480, 10885, 7425, 10810, 12260, 14780, 13600) +"year" <- +c(6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 5, 6, 7, +8, 9, 10, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, +9, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 2, 3, +4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5 +) +alpha1 <- 0 diff --git a/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.data.json b/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.data.json new file mode 100644 index 000000000..ed5ca4b6b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.data.json @@ -0,0 +1,11 @@ +{ + "year": [6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5], + "alpha1": 0, + "pyr": [41380, 43650, 49810, 58105, 57105, 76380, 39615, 42205, 48315, 56785, 55965, 33955, 29150, 38460, 40810, 47490, 55720, 55145, 27950, 37375, 39935, 46895, 54980, 27810, 25055, 27040, 36400, 39355, 46280, 54350, 24040, 26290, 35480, 38725, 45595, 25710, 22890, 23095, 25410, 34420, 37725, 44740, 21415, 21870, 24240, 33175, 36345, 21320, 17450, 19765, 20255, 22760, 31695, 34705, 15350, 17720, 18280, 20850, 29600, 15635, 9965, 12850, 15015, 15725, 18345, 26400, 8175, 11020, 13095, 14050, 16480, 10885, 7425, 10810, 12260, 14780, 13600], + "Nage": 13, + "age": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13], + "K": 11, + "cases": [2, 0, 1, 1, 1, 2, 0, 2, 1, 1, 5, 5, 1, 1, 3, 7, 12, 10, 6, 11, 9, 14, 20, 14, 7, 14, 22, 25, 29, 37, 21, 11, 29, 33, 57, 24, 15, 8, 22, 27, 38, 52, 10, 15, 22, 26, 47, 31, 8, 11, 17, 23, 31, 38, 8, 10, 24, 30, 53, 26, 5, 3, 10, 18, 22, 30, 1, 7, 11, 26, 32, 17, 5, 8, 17, 32, 31], + "N": 77, + "None": 6 +} diff --git a/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.stan.0 b/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.stan.0 new file mode 100644 index 000000000..92b8d8d18 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/pineapple_ice.stan.0 @@ -0,0 +1,84 @@ +# http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol2.pdf +# Page 29: Ice: non-parametric smoothing in an age-cohort model + +data { + int N; + int Nage; + int None; + int K; + int year[N]; + int cases[N]; + int age[N]; + int pyr[N]; +} +transformed data { # deterministic functions of data to be called only once + int Nneighs[K]; + real betasd[K]; + + Nneighs[1] <- 1; + Nneighs[2] <- 5; + betasd[2] <- 1.0 / sqrt(Nneighs[2]); + for (k in 3:(K-2)) { + Nneighs[k] <- 6; + } + Nneighs[K - 1] <- 5; + Nneighs[K] <- 1; + + for(k in 1:K) { + betasd[k] <- 1.0 / sqrt(Nneighs[k]); + } +} +parameters { + real alpha[Nage - 1]; + real beta[K]; + real sigma; +} +transformed parameters { # deterministic functions of parameters called every iteration + real betamean[K]; + + betamean[1] <- 2.0 * beta[2] - beta[3]; + betamean[2] <- (2.0 * beta[1] + 4.0 * beta[3] - beta[4]) / 5.0; + for (k in 3:(K-2)) { + betamean[k] <- (4.0 * beta[k - 1] + 4.0 * beta[k + 1]- beta[k - 2] - beta[k + 2]) / 6.0; + } + betamean[K - 1] <- (2.0 * beta[K] + 4.0 * beta[K - 2] - beta[K - 3]) / 5.0; + betamean[K] <- 2.0 * beta[K - 1] - beta[K - 2]; +} +model { + real ln_mu; +# uncommenting these lines leads to an overflow in exp(ln_mu) +# real globalmean; + +# alpha[1] is supposed to be constrained to zero +# so we shorten alpha by one and split the loop for the likelihood + for(j in 1:(Nage-1)) { + alpha[j] ~ normal(0.0, 1000.0); + } + sigma ~ gamma(1.00001, 1.0); + + for(k in 1:K) { + beta[k] ~ normal(betamean[k], betasd[k]); + } + +# globalmean <- sum(beta) / K; + + # likelihood among people where age == 1 + for(i in 1:None) { + ln_mu <- log(pyr[i]) + sigma * beta[year[i]]; +# ln_mu <- log(pyr[i]) + sigma * (beta[year[i]] - globalmean); + cases[i] ~ poisson(exp(ln_mu)); + } + + # likelihood among people where age > 1 + for(i in (None+1):N) { + ln_mu <- log(pyr[i]) + alpha[age[i] - 1] + sigma * beta[year[i]]; +# ln_mu <- log(pyr[i]) + alpha[age[i] - 1] + sigma * (beta[year[i]] - globalmean); + cases[i] ~ poisson(exp(ln_mu)); + } +} +generated quantities { + real log_RR[K]; + for (k in 1 : K) { + log_RR[k] <- sigma * (beta[k] - beta[5]); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/ice/post.R b/benchmark/stan/bugs_examples/vol2/ice/post.R new file mode 100644 index 000000000..584b50e36 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/post.R @@ -0,0 +1,54 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#')[, -(1:3)] +poi <- as.mcmc(post) +summary(poi) + +# The rest is for the ice example from JAGS + +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#'); + +Nage <- 13 +K <- 11 + +## assuming the order of variables in samples.csv are the same as model +## specification file +colnames(post) <- c(paste("alpha", 2:Nage, sep = ''), + paste("beta", 1:K, sep = ''), + "sigma"); + +logRR <- matrix(0, ncol = K, nrow = nrow(post)) +for (k in 1:K) { + logRR[, k] <- (post[, paste("beta", k, sep = '')] - + post[, paste("beta", 5, sep = '')]); +} + +colnames(logRR) <- paste("logRR", 1:K, sep = ''); + +poi <- cbind(post[, "sigma"], logRR); +colnames(poi)[1] <- "sigma"; + +poi <- as.mcmc(poi) +summary(poi) + + +# copied from jags example +"benchstats" <- +structure(c(0.0809343035, -1.210876809, -0.860664744, -0.510143228, +-0.2013318802, 0, 0.140870989742000, 0.288454587000000, 0.443776121, +0.5901469950, 0.782651164, 0.988174129, 0.04569394448987, 0.219802220574903, +0.137193408720079, 0.0790044166801387, 0.0486954608384044, 0, +0.0496285994768256, 0.0692647242226708, 0.0819167285040068, 0.106224387549485, +0.148165497439102, 0.233518884916692, 0.0014449693986529, 0.00695075651779417, +0.00433843651517856, 0.00249833901922237, 0.00153988567960890, +0, 0.00156939411431010, 0.00219034290047075, 0.00259043440542299, +0.00335911007712805, 0.00468540442559407, 0.00738451552999485, +0.00157801515051251, 0.00807847963662094, 0.00511460556851936, +0.00291727246116095, 0.00167524379199340, 0, 0.00160984056843626, +0.00239048314799195, 0.00298720520765311, 0.00406722941370052, +0.0059550763229483, 0.00900143318375036), .Dim = as.integer(c(12, +4)), .Dimnames = list(c("sigma", "logRR[1]", "logRR[2]", "logRR[3]", +"logRR[4]", "logRR[5]", "logRR[6]", "logRR[7]", "logRR[8]", "logRR[9]", +"logRR[10]", "logRR[11]"), c("Mean", "SD", "Naive SE", "Time-series SE" +))) + +print(benchstats) diff --git a/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.data.R b/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.data.R new file mode 100644 index 000000000..d8f2cdea7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.data.R @@ -0,0 +1,33 @@ +"N" <- 77 +"Nage" <- 13 +"None" <- 6 +"K" <- 11 +"age" <- +c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, +3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, +7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, +10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, +13, 13, 13, 13) +"cases" <- +c(2, 0, 1, 1, 1, 2, 0, 2, 1, 1, 5, 5, 1, 1, 3, 7, +12, 10, 6, 11, 9, 14, 20, 14, 7, 14, 22, 25, 29, 37, 21, 11, +29, 33, 57, 24, 15, 8, 22, 27, 38, 52, 10, 15, 22, 26, 47, 31, +8, 11, 17, 23, 31, 38, 8, 10, 24, 30, 53, 26, 5, 3, 10, 18, 22, +30, 1, 7, 11, 26, 32, 17, 5, 8, 17, 32, 31) +"pyr" <- +c(41380, 43650, 49810, 58105, 57105, 76380, 39615, +42205, 48315, 56785, 55965, 33955, 29150, 38460, 40810, 47490, +55720, 55145, 27950, 37375, 39935, 46895, 54980, 27810, 25055, +27040, 36400, 39355, 46280, 54350, 24040, 26290, 35480, 38725, +45595, 25710, 22890, 23095, 25410, 34420, 37725, 44740, 21415, +21870, 24240, 33175, 36345, 21320, 17450, 19765, 20255, 22760, +31695, 34705, 15350, 17720, 18280, 20850, 29600, 15635, 9965, +12850, 15015, 15725, 18345, 26400, 8175, 11020, 13095, 14050, +16480, 10885, 7425, 10810, 12260, 14780, 13600) +"year" <- +c(6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 5, 6, 7, +8, 9, 10, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, +9, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 2, 3, +4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5 +) +alpha1 <- 0 diff --git a/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.data.json b/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.data.json new file mode 100644 index 000000000..ed5ca4b6b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.data.json @@ -0,0 +1,11 @@ +{ + "year": [6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5], + "alpha1": 0, + "pyr": [41380, 43650, 49810, 58105, 57105, 76380, 39615, 42205, 48315, 56785, 55965, 33955, 29150, 38460, 40810, 47490, 55720, 55145, 27950, 37375, 39935, 46895, 54980, 27810, 25055, 27040, 36400, 39355, 46280, 54350, 24040, 26290, 35480, 38725, 45595, 25710, 22890, 23095, 25410, 34420, 37725, 44740, 21415, 21870, 24240, 33175, 36345, 21320, 17450, 19765, 20255, 22760, 31695, 34705, 15350, 17720, 18280, 20850, 29600, 15635, 9965, 12850, 15015, 15725, 18345, 26400, 8175, 11020, 13095, 14050, 16480, 10885, 7425, 10810, 12260, 14780, 13600], + "Nage": 13, + "age": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13], + "K": 11, + "cases": [2, 0, 1, 1, 1, 2, 0, 2, 1, 1, 5, 5, 1, 1, 3, 7, 12, 10, 6, 11, 9, 14, 20, 14, 7, 14, 22, 25, 29, 37, 21, 11, 29, 33, 57, 24, 15, 8, 22, 27, 38, 52, 10, 15, 22, 26, 47, 31, 8, 11, 17, 23, 31, 38, 8, 10, 24, 30, 53, 26, 5, 3, 10, 18, 22, 30, 1, 7, 11, 26, 32, 17, 5, 8, 17, 32, 31], + "N": 77, + "None": 6 +} diff --git a/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.stan.0 b/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.stan.0 new file mode 100644 index 000000000..74af6d458 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/ice/vanilla_ice.stan.0 @@ -0,0 +1,76 @@ +# http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/Vol2.pdf +# Page 29: Ice: non-parametric smoothing in an age-cohort model + +data { + int N; + int Nage; + int None; + int K; + int year[N]; + int cases[N]; + int age[N]; + int pyr[N]; +} +transformed data { # deterministic functions of data to be called only once + int Nneighs[K]; + real shape; + + Nneighs[1] <- 1; + Nneighs[2] <- 5; + for (k in 3:(K-2)) + Nneighs[k] <- 6; + Nneighs[K - 1] <- 5; + Nneighs[K] <- 1; + + shape <- 0.0001 + K / 2.0; +} +parameters { + real alpha[Nage - 1]; + real beta[K]; + real tau; +} +transformed parameters { # deterministic functions of parameters called every iteration + real betamean[K]; + real betasd[K]; + real tau_like[K]; + real d; + + betamean[1] <- 2.0 * beta[2] - beta[3]; + betamean[2] <- (2.0 * beta[1] + 4.0 * beta[3] - beta[4]) / 5.0; + for (k in 3:(K-2)) { + betamean[k] <- (4.0 * beta[k - 1] + 4.0 * beta[k + 1]- beta[k - 2] - beta[k + 2]) / 6.0; + } + betamean[K - 1] <- (2.0 * beta[K] + 4.0 * beta[K - 2] - beta[K - 3]) / 5.0; + betamean[K] <- 2.0 * beta[K - 1] - beta[K - 2]; + for (k in 1 : K) { + betasd[k] <- 1.0 / sqrt(Nneighs[k] * tau); + tau_like[k] <- Nneighs[k] * beta[k] * (beta[k] - betamean[k]); + } + d <- 0.0001 + sum(tau_like) / 2.0; +} +generated quantities { + real log_RR[K]; + for (k in 1 : K) { + log_RR[k] <- beta[k] - beta[5]; + } +} +model { + real ln_mu; + for(j in 1:(Nage-1)) { + alpha[j] ~ normal(0.0, 1000.0); + } + tau ~ gamma(shape, d); + + for(k in 1:K) { + beta[k] ~ normal(betamean[k], betasd[k]); + } + + for(i in 1:None) { + ln_mu <- log(pyr[i]) + beta[year[i]]; + cases[i] ~ poisson(exp(ln_mu)); + } + for(i in (None+1):N) { + ln_mu <- log(pyr[i]) + alpha[age[i] - 1] + beta[year[i]]; + cases[i] ~ poisson(exp(ln_mu)); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/jaws/jaws.data.R b/benchmark/stan/bugs_examples/vol2/jaws/jaws.data.R new file mode 100644 index 000000000..aad1a309a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/jaws.data.R @@ -0,0 +1,18 @@ +M <- +4 +N <- +20 +Y <- +structure(c(47.8, 46.4, 46.3, 45.1, 47.6, 52.5, 51.2, 49.8, 48.1, +45, 51.2, 48.5, 52.1, 48.2, 49.6, 50.7, 47.2, 53.3, 46.2, 46.3, +48.8, 47.3, 46.8, 45.3, 48.5, 53.2, 53, 50, 50.8, 47, 51.4, 49.2, +52.8, 48.9, 50.4, 51.7, 47.7, 54.6, 47.5, 47.6, 49, 47.7, 47.8, +46.1, 48.9, 53.3, 54.3, 50.3, 52.3, 47.3, 51.6, 53, 53.7, 49.3, +51.2, 52.7, 48.4, 55.1, 48.1, 51.3, 49.7, 48.4, 48.5, 47.2, 49.3, +53.7, 54.5, 52.7, 54.4, 48.3, 51.9, 55.5, 55, 49.8, 51.8, 53.3, +49.5, 55.3, 48.4, 51.8), .Dim = c(20, 4)) +age <- +c(8, 8.5, 9, 9.5) +S <- +structure(c(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), .Dim = c(4, +4)) diff --git a/benchmark/stan/bugs_examples/vol2/jaws/jaws.data.json b/benchmark/stan/bugs_examples/vol2/jaws/jaws.data.json new file mode 100644 index 000000000..7a0dcfc9d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/jaws.data.json @@ -0,0 +1,33 @@ +{ + "Y": [ + [47.8, 48.8, 49, 49.7], + [46.4, 47.3, 47.7, 48.4], + [46.3, 46.8, 47.8, 48.5], + [45.1, 45.3, 46.1, 47.2], + [47.6, 48.5, 48.9, 49.3], + [52.5, 53.2, 53.3, 53.7], + [51.2, 53, 54.3, 54.5], + [49.8, 50, 50.3, 52.7], + [48.1, 50.8, 52.3, 54.4], + [45, 47, 47.3, 48.3], + [51.2, 51.4, 51.6, 51.9], + [48.5, 49.2, 53, 55.5], + [52.1, 52.8, 53.7, 55], + [48.2, 48.9, 49.3, 49.8], + [49.6, 50.4, 51.2, 51.8], + [50.7, 51.7, 52.7, 53.3], + [47.2, 47.7, 48.4, 49.5], + [53.3, 54.6, 55.1, 55.3], + [46.2, 47.5, 48.1, 48.4], + [46.3, 47.6, 51.3, 51.8] + ], + "age": [8, 8.5, 9, 9.5], + "M": 4, + "N": 20, + "S": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 0, 0, 1] + ] +} diff --git a/benchmark/stan/bugs_examples/vol2/jaws/jaws.init.R b/benchmark/stan/bugs_examples/vol2/jaws/jaws.init.R new file mode 100644 index 000000000..f100539b7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/jaws.init.R @@ -0,0 +1,5 @@ +beta0 <- 40 +beta1 <- 1 +Sigma <- +structure(c(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), .Dim = c(4, +4)) diff --git a/benchmark/stan/bugs_examples/vol2/jaws/jaws.init.json b/benchmark/stan/bugs_examples/vol2/jaws/jaws.init.json new file mode 100644 index 000000000..84f0bf826 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/jaws.init.json @@ -0,0 +1,10 @@ +{ + "beta0": 40, + "beta1": 1, + "Sigma": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 0, 0, 1] + ] +} diff --git a/benchmark/stan/bugs_examples/vol2/jaws/jaws.stan b/benchmark/stan/bugs_examples/vol2/jaws/jaws.stan new file mode 100644 index 000000000..6f5b4fc93 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/jaws.stan @@ -0,0 +1,35 @@ +// Jaws: repeated measures analysis of variance +// http://www.openbugs.net/Examples/Jaws.html + +data { + int N; + int M; + array[N] vector[M] Y; + array[M] real age; + cov_matrix[M] S; +} +transformed data { + real mean_age; + mean_age = mean(age); +} +parameters { + real beta0; + real beta1; + cov_matrix[M] Sigma; +} +transformed parameters { + vector[M] mu; + // for (m in 1:M) mu[m] <- beta0 + beta1 * (age[m] - mean_age); + + for (m in 1 : M) { + mu[m] = beta0 + beta1 * age[m]; + } +} +model { + beta0 ~ normal(0, 32); + beta1 ~ normal(0, 32); + Sigma ~ inv_wishart(4, S); + for (n in 1 : N) { + Y[n] ~ multi_normal(mu, Sigma); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/jaws/makefile b/benchmark/stan/bugs_examples/vol2/jaws/makefile new file mode 100644 index 000000000..acb4d48ce --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = jaws# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O0 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/jaws/post.R b/benchmark/stan/bugs_examples/vol2/jaws/post.R new file mode 100644 index 000000000..a0a8414cc --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/jaws/post.R @@ -0,0 +1,36 @@ +library(coda) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') +summary(as.mcmc(post)) +plot(as.mcmc(post)) + +beginwith <- function(vstr, patterns, sort = TRUE) { + patterns <- paste(patterns, ".*", sep = ''); + a <- lapply(patterns, FUN = function(p) {grep(p, vstr)}) + if (!sort) return(do.call("c", a)) + sort(do.call("c", a)) +} + +sigmas <- post[, beginwith(colnames(post), "Sigma\\.")]; +invSigma <- t(apply(sigmas, 1, FUN = function(x) solve(matrix(x, ncol = 4)))) +colnames(invSigma) <- gsub("Sigma", "invSigma", colnames(sigmas)) +summary(as.mcmc(invSigma)) + + +library(BUGSExamples); +# Sigma <- inverse(Omega) +pars <- c("beta0", "beta1", "mu", "Omega", "Sigma"); +ex <- list(name = "Jaws", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + + + +jagspost <- runExample(ex, engine = 'JAGS') + +# apply(jagspost, ); + +summary(jagspost$coda); + + + + diff --git a/benchmark/stan/bugs_examples/vol2/mvn_orange/makefile b/benchmark/stan/bugs_examples/vol2/mvn_orange/makefile new file mode 100644 index 000000000..31af17a5f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/mvn_orange/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = mvn_orange# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample num_warmup=1000 num_samples=10000 + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.data.R b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.data.R new file mode 100644 index 000000000..4d905e02a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.data.R @@ -0,0 +1,16 @@ +K <- +5L +N <- +7L +x <- +c(118L, 484L, 664L, 1004L, 1231L, 1372L, 1582L) +Y <- +structure(c(30, 33, 30, 32, 30, 58, 69, 51, 62, 49, 87, 111, +75, 112, 81, 115, 156, 108, 167, 125, 120, 172, 115, 179, 142, +142, 203, 139, 209, 174, 145, 203, 140, 214, 177), .Dim = c(5, 7)) +mu_m_prior <- +c(0, 0, 0) +mu_var_prior <- +structure(c(1E6, 0, 0, 0, 1E6, 0, 0, 0, 1E6), .Dim = c(3, 3)) +invR <- +structure(c(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1), .Dim = c(3, 3)) diff --git a/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.data.json b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.data.json new file mode 100644 index 000000000..e87a287cf --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.data.json @@ -0,0 +1,23 @@ +{ + "Y": [ + [30, 58, 87, 115, 120, 142, 145], + [33, 69, 111, 156, 172, 203, 203], + [30, 51, 75, 108, 115, 139, 140], + [32, 62, 112, 167, 179, 209, 214], + [30, 49, 81, 125, 142, 174, 177] + ], + "mu_var_prior": [ + [1000000, 0, 0], + [0, 1000000, 0], + [0, 0, 1000000] + ], + "x": [118, 484, 664, 1004, 1231, 1372, 1582], + "invR": [ + [0.1, 0, 0], + [0, 0.1, 0], + [0, 0, 0.1] + ], + "K": 5, + "N": 7, + "mu_m_prior": [0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.init.R b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.init.R new file mode 100644 index 000000000..ac779d7d2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.init.R @@ -0,0 +1,14 @@ +sigmasq <- 0.05 +mu <- c(5, 2, -6) +theta <- structure( + c(5, 2, -6, + 5, 2, -6, + 5, 2, -6, + 5, 2, -6, + 5, 2, -6), + .Dim = c(5, 3)) +sigma2 <- structure( + c(1, 0, 0, + 0, 1, 0, + 0, 0, 1), + .Dim = c(3,3)) diff --git a/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.init.json b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.init.json new file mode 100644 index 000000000..675dec4c0 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.init.json @@ -0,0 +1,16 @@ +{ + "sigma2": [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ], + "theta": [ + [5, -6, 2], + [2, 5, -6], + [-6, 2, 5], + [5, -6, 2], + [2, 5, -6] + ], + "mu": [5, 2, -6], + "sigmasq": 0.05 +} diff --git a/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.stan b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.stan new file mode 100644 index 000000000..c58fb4024 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/mvn_orange/mvn_orange.stan @@ -0,0 +1,51 @@ +// Orange Trees (Multi-variate normal) +// http://www.openbugs.net/Examples/OtreesMVN.html +// and refer to ../orange + +// FIXME: there are some discrepancy for parameters var +// and the s.e. for some parameters + +data { + int K; + int N; + array[N] int x; + array[K, N] real Y; + cov_matrix[3] invR; + cov_matrix[3] mu_var_prior; + vector[3] mu_m_prior; +} +parameters { + real sigmasq; + array[K] vector[3] theta; + vector[3] mu; + cov_matrix[3] sigma2; +} +transformed parameters { + real sigma_C; + sigma_C = sqrt(sigmasq); +} +model { + array[K, 3] real phi; + for (k in 1 : K) { + theta[k] ~ multi_normal(mu, sigma2); + phi[k, 1] = exp(theta[k, 1]); + phi[k, 2] = exp(theta[k, 2]) - 1; + phi[k, 3] = -exp(theta[k, 3]); + } + + sigmasq ~ inv_gamma(.001, .001); + for (k in 1 : K) { + for (n in 1 : N) { + Y[k, n] ~ normal(phi[k, 1] / (1 + phi[k, 2] * exp(phi[k, 3] * x[n])), + sigma_C); + } + } + mu ~ multi_normal(mu_m_prior, mu_var_prior); + sigma2 ~ inv_wishart(3, invR); +} +generated quantities { + vector[3] sigma; + sigma[1] = sqrt(sigma2[1, 1]); + sigma[2] = sqrt(sigma2[2, 2]); + sigma[3] = sqrt(sigma2[3, 3]); +} diff --git a/benchmark/stan/bugs_examples/vol2/orange/makefile b/benchmark/stan/bugs_examples/vol2/orange/makefile new file mode 100644 index 000000000..da70b5cc4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/orange/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = orange +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) --data=$(PGM).data.R + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/orange/orange.data.R b/benchmark/stan/bugs_examples/vol2/orange/orange.data.R new file mode 100644 index 000000000..91cb1f356 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/orange/orange.data.R @@ -0,0 +1,11 @@ +K <- +5 +N <- +7 +x <- +c(118, 484, 664, 1004, 1231, 1372, 1582) +Y <- +structure(c(30, 33, 30, 32, 30, 58, 69, 51, 62, 49, 87, 111, +75, 112, 81, 115, 156, 108, 167, 125, 120, 172, 115, 179, 142, +142, 203, 139, 209, 174, 145, 203, 140, 214, 177), .Dim = c(5, +7)) diff --git a/benchmark/stan/bugs_examples/vol2/orange/orange.data.json b/benchmark/stan/bugs_examples/vol2/orange/orange.data.json new file mode 100644 index 000000000..1f5f0aaee --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/orange/orange.data.json @@ -0,0 +1,12 @@ +{ + "Y": [ + [30, 58, 87, 115, 120, 142, 145], + [33, 69, 111, 156, 172, 203, 203], + [30, 51, 75, 108, 115, 139, 140], + [32, 62, 112, 167, 179, 209, 214], + [30, 49, 81, 125, 142, 174, 177] + ], + "x": [118, 484, 664, 1004, 1231, 1372, 1582], + "K": 5, + "N": 7 +} diff --git a/benchmark/stan/bugs_examples/vol2/orange/orange.init.R b/benchmark/stan/bugs_examples/vol2/orange/orange.init.R new file mode 100644 index 000000000..258c5cf67 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/orange/orange.init.R @@ -0,0 +1,7 @@ +theta <- structure(c(5, 5, 5, 5, 5, + 2, 2, 2, 2, 2, + -6, -6, -6, -6, -6), + .Dim = c(5, 3)) +mu <- c(5, 2, -6) +tau <- c(20, 20, 20) +tau_C <- 20 diff --git a/benchmark/stan/bugs_examples/vol2/orange/orange.init.json b/benchmark/stan/bugs_examples/vol2/orange/orange.init.json new file mode 100644 index 000000000..d0d90c478 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/orange/orange.init.json @@ -0,0 +1,12 @@ +{ + "theta": [ + [5, 2, -6], + [5, 2, -6], + [5, 2, -6], + [5, 2, -6], + [5, 2, -6] + ], + "mu": [5, 2, -6], + "tau": [20, 20, 20], + "tau_C": 20 +} diff --git a/benchmark/stan/bugs_examples/vol2/orange/orange.stan b/benchmark/stan/bugs_examples/vol2/orange/orange.stan new file mode 100644 index 000000000..bb2667b71 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/orange/orange.stan @@ -0,0 +1,46 @@ +// Orange Trees +// http://www.openbugs.net/Examples/Otrees.html + +// status: error thrown out during execution immediately + +data { + int K; + int N; + array[N] int x; + array[K, N] real Y; +} +parameters { + real tau_C; + array[K, 3] real theta; + array[3] real mu; + array[3] real tau; +} +transformed parameters { + array[K, 3] real phi; + array[3] real sigma; + real sigma_C; + for (k in 1 : K) { + phi[k, 1] = exp(theta[k, 1]); + phi[k, 2] = exp(theta[k, 2]) - 1; + phi[k, 3] = -exp(theta[k, 3]); + } + for (j in 1 : 3) { + sigma[j] = 1 / sqrt(tau[j]); + } + sigma_C = 1 / sqrt(tau_C); +} +model { + tau_C ~ gamma(0.001, 0.001); + mu ~ normal(0, 100); + for (j in 1 : 3) { + tau[j] ~ gamma(.001, .001); + } + for (k in 1 : K) { + array[N] real m; + theta[k] ~ normal(mu, sigma); + for (n in 1 : N) { + m[n] = phi[k, 1] / (1 + phi[k, 2] * exp(phi[k, 3] * x[n])); + } + Y[k] ~ normal(m, sigma_C); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/pines/fit.R b/benchmark/stan/bugs_examples/vol2/pines/fit.R new file mode 100644 index 000000000..8670b8ccf --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/fit.R @@ -0,0 +1,4 @@ +library(rstan); +source('pines.data.R'); +# fit_independent <- stan('pines-independent.stan', data=c("N", "y", "x", "z")); +fit <- stan('pines.stan', data=c("N", "y", "x", "z"), iter=100000) diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines-2.stan b/benchmark/stan/bugs_examples/vol2/pines/pines-2.stan new file mode 100644 index 000000000..eb08cb96c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines-2.stan @@ -0,0 +1,40 @@ +data { + int N; + vector[N] y; + vector[N] x; + vector[N] z; +} +transformed data { + vector[N] y_std; + vector[N] x_std; + vector[N] z_std; + + y_std = (y - mean(y)) / sd(y); + x_std = (x - mean(x)) / sd(x); + z_std = (z - mean(z)) / sd(z); +} +parameters { + real alpha; + real beta; + real gamma; + real delta; + vector[2] sigma; +} +transformed parameters { + vector[2] log_joint; + + log_joint[1] = normal_lpdf(alpha | 0, 10) + normal_lpdf(beta | 0, 5) + + cauchy_lpdf(sigma[1] | 0, 5) + + normal_lpdf(y_std | alpha + beta * x_std, sigma[1]); + log_joint[2] = normal_lpdf(gamma | 0, 10) + normal_lpdf(delta | 0, 5) + + cauchy_lpdf(sigma[2] | 0, 5) + + normal_lpdf(y_std | gamma + delta * z_std, sigma[2]); +} +model { + target += log_joint[1]; + target += log_joint[2]; +} +generated quantities { + real lambda; + lambda = softmax(log_joint)[1]; +} diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines-3.stan b/benchmark/stan/bugs_examples/vol2/pines/pines-3.stan new file mode 100644 index 000000000..36806f330 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines-3.stan @@ -0,0 +1,56 @@ +data { + int N; + vector[N] y; + vector[N] x; + vector[N] z; +} +transformed data { + vector[N] y_std = (y - mean(y)) / sd(y); + vector[N] x_std = (x - mean(x)) / sd(x); + vector[N] z_std = (z - mean(z)) / sd(z); + print("pines-3"); +} +parameters { + real alpha; + real beta; + real gamma; + real delta; + vector[2] tau; +} +transformed parameters { + vector[2] sigma; + for (i in 1 : 2) { + sigma[i] = 1 / sqrt(tau[i]); + } +} +model { + alpha ~ normal(0, sqrt(1e6)); + beta ~ normal(0, sqrt(1e4)); + tau[1] ~ gamma(0.0001, 0.0001); + + y_std ~ normal(alpha + beta * x_std, sigma[1]); + + gamma ~ normal(0, 10); + delta ~ normal(0, 5); + tau[2] ~ gamma(0.0001, 0.0001); + y_std ~ normal(gamma + delta * z_std, sigma[2]); +} +generated quantities { + vector[2] log_py; + real lambda; + + log_py[1] = log(0.9995) + + normal_lpdf(y_std | alpha + beta * x_std, sigma[1]) + + normal_lpdf(alpha | 0, sqrt(1e6)) + + normal_lpdf(beta | 0, sqrt(1e4)) + + gamma_lpdf(tau[1] | 0.0001, 0.0001) + + normal_lpdf(gamma | 0.0001, 0.0001); + + log_py[2] = log(0.0005) + + normal_lpdf(y_std | gamma + delta * z_std, sigma[2]) + + normal_lpdf(gamma | 0, sqrt(1e6)) + + normal_lpdf(delta | 0, sqrt(1e4)) + + gamma_lpdf(tau[2] | 0.0001, 0.0001); + + lambda = softmax(log_py)[1]; +} diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines-4.stan b/benchmark/stan/bugs_examples/vol2/pines/pines-4.stan new file mode 100644 index 000000000..a0b8201a6 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines-4.stan @@ -0,0 +1,53 @@ +data { + int N; + vector[N] y; + vector[N] x; + vector[N] z; +} +transformed data { + vector[N] y_std; + vector[N] x_std; + vector[N] z_std; + + y_std = (y - mean(y)) / sd(y); + x_std = (x - mean(x)) / sd(x); + z_std = (z - mean(z)) / sd(z); + print("pines-4"); +} +parameters { + real alpha; + real beta; + real gamma; + real delta; + vector[2] tau; + real lambda; +} +transformed parameters { + vector[2] sigma; + for (i in 1 : 2) { + sigma[i] = 1 / sqrt(tau[i]); + } +} +model { + vector[2] log_p; + + log_p[1] = log(lambda) + + normal_lpdf(y_std | alpha + beta * x_std, sigma[1]) + + normal_lpdf(alpha | 0, sqrt(1e6)) + + normal_lpdf(beta | 0, sqrt(1e4)) + + gamma_lpdf(tau[1] | 0.0001, 0.0001); + // + normal_log(gamma,0,1/sqrt(400)) + // + normal_log(delta,1,1/sqrt(400)) + // + gamma_log(tau[2],46,4.5); + + log_p[2] = log1m(lambda) + + normal_lpdf(y_std | gamma + delta * z_std, sigma[2]) + + normal_lpdf(gamma | 0, sqrt(1e6)) + + normal_lpdf(delta | 0, sqrt(1e4)) + + gamma_lpdf(tau[2] | 0.0001, 0.0001); + // + normal_log(alpha,0,1/sqrt(400)) + // + normal_log(beta,1,1/sqrt(400)) + // + gamma_log(tau[1],46,4.5); + + target += log_sum_exp(log_p); +} diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines-independent.stan b/benchmark/stan/bugs_examples/vol2/pines/pines-independent.stan new file mode 100644 index 000000000..5fe1ed21a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines-independent.stan @@ -0,0 +1,40 @@ +data { + int N; + vector[N] y; + vector[N] x; + vector[N] z; +} +transformed data { + vector[N] y_std; + vector[N] x_std; + vector[N] z_std; + + y_std = (y - mean(y)) / sd(y); + x_std = (x - mean(x)) / sd(x); + z_std = (z - mean(z)) / sd(z); + print("pines_independant"); +} +parameters { + real alpha; + real beta; + real gamma; + real delta; + vector[2] sigma; +} +model { + array[2] vector[N] mu; + + alpha ~ normal(0, 10); + beta ~ normal(0, 5); + mu[1] = alpha + beta * x_std; + + gamma ~ normal(0, 10); + delta ~ normal(0, 5); + mu[2] = gamma + delta * z_std; + + sigma ~ cauchy(0, 5); + + // estimate separately + y_std ~ normal(mu[1], sigma[1]); + y_std ~ normal(mu[2], sigma[2]); +} diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines.data.R b/benchmark/stan/bugs_examples/vol2/pines/pines.data.R new file mode 100644 index 000000000..b8e564062 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines.data.R @@ -0,0 +1,16 @@ +N <- 42 +y <- c(3040, 2470, 3610, 3480, 3810, 2330, 1800, 3110, 3160, 2310, +4360, 1880, 3670, 1740, 2250, 2650, 4970, 2620, 2900, 1670, +2540, 3840, 3800, 4600, 1900, 2530, 2920, 4990, 1670, 3310, +3450, 3600, 2850, 1590, 3770, 3850, 2480, 3570, 2620, 1890, +3030,3030) +x <- c(29.2, 24.7, 32.3, 31.3, 31.5, 24.5, 19.9, 27.3, 27.1, 24.0, +33.8, 21.5, 32.2, 22.5, 27.5, 25.6, 34.5, 26.2, 26.7, 21.1, +24.1, 30.7, 32.7, 32.6, 22.1, 25.3, 30.8, 38.9, 22.1, 29.2, +30.1, 31.4, 26.7, 22.1, 30.3, 32.0, 23.2, 30.3, 29.9, 20.8, +33.2, 28.2) +z <- c(25.4, 22.2, 32.2, 31.0, 30.9, 23.9, 19.2, 27.2, 26.3, 23.9, +33.2, 21.0, 29.0, 22.0, 23.8, 25.3, 34.2, 25.7, 26.4, 20.0, +23.9, 30.7, 32.6, 32.5, 20.8, 23.1, 29.8, 38.1, 21.3, 28.5, +29.2, 31.4, 25.9, 21.4, 29.8, 30.6, 22.6, 30.3, 23.8, 18.4, +29.4, 28.2) diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines.data.json b/benchmark/stan/bugs_examples/vol2/pines/pines.data.json new file mode 100644 index 000000000..3c024c6f1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines.data.json @@ -0,0 +1,6 @@ +{ + "x": [29.2, 24.7, 32.3, 31.3, 31.5, 24.5, 19.9, 27.3, 27.1, 24, 33.8, 21.5, 32.2, 22.5, 27.5, 25.6, 34.5, 26.2, 26.7, 21.1, 24.1, 30.7, 32.7, 32.6, 22.1, 25.3, 30.8, 38.9, 22.1, 29.2, 30.1, 31.4, 26.7, 22.1, 30.3, 32, 23.2, 30.3, 29.9, 20.8, 33.2, 28.2], + "y": [3040, 2470, 3610, 3480, 3810, 2330, 1800, 3110, 3160, 2310, 4360, 1880, 3670, 1740, 2250, 2650, 4970, 2620, 2900, 1670, 2540, 3840, 3800, 4600, 1900, 2530, 2920, 4990, 1670, 3310, 3450, 3600, 2850, 1590, 3770, 3850, 2480, 3570, 2620, 1890, 3030, 3030], + "z": [25.4, 22.2, 32.2, 31, 30.9, 23.9, 19.2, 27.2, 26.3, 23.9, 33.2, 21, 29, 22, 23.8, 25.3, 34.2, 25.7, 26.4, 20, 23.9, 30.7, 32.6, 32.5, 20.8, 23.1, 29.8, 38.1, 21.3, 28.5, 29.2, 31.4, 25.9, 21.4, 29.8, 30.6, 22.6, 30.3, 23.8, 18.4, 29.4, 28.2], + "N": 42 +} diff --git a/benchmark/stan/bugs_examples/vol2/pines/pines.stan b/benchmark/stan/bugs_examples/vol2/pines/pines.stan new file mode 100644 index 000000000..b1185ade8 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/pines/pines.stan @@ -0,0 +1,71 @@ +data { + int N; + vector[N] y; + vector[N] x; + vector[N] z; +} +transformed data { + vector[N] y_std; + vector[N] x_std; + vector[N] z_std; + + y_std = (y - mean(y)) / sd(y); + x_std = (x - mean(x)) / sd(x); + z_std = (z - mean(z)) / sd(z); +} +parameters { + real alpha; + real beta; + real gamma; + real delta; + vector[2] tau; + real lambda; +} +transformed parameters { + vector[2] sigma; + vector[2] log_py; + + for (i in 1 : 2) { + sigma[i] = 1 / sqrt(tau[i]); + } + + log_py[1] = log(lambda) + log(0.9995) + + normal_lpdf(y_std | alpha + beta * x_std, sigma[1]) + + normal_lpdf(alpha | 0, sqrt(1e6)) + + normal_lpdf(beta | 0, sqrt(1e4)) + + gamma_lpdf(tau[1] | 0.0001, 0.0001) + // pseudo-priors + + normal_lpdf(gamma | 0, sqrt(1 / 400.0)) + + normal_lpdf(delta | 1, sqrt(1 / 400.0)) + + gamma_lpdf(tau[2] | 46, 4.5); + + log_py[2] = log(lambda) + log1m(0.0005) + + normal_lpdf(y_std | gamma + delta * z_std, sigma[2]) + + normal_lpdf(gamma | 0, sqrt(1e6)) + + normal_lpdf(delta | 0, sqrt(1e4)) + + gamma_lpdf(tau[2] | 0.0001, 0.0001) + // pseudo-priors + + normal_lpdf(alpha | 0, sqrt(1 / 256.0)) + + normal_lpdf(beta | 1, sqrt(1 / 256.0)) + + gamma_lpdf(tau[1] | 30, 4.5); +} +model { + target += log_sum_exp(log_py); +} +generated quantities { + real pM2; + pM2 = bernoulli_rng(softmax(log_py)[2]); +} +/* + * p(lambda) = 1 + * + * p(y|lambda,zeta1,zeta2) + * = lambda * p1(y|zeta1) + (1 - lambda) * p2(y|zeta2) + * + * log p(y|lambda,zeta1,zeta2) + * = log_sum_exp(log(lambda) + log(p1(y|zeta1)), + * log1m(lambda) + log(p2(y|zeta2)); + * + * p(lambda|y,zeta1,zeta2) propto p(y|lambda,zeta1,zet2) p(lambda) + * + */ \ No newline at end of file diff --git a/benchmark/stan/bugs_examples/vol2/schools/fit.R b/benchmark/stan/bugs_examples/vol2/schools/fit.R new file mode 100644 index 000000000..d1386526e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/fit.R @@ -0,0 +1,10 @@ +library(rstan); +source("schools.data.R"); + +fit <- stan("schools-3.stan", + data=c("N","M","LRT", + "school","School_denom","School_gender", + "VR","Y","Gender","R"), + # control=list(adapt_delta=0.9), + chains=1, iter=400, + init=0); diff --git a/benchmark/stan/bugs_examples/vol2/schools/makefile b/benchmark/stan/bugs_examples/vol2/schools/makefile new file mode 100644 index 000000000..03bd4fb7d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/makefile @@ -0,0 +1,16 @@ +STAN_HOME = ../../../../.. +PGM = schools# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/schools/post.R b/benchmark/stan/bugs_examples/vol2/schools/post.R new file mode 100644 index 000000000..9e4d70352 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/post.R @@ -0,0 +1,31 @@ +library(coda) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') + +poiidx <- c(grep('beta\\.[0-9]+', colnames(post)), + grep('gamma\\.[0-9]+', colnames(post)), + grep('phi', colnames(post)), + grep('theta', colnames(post))) + + +poi <- post[, poiidx] + +summary(as.mcmc(poi)); +# quit('no') + +ranks <- post[, grep('ranks\\.[0-9]+', colnames(post))] +ranksm <- apply(ranks, 2, mean) +dotplot(rev(sort(ranksm))) + + + + +require(BUGSExamples); +pars <- c("beta", "gamma", "phi", "theta") + +ex <- list(name = "Schools", parameters = pars, + nSample = 10000, nBurnin = 1000, nThin = 1, + nChain = 3) + +jagspost <- runExample(ex, engine = 'JAGS') +summary(jagspost$coda) +# plot(jagspost$coda); diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools-1.init.R b/benchmark/stan/bugs_examples/vol2/schools/schools-1.init.R new file mode 100644 index 000000000..17a060852 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools-1.init.R @@ -0,0 +1,19 @@ +"theta" <- +0 +"phi" <- +0.01 +"gamma" <- +c(0, 0, 0) +"beta" <- +c(0, 0, 0, 0, 0, 0, 0, 0) +"Omega" <- +structure(c(10, -3, -3, -3, 135, -65, -3, -65, 135), .Dim = as.integer(c(3, +3))) +"alpha" <- +structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = as.integer(c(38, +3))) diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools-1.init.json b/benchmark/stan/bugs_examples/vol2/schools/schools-1.init.json new file mode 100644 index 000000000..4914b703a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools-1.init.json @@ -0,0 +1,51 @@ +{ + "theta": 0, + "alpha": [ + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0] + ], + "Omega": [ + [10, -3, -3], + [-3, 135, -65], + [-3, -65, 135] + ], + "beta": [0, 0, 0, 0, 0, 0, 0, 0], + "phi": 0.01, + "gamma": [0, 0, 0] +} diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools-1.stan b/benchmark/stan/bugs_examples/vol2/schools/schools-1.stan new file mode 100644 index 000000000..043d17a4a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools-1.stan @@ -0,0 +1,49 @@ +/** + * Schools: ranking school examination resutls using + * http://www.openbugs.info/Examples/Schools.html + */ +data { + int N; + int M; + vector[N] LRT; + array[N] int school; + array[N, 3] int School_denom; + array[N, 2] int School_gender; + array[N, 2] int VR; + array[N] real Y; + array[N] int Gender; + cov_matrix[3] R; +} +parameters { + array[8] real beta; + real theta; + real phi; + array[M] vector[3] alpha; + vector[3] gamma; + cov_matrix[3] Omega; +} +model { + array[N] real Ymu; + for (p in 1 : N) { + Ymu[p] = alpha[school[p], 1] + alpha[school[p], 2] * LRT[p] + + alpha[school[p], 3] * VR[p, 1] + beta[1] * LRT[p] * LRT[p] + + beta[2] * VR[p, 2] + beta[3] * Gender[p] + + beta[4] * School_gender[p, 1] + beta[5] * School_gender[p, 2] + + beta[6] * School_denom[p, 1] + beta[7] * School_denom[p, 2] + + beta[8] * School_denom[p, 3]; + } + + Y ~ normal(Ymu, exp(-0.5 * (theta + phi * LRT))); + + // Priors for fixed effects: + beta ~ normal(0, 5); + theta ~ normal(0, 5); + phi ~ normal(0, 5); + + // Priors for random coefficients: + alpha ~ multi_normal_prec(gamma, Omega); + + // Hyper-priors: + gamma ~ normal(0, 5); + Omega ~ wishart(3, R); +} diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools-2.stan b/benchmark/stan/bugs_examples/vol2/schools/schools-2.stan new file mode 100644 index 000000000..17166133e --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools-2.stan @@ -0,0 +1,52 @@ +/** + * Schools: ranking school examination resutls using + * http://www.openbugs.info/Examples/Schools.html + */ +data { + int N; + int M; + vector[N] LRT; + array[N] int school; + array[N, 3] int School_denom; + array[N, 2] int School_gender; + array[N, 2] int VR; + array[N] real Y; + array[N] int Gender; + cov_matrix[3] R; +} +parameters { + array[8] real beta; + real theta; + real phi; + array[M] vector[3] alpha; + vector[3] gamma; + cholesky_factor_corr[3] L_Sigma; + vector[3] sigma_Sigma; +} +model { + array[N] real Ymu; + for (p in 1 : N) { + Ymu[p] = alpha[school[p], 1] + alpha[school[p], 2] * LRT[p] + + alpha[school[p], 3] * VR[p, 1] + beta[1] * LRT[p] * LRT[p] + + beta[2] * VR[p, 2] + beta[3] * Gender[p] + + beta[4] * School_gender[p, 1] + beta[5] * School_gender[p, 2] + + beta[6] * School_denom[p, 1] + beta[7] * School_denom[p, 2] + + beta[8] * School_denom[p, 3]; + } + + Y ~ normal(Ymu, exp(-0.5 * (theta + phi * LRT))); + + // Priors for fixed effects: + beta ~ normal(0, 2.5); + theta ~ normal(0, 2.5); + phi ~ normal(0, 0.1); + + // Priors for random coefficients: + alpha ~ multi_normal_cholesky(gamma, + diag_pre_multiply(sigma_Sigma, L_Sigma)); + + // Hyper-priors: + gamma ~ normal(0, 5); + sigma_Sigma ~ cauchy(0, 2.5); + L_Sigma ~ lkj_corr_cholesky(3); +} diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools-3.stan b/benchmark/stan/bugs_examples/vol2/schools/schools-3.stan new file mode 100644 index 000000000..6311f9007 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools-3.stan @@ -0,0 +1,48 @@ +/** + * Schools: ranking school examination results + * http://www.openbugs.info/Examples/Schools.html + */ +data { + int N; + int M; + vector[N] LRT; + array[N] int school; + array[N, 3] int School_denom; + array[N, 2] int School_gender; + array[N, 2] int VR; + array[N] real Y; + array[N] int Gender; + cov_matrix[3] R; +} +parameters { + array[8] real beta; + real theta; + real phi; + matrix[M, 3] alpha; + vector[3] gamma; +} +model { + array[N] real Ymu; + for (p in 1 : N) { + Ymu[p] = alpha[school[p], 1] + alpha[school[p], 2] * LRT[p] + + alpha[school[p], 3] * VR[p, 1] + beta[1] * LRT[p] * LRT[p] + + beta[2] * VR[p, 2] + beta[3] * Gender[p] + + beta[4] * School_gender[p, 1] + beta[5] * School_gender[p, 2] + + beta[6] * School_denom[p, 1] + beta[7] * School_denom[p, 2] + + beta[8] * School_denom[p, 3]; + } + + Y ~ normal(Ymu, exp(-0.5 * (theta + phi * LRT))); + + // Priors for fixed effects: + beta ~ normal(0, 5); + theta ~ normal(0, 5); + phi ~ normal(0, 5); + + // Priors for random coefficients: + target += -0.5 * (3 + M) + * log_determinant(crossprod(alpha) - gamma * gamma' + R); + + // Hyper-priors: + gamma ~ normal(0, 5); +} diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools-4.stan b/benchmark/stan/bugs_examples/vol2/schools/schools-4.stan new file mode 100644 index 000000000..04915eda9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools-4.stan @@ -0,0 +1,56 @@ +/** + * Schools: ranking school examination results + * http://www.openbugs.info/Examples/Schools.html + */ +data { + int N; + int M; + vector[N] LRT; + array[N] int school; + array[N, 3] int School_denom; + array[N, 2] int School_gender; + array[N, 2] int VR; + array[N] real Y; + array[N] int Gender; +} +parameters { + array[8] real beta; + real theta; + real phi; + matrix[3, M] z; + vector[3] gamma; + cholesky_factor_corr[3] L_Sigma; + vector[3] sigma_Sigma; +} +transformed parameters { + matrix[M, 3] alpha; + alpha = transpose(rep_matrix(gamma, M) + + diag_pre_multiply(sigma_Sigma, L_Sigma) * z); +} +model { + array[N] real Ymu; + for (p in 1 : N) { + Ymu[p] = alpha[school[p], 1] + alpha[school[p], 2] * LRT[p] + + alpha[school[p], 3] * VR[p, 1] + beta[1] * LRT[p] * LRT[p] + + beta[2] * VR[p, 2] + beta[3] * Gender[p] + + beta[4] * School_gender[p, 1] + beta[5] * School_gender[p, 2] + + beta[6] * School_denom[p, 1] + beta[7] * School_denom[p, 2] + + beta[8] * School_denom[p, 3]; + } + + Y ~ normal(Ymu, exp(-0.5 * (theta + phi * LRT))); + + // Priors for fixed effects: + beta ~ normal(0, 2.5); + theta ~ normal(0, 2.5); + phi ~ normal(0, 0.1); + + // Priors for random coefficients: + to_vector(z) ~ normal(0, 1); + // implies: alpha ~ multi_normal(gamma, CovarianceMatrix); + + // Hyper-priors: + gamma ~ normal(0, 5); + sigma_Sigma ~ cauchy(0, 2.5); + L_Sigma ~ lkj_corr_cholesky(3); +} diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools.data.R b/benchmark/stan/bugs_examples/vol2/schools/schools.data.R new file mode 100644 index 000000000..ad2ba21a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+-1.6193, -7.6193, 14.3807, -14.6193, 11.3807, -18.6193, 10.3807, +15.3807, -9.6193, -22.6193, 19.3807, 10.3807, 5.3807, -1.6193, +10.3807, 1.3807, -6.6193, -13.6193, -7.6193, -3.6193, 16.3807, +8.3807, 1.3807, -0.6193, 6.3807, -13.6193, -8.6193, -20.6193, +-2.6193, 13.3807, 3.3807, -8.6193, 8.3807, -5.6193, -12.6193, +0.3807, -22.6193, -4.6193, -34.6193, -1.6193, 18.3807, 16.3807, +-12.6193, 8.3807, 20.3807, -24.6193, -11.6193, -9.6193, -3.6193, +-3.6193, -2.6193, -3.6193, 4.3807, -1.6193, -17.6193, -2.6193, +15.3807, -19.6193, -2.6193, -2.6193, 10.3807, 3.3807, 35.3807, +5.3807, 12.3807, -13.6193, 16.3807, -23.6193, -5.6193, 0.3807, +-11.6193, -0.6193, -2.6193, -1.6193, 20.3807, 5.3807, 5.3807, +7.3807, 20.3807, -0.6193, 9.3807, 1.3807, -10.6193, -0.6193, +-4.6193, 1.3807, -4.6193, 16.3807, -3.6193, 8.3807, 3.3807, 9.3807, +3.3807, 3.3807, 1.3807, 9.3807, -2.6193, 11.3807, -24.6193, 7.3807, +10.3807, -6.6193, 27.3807, -1.6193, 18.3807, -5.6193, 6.3807, +-7.6193, 12.3807, -1.6193, 18.3807, 7.3807, 0.3807, 17.3807, +20.3807, 9.3807, -10.6193, -18.6193, -3.6193, -0.6193, -12.6193, +15.3807, 1.3807, 9.3807, -10.6193, 5.3807, 11.3807, -13.6193, +5.3807, 17.3807, -1.6193, -5.6193, -10.6193, 10.3807, 7.3807, +-7.6193, 19.3807, 11.3807, 0.3807, 18.3807, -12.6193, 7.3807, +-0.6193, 5.3807, 13.3807, -7.6193, -1.6193, -2.6193, 26.3807, +0.3807, 6.3807, 7.3807, 4.3807, 23.3807, 12.3807, -7.6193, 18.3807, +10.3807, -12.6193, 0.3807, 6.3807, 15.3807, -0.6193, 9.3807, +-15.6193, -3.6193, 17.3807, 8.3807, 25.3807, 10.3807, -5.6193, +13.3807, 10.3807, -5.6193, 4.3807, 13.3807, 35.3807, -12.6193, +3.3807, 23.3807, 19.3807, 19.3807, 20.3807, 4.3807, 0.3807, 9.3807, +-22.6193, 5.3807, -4.6193, 3.3807, 6.3807, -21.6193, -12.6193, +5.3807, 5.3807, -17.6193, 7.3807, 24.3807, 17.3807, 12.3807, +-5.6193, 2.3807, 5.3807, 11.3807, 8.3807, 29.3807, -6.6193, 4.3807, +22.3807, -1.6193, 5.3807, -12.6193, 12.3807, 15.3807, 23.3807, +7.3807, 8.3807, 23.3807, 0.3807, -2.6193, -9.6193, 2.3807, 23.3807, +-8.6193, 4.3807, 1.3807, 21.3807, 3.3807, 8.3807, -6.6193, 18.3807, +-12.6193, -7.6193, -0.6193, 12.3807, -9.6193, 4.3807, -8.6193, +4.3807, 2.3807, 22.3807, 8.3807, 16.3807, 13.3807, 11.3807, 7.3807, +6.3807, 18.3807, 6.3807, 10.3807, 10.3807, -11.6193, 7.3807, +-0.6193, 18.3807, 4.3807, 4.3807, -7.6193, 0.3807, 8.3807, 4.3807, +12.3807, 5.3807, 2.3807, 22.3807, 13.3807, -5.6193, 2.3807, 5.3807, +2.3807, -9.6193, -1.6193, 3.3807, 6.3807, 3.3807, -11.6193, 1.3807, +-12.6193, 17.3807, 7.3807, -4.6193, 8.3807, -14.6193, 9.3807, +13.3807, -6.6193, 3.3807, -8.6193, 0.3807, 11.3807, 12.3807, +20.3807, 13.3807, 13.3807, 21.3807, 17.3807, 1.3807, 3.3807, +-1.6193, 0.3807, 3.3807, -8.6193, 14.3807, -11.6193, -9.6193, +14.3807, -6.6193, 4.3807, -1.6193, 15.3807, 17.3807, 15.3807, +9.3807, 16.3807, -2.6193, 1.3807, 2.3807, 0.3807, -10.6193, -2.6193, +-3.6193, -5.6193, 14.3807, -1.6193, -1.6193, 7.3807, 7.3807, +-11.6193, -15.6193, -10.6193, -0.6193, 4.3807, 2.3807, 10.3807, +-6.6193, 3.3807, -11.6193, 18.3807, -5.6193, 20.3807, 15.3807, +-6.6193, -7.6193, -4.6193, 26.3807, 16.3807, 9.3807, 5.3807, +4.3807, 5.3807, 5.3807, -3.6193, 19.3807, -6.6193, 8.3807, 14.3807, +4.3807, 0.3807, 12.3807, 1.3807, 7.3807, 20.3807, 10.3807, 0.3807, +1.3807, -4.6193, -6.6193, 20.3807, -11.6193, 0.3807, 18.3807, +9.3807, -0.6193, 8.3807, 1.3807, 8.3807, 12.3807, 6.3807, -14.6193, +7.3807, 14.3807, 8.3807, 11.3807, 18.3807, 24.3807, 17.3807, +-5.6193, 28.3807, 12.3807, 5.3807, 0.3807, 0.3807, 14.3807, 13.3807, +-6.6193, -4.6193, 5.3807, 18.3807, 5.3807, -2.6193, 1.3807, 6.3807, +0.3807, 8.3807, -6.6193, 16.3807, 8.3807, 7.3807, -1.6193, -8.6193, +-6.6193, 11.3807, 4.3807, 7.3807, 2.3807, -3.6193, 7.3807, -2.6193, +8.3807, -6.6193, 16.3807, -17.6193, -0.6193, -3.6193, 11.3807, +4.3807, 3.3807, -19.6193, 20.3807, -15.6193, -0.6193, 8.3807, +1.3807, 18.3807, 3.3807, 9.3807, 15.3807, 0.3807, 8.3807, 11.3807, +-0.6193, 15.3807, 18.3807, 9.3807, -2.6193, 2.3807, 13.3807, +-9.6193, 13.3807, -18.6193, 3.3807, 2.3807, -10.6193, 8.3807, +-6.6193, 24.3807, -2.6193, 15.3807, 6.3807, 7.3807, 5.3807, 7.3807, +14.3807, -11.6193, -8.6193, -2.6193, 12.3807, -19.6193, -5.6193, +-25.6193, -23.6193, -0.6193, 3.3807, -13.6193, -5.6193, 17.3807, +-7.6193, -1.6193, -19.6193, -3.6193, 15.3807, 21.3807, 1.3807, +-5.6193, -20.6193, 5.3807, 5.3807, -27.6193, -7.6193, -1.6193, +7.3807, 12.3807, -5.6193, -12.6193, 8.3807, 28.3807, -1.6193, +-2.6193, -0.6193, -24.6193, 8.3807, -19.6193, 13.3807, 23.3807, +9.3807, 21.3807, -4.6193, 10.3807, -17.6193, -5.6193, -11.6193, +3.3807, 12.3807, 28.3807, -9.6193, 4.3807, -0.6193, 8.3807, 5.3807, +-31.6193, 8.3807, 8.3807, -13.6193, 21.3807, -3.6193, 0.3807, +6.3807, -7.6193, -22.6193, -9.6193, -4.6193, -16.6193, -8.6193, +2.3807, 14.3807, 12.3807, 4.3807, 9.3807, -0.6193, -2.6193, -4.6193, +-16.6193, 7.3807, 7.3807, 0.3807, 8.3807, -1.6193, 0.3807, 0.3807, +6.3807, -16.6193, -6.6193, -6.6193, 20.3807, 20.3807, 3.3807, +-2.6193, 9.3807, 14.3807, -3.6193, 2.3807, 1.3807, -4.6193, 1.3807, +37.3807, -12.6193, -10.6193, 4.3807, 5.3807, -9.6193, -4.6193, +-10.6193, 2.3807, -2.6193, 3.3807, 4.3807, 10.3807, -19.6193, +-1.6193, 6.3807, 17.3807, 1.3807, 1.3807, 7.3807, -9.6193, -2.6193, +-6.6193, -34.6193, 2.3807, -21.6193, 1.3807, 20.3807, -6.6193, +-6.6193, 7.3807, -4.6193, -0.6193, 1.3807, 12.3807, 0.3807, 0.3807, +3.3807, 4.3807, -11.6193, 8.3807, 10.3807, 12.3807, 4.3807, 1.3807, +11.3807, 1.3807, 6.3807, 7.3807, 0.3807, -3.6193, 7.3807, 2.3807, +-2.6193, 7.3807, 2.3807, 1.3807, -1.6193, -7.6193, -6.6193, 5.3807, +4.3807, -5.6193, -6.6193, 11.3807, 0.3807, 6.3807, 7.3807, 7.3807, +8.3807, 1.3807, 2.3807, 9.3807, 5.3807, -10.6193, -6.6193, -1.6193, +-8.6193, 6.3807, 3.3807, -5.6193, 5.3807, 2.3807, 5.3807, -16.6193, +-6.6193, 20.3807, 8.3807, -3.6193, 24.3807, 15.3807, 8.3807, +-0.6193, -4.6193, 0.3807, 16.3807, 14.3807, -11.6193, 12.3807, +5.3807, -6.6193, -3.6193, 8.3807, 7.3807, 16.3807, -8.6193, -0.6193, +9.3807, 0.3807, -17.6193, -3.6193, 0.3807, -5.6193, -6.6193, +5.3807, 5.3807, -1.6193, 6.3807, 3.3807, 6.3807, 4.3807, 6.3807, +-8.6193, -3.6193, 7.3807, 11.3807, 2.3807, 2.3807, 5.3807, 15.3807, +9.3807, -0.6193, -7.6193, 5.3807, 10.3807, 8.3807, -2.6193, -1.6193, +14.3807, 10.3807, 4.3807, 2.3807, 7.3807, 9.3807, -16.6193, 7.3807, +4.3807, 7.3807, 14.3807, 9.3807, 21.3807, 4.3807, 3.3807, 11.3807, +11.3807, 4.3807, -3.6193, -2.6193, 13.3807, 6.3807, 0.3807, 3.3807, +4.3807, 15.3807, 8.3807, 2.3807, 11.3807, 0.3807, 3.3807, -8.6193, +14.3807, 10.3807, 3.3807, -0.6193, 0.3807, 2.3807, 13.3807, -4.6193, +14.3807, 7.3807, 12.3807, 8.3807, 3.3807, 15.3807, -0.6193, 13.3807, +-3.6193, -13.6193, 9.3807, -9.6193, 14.3807, 11.3807, 11.3807, +-1.6193, 14.3807, 4.3807, 17.3807, 4.3807, -3.6193, 4.3807, 30.3807, +9.3807, -10.6193, -0.6193, 0.3807, 0.3807, 12.3807, -9.6193, +-11.6193, 1.3807, -15.6193, 1.3807, 14.3807, -5.6193, -10.6193, +-6.6193, 19.3807, 9.3807, -6.6193, 7.3807, 24.3807, 0.3807, 9.3807, +4.3807, 29.3807, 20.3807, 18.3807, 1.3807, 20.3807, 29.3807, +10.3807, 7.3807, 8.3807, 11.3807, 20.3807, 1.3807, -10.6193, +3.3807, -11.6193, 4.3807, -8.6193, 1.3807, -1.6193, -3.6193, +9.3807, 14.3807, 1.3807, 11.3807, -1.6193, -6.6193, 10.3807, +14.3807, -6.6193, 6.3807, 24.3807, -1.6193, 12.3807, 4.3807, +17.3807, 13.3807, 4.3807, 9.3807, 19.3807, 0.3807, 2.3807, 29.3807, +2.3807, -8.6193, -8.6193, -2.6193, 5.3807, 3.3807, 25.3807, 5.3807, +7.3807, -14.6193, -27.6193, 5.3807, 6.3807, 7.3807, -18.6193, +8.3807, 12.3807, 11.3807, -18.6193, 15.3807, -9.6193, -21.6193, +-1.6193, 7.3807, 7.3807, -3.6193, -6.6193, 9.3807, 0.3807, -8.6193, +12.3807, -13.6193, 11.3807, 0.3807, 6.3807, 4.3807, 6.3807, 0.3807, +-4.6193, 10.3807, 13.3807, 17.3807, 5.3807, 15.3807, -0.6193, +-9.6193, 37.3807, 4.3807, 18.3807, 22.3807, 7.3807, -0.6193, +16.3807, -6.6193, 16.3807, -3.6193, -2.6193, 6.3807, 6.3807, +-7.6193, 4.3807, 12.3807, 3.3807, -13.6193, 17.3807, 4.3807, +-26.6193, -23.6193, 0.3807, 3.3807, 6.3807, -12.6193, -1.6193, +-2.6193, 2.3807, -0.6193, -5.6193, 8.3807, -5.6193, 5.3807, 10.3807, +-15.6193, -21.6193, 16.3807, -8.6193, -9.6193, 3.3807, -5.6193, +9.3807, -15.6193, 1.3807, 11.3807, -7.6193, -6.6193, 20.3807, +1.3807, -5.6193, 20.3807, 8.3807, -3.6193, 26.3807, 11.3807, +-11.6193, -8.6193, -4.6193, 1.3807, -26.6193, -17.6193, -7.6193, +11.3807, -12.6193, 9.3807, 0.3807, -19.6193, -16.6193, -7.6193, +-9.6193, 3.3807, -1.6193, -11.6193, 22.3807, 6.3807, 2.3807, +11.3807, -10.6193, -14.6193, -2.6193, -21.6193, -9.6193, -1.6193, +1.3807, 23.3807, 0.3807, -3.6193, 18.3807, -1.6193, -7.6193, +5.3807, 21.3807, -14.6193, -20.6193, 14.3807, -12.6193, 2.3807, +6.3807, -1.6193, 7.3807, 12.3807, -12.6193, -27.6193, 18.3807, +1.3807, -2.6193, -18.6193, 4.3807, 1.3807, -7.6193, -18.6193, +-11.6193, 3.3807, -20.6193, 18.3807, 9.3807, -5.6193, -6.6193, +-0.6193, 2.3807, -34.6193, -16.6193, -9.6193, -0.6193, 0.3807, +15.3807, 4.3807, 4.3807, -26.6193, -1.6193, -10.6193, 16.3807, +8.3807, -19.6193, -5.6193, 2.3807, 6.3807, 0.3807, -10.6193, +-4.6193, -3.6193, -14.6193, -15.6193, -14.6193, 0.3807, 1.3807, +-17.6193, -8.6193, -7.6193, 0.3807, -7.6193, 4.3807, -18.6193, +-3.6193, 8.3807, -11.6193, -12.6193, -20.6193, -8.6193, 13.3807, +-11.6193, -18.6193, 17.3807, -0.6193, 3.3807, -8.6193, -24.6193, +18.3807, -20.6193, -27.6193, -22.6193, 5.3807, -24.6193, 0.3807, +-30.6193, -16.6193, -4.6193, -8.6193, 15.3807, -3.6193, 7.3807, +4.3807, -19.6193, -22.6193, -6.6193, 0.3807, 1.3807, -24.6193, +-12.6193, -5.6193, 1.3807, -6.6193, -1.6193, 2.3807, 0.3807, +15.3807, -7.6193, -11.6193, 1.3807, 9.3807, 7.3807, -8.6193, +-5.6193, -22.6193, -1.6193, -14.6193, 22.3807, -16.6193, -17.6193, +-13.6193, -34.6193, -2.6193, -13.6193, -7.6193, -5.6193, -8.6193, +-20.6193, -17.6193, 3.3807, -5.6193, -13.6193, -15.6193, -23.6193, +17.3807, -24.6193, 2.3807, -12.6193, -13.6193, 2.3807, -7.6193, +3.3807, -8.6193, 6.3807, -8.6193, -7.6193, -19.6193, -14.6193, +-12.6193, 8.3807, 1.3807, -6.6193, -16.6193, 1.3807, -6.6193, +-7.6193, -31.6193, -12.6193, 3.3807, 7.3807, -0.6193, 12.3807, +12.3807, 2.3807, 6.3807, 4.3807, -10.6193, -9.6193, -6.6193, +-20.6193, -3.6193, -5.6193, 7.3807, -17.6193, -19.6193, 1.3807, +-20.6193, -6.6193, 3.3807, -13.6193, -22.6193, -12.6193, 6.3807, +-29.6193, -25.6193, -10.6193, 0.3807, 19.3807, -10.6193, -1.6193, +-0.6193, -28.6193, -2.6193, -0.6193, -10.6193, 9.3807, -7.6193, +12.3807, -19.6193, -18.6193, -0.6193, -1.6193, -10.6193, -6.6193, +-21.6193, -32.6193, -0.6193, -7.6193, -10.6193, -19.6193, 9.3807, +-34.6193, -10.6193, 2.3807, -27.6193, -2.6193, -6.6193, -22.6193, +2.3807, -1.6193, 4.3807, 1.3807, 0.3807, 13.3807, -6.6193, 9.3807, +-15.6193, -29.6193, -11.6193, -17.6193, -10.6193, 10.3807, 7.3807, +-15.6193, -7.6193, -11.6193, -2.6193, -8.6193, -31.6193, 7.3807, +-6.6193, -8.6193, -8.6193, -14.6193, -1.6193, -16.6193, 0.3807, +-4.6193, 3.3807, 5.3807, 11.3807, -7.6193, -0.6193, 2.3807, -18.6193, +-0.6193, 10.3807, -23.6193, -4.6193, 20.3807, -6.6193, -0.6193, +-9.6193, -9.6193, 3.3807, 5.3807, -2.6193, 4.3807, -1.6193, 10.3807, +2.3807, -12.6193, -9.6193, 2.3807, -2.6193, 6.3807, -15.6193, +-15.6193, 10.3807, 7.3807, 5.3807, -13.6193, 8.3807, -12.6193, +-9.6193, -19.6193, 5.3807, -1.6193, 4.3807, -4.6193, -7.6193, +-25.6193, 0.3807, 16.3807, -34.6193, 5.3807, -17.6193, -18.6193, +-3.6193, 1.3807, 4.3807, -6.6193, -7.6193, -9.6193, -2.6193, +-8.6193, 12.3807, -11.6193, 10.3807, -17.6193, -4.6193, 7.3807, +3.3807, 10.3807, -3.6193, -9.6193, -4.6193, -16.6193, 14.3807, +-4.6193, -28.6193, 1.3807, -8.6193, 4.3807, -9.6193, 4.3807, +-22.6193, -4.6193, 2.3807, -11.6193, -11.6193, -8.6193, -1.6193, +4.3807, 6.3807, 0.3807, -22.6193, -9.6193, 5.3807, 4.3807, -8.6193, +-3.6193, 13.3807, -17.6193, -12.6193, 2.3807, -5.6193, -7.6193, +-9.6193, -13.6193, -10.6193, 8.3807, 16.3807, -13.6193, -1.6193, +-3.6193, -4.6193, 10.3807, 5.3807, -3.6193, -0.6193, -26.6193, +-13.6193, -13.6193, -12.6193, -11.6193, 8.3807, 8.3807, -4.6193, +-6.6193, 35.3807, 0.3807, 7.3807, 7.3807, -22.6193, -12.6193, +-22.6193, 6.3807, -0.6193, 4.3807, -4.6193, -6.6193, 10.3807, +-8.6193, -4.6193, -2.6193, -0.6193, 2.3807, 1.3807, -23.6193, +8.3807, -5.6193, 23.3807, -25.6193, -8.6193, -3.6193, -2.6193, +5.3807, -10.6193, 20.3807, -4.6193, 10.3807, 3.3807, 18.3807, +8.3807, -1.6193, 10.3807, 2.3807, 10.3807, -8.6193, 26.3807, +16.3807, 7.3807, 14.3807, -0.6193, -11.6193, -19.6193, 9.3807, +12.3807, -4.6193, -3.6193, 35.3807, -5.6193, 35.3807, 23.3807, +14.3807, -1.6193, 3.3807, -10.6193, -6.6193, -0.6193, -6.6193, +-0.6193, 3.3807, 1.3807, -3.6193, -10.6193, -0.6193, 3.3807, +-16.6193, 6.3807, 3.3807, -13.6193, -5.6193, -0.6193, -27.6193, +-23.6193, -2.6193, 6.3807, -3.6193, -21.6193, -7.6193, -0.6193, +-2.6193, 0.3807, 2.3807, 8.3807, 3.3807, -9.6193, -15.6193, -6.6193, +-4.6193, -12.6193, -1.6193, -10.6193, 0.3807, -13.6193, -11.6193, +-12.6193, -6.6193, 0.3807, -1.6193, -20.6193, -2.6193, -0.6193, +-19.6193, -21.6193, -1.6193, -7.6193, 14.3807, -30.6193, -34.6193, +7.3807, -1.6193, 13.3807, 6.3807, 5.3807, -14.6193, -20.6193, +-20.6193, 7.3807, -12.6193, -30.6193, -6.6193, -5.6193, -5.6193, +21.3807, -10.6193, -19.6193, 1.3807, 3.3807, -5.6193, 6.3807, +-0.6193, -15.6193, 1.3807, 7.3807, -0.6193, -11.6193, -17.6193, +-21.6193, -13.6193, 13.3807, -5.6193, -18.6193, 0.3807, -26.6193, +14.3807, 1.3807, 1.3807, -0.6193, -18.6193, -14.6193, -10.6193, +1.3807, 17.3807, -13.6193, 7.3807, -4.6193, -2.6193, -5.6193, +17.3807, 8.3807, -2.6193, 15.3807, 26.3807, 1.3807, -0.6193, +-6.6193, 7.3807, -4.6193, 1.3807, -21.6193, -12.6193, 4.3807, +5.3807, -4.6193, 1.3807, -1.6193, -2.6193, 12.3807, 4.3807, -33.6193, +1.3807, 20.3807, 29.3807, -1.6193, 5.3807, 3.3807, 0.3807, -4.6193, +-5.6193, 3.3807, 3.3807, 15.3807, -1.6193, -4.6193, -12.6193, +-1.6193, 4.3807, -5.6193, -0.6193, 3.3807, 11.3807, 1.3807, 2.3807, +14.3807, 11.3807, -2.6193, -1.6193, 1.3807, -2.6193, 23.3807, +-5.6193, 4.3807, -21.6193, -30.6193, 2.3807, -14.6193, 2.3807, +11.3807, -1.6193, -9.6193, 6.3807, -13.6193, -26.6193, 12.3807, +11.3807, 17.3807, -33.6193, -5.6193, 29.3807, -8.6193, -26.6193, +3.3807, -16.6193, 5.3807, -4.6193, -5.6193, -6.6193, -1.6193, +6.3807, -1.6193, 2.3807, 7.3807, 11.3807, -1.6193, -2.6193, 16.3807, +-5.6193, -2.6193, -11.6193, -2.6193, -0.6193, -4.6193, 1.3807, +20.3807, -11.6193, -2.6193, -13.6193, -15.6193, 7.3807, -3.6193, +1.3807, -7.6193, 16.3807, -4.6193, 0.3807, -3.6193, -6.6193, +20.3807, -8.6193, 12.3807, 1.3807, -17.6193, -3.6193, -18.6193, +-13.6193, 23.3807, -15.6193, -9.6193, -10.6193, 4.3807, -21.6193, +4.3807, -17.6193, -5.6193, -0.6193, 9.3807, -15.6193, -5.6193, +-16.6193, -17.6193, -0.6193, 13.3807, 13.3807, 3.3807, -7.6193, +17.3807, -3.6193, 11.3807, -3.6193, -9.6193, 8.3807, 8.3807, +5.3807, -3.6193, 6.3807, -5.6193, -19.6193, -30.6193, 10.3807, +19.3807, 8.3807, 13.3807, -0.6193, 16.3807, 16.3807, 7.3807, +2.3807, 13.3807, -1.6193, 2.3807, -31.6193, 5.3807, -0.6193, +21.3807, 21.3807, -10.6193, -13.6193, 36.3807, -2.6193, 21.3807, +-13.6193, -0.6193, -26.6193, -13.6193, -13.6193, -13.6193, -0.6193, +25.3807, -4.6193, 6.3807, 17.3807, -13.6193, 2.3807, 20.3807, +-23.6193, -6.6193, -7.6193, -5.6193, 3.3807, -24.6193, -24.6193, +-13.6193, -25.6193, -13.6193, 13.3807, -6.6193, -25.6193, -28.6193, +7.3807, -2.6193, 1.3807, -5.6193, 1.3807, -12.6193, -1.6193, +-2.6193, -25.6193, 9.3807, 3.3807, -1.6193, -10.6193, 11.3807, +-10.6193, 7.3807, 1.3807, 23.3807, -9.6193, 7.3807, -9.6193, +5.3807, -7.6193, -4.6193, -6.6193, -11.6193, 25.3807, 15.3807, +-22.6193, 7.3807, 17.3807, -13.6193, -13.6193, -29.6193, 6.3807, +5.3807, -0.6193, -19.6193, -23.6193, 4.3807, 14.3807, -2.6193, +-16.6193, 20.3807, -11.6193, 7.3807, 7.3807, 8.3807, -8.6193, +18.3807, -4.6193, 3.3807, -3.6193, -4.6193, -0.6193, 5.3807, +2.3807, 5.3807, -24.6193, -18.6193, -13.6193, -11.6193, -0.6193, +7.3807, -7.6193, 16.3807, 17.3807, -34.6193, 9.3807, -10.6193, +-8.6193, -23.6193, -11.6193, -1.6193, -10.6193, -1.6193, -6.6193, +-2.6193, 5.3807, 24.3807, 1.3807, 19.3807, -23.6193, 21.3807, +-15.6193, 17.3807, -4.6193, 14.3807, -8.6193, -20.6193, 0.3807, +-4.6193, -6.6193, 18.3807, -5.6193, 0.3807, -21.6193, 8.3807, +7.3807, -11.6193, -7.6193, 23.3807, -22.6193, -0.6193, 4.3807, +-3.6193, -0.6193, -4.6193, 6.3807, 1.3807, -18.6193, 29.3807, +10.3807, -0.6193, -3.6193, -0.6193, 1.3807, 2.3807, -9.6193, +7.3807, -14.6193, 13.3807, -4.6193, 10.3807, 16.3807, -8.6193, +-6.6193, -25.6193, 8.3807, -11.6193, 5.3807, 5.3807, -9.6193, +7.3807, -18.6193, 18.3807, 6.3807, 18.3807, 12.3807, 0.3807, +-11.6193, 6.3807, -27.6193, -13.6193, 1.3807, -2.6193, 2.3807, +-9.6193, 20.3807, -4.6193, 4.3807, -6.6193, 4.3807, -14.6193, +8.3807, 9.3807, -13.6193, -0.6193, 5.3807, 11.3807, -25.6193, +-9.6193, 17.3807, -4.6193, 12.3807, -22.6193, -6.6193, 0.3807, +18.3807, 31.3807, 18.3807, -7.6193, -8.6193, 16.3807, -4.6193, +4.3807, -4.6193, 8.3807, -6.6193, 15.3807, 9.3807, 3.3807, -8.6193, +5.3807, -29.6193, -34.6193, -11.6193, -13.6193, 5.3807, -6.6193, +7.3807, -22.6193, -3.6193, -9.6193, -11.6193, -10.6193, -18.6193, +4.3807, -9.6193, -3.6193, -2.6193, 9.3807, 6.3807, -3.6193, 16.3807, +10.3807, 3.3807, -15.6193, -27.6193, -0.6193, -19.6193, 10.3807, +3.3807, 9.3807, 3.3807, 10.3807, -2.6193, 3.3807, 11.3807, 1.3807, +-14.6193, 9.3807, 7.3807, 1.3807, 3.3807, -0.6193, -13.6193, +0.3807, -5.6193, -16.6193, -5.6193, 1.3807, 2.3807, 5.3807, 11.3807, +-16.6193, 11.3807, 10.3807, -9.6193, -4.6193, 2.3807, -21.6193, +2.3807, 20.3807, 12.3807, 3.3807, 11.3807, -17.6193, 11.3807, +-3.6193, -4.6193, -13.6193, 15.3807, -9.6193, 20.3807, 23.3807, +11.3807, -6.6193, 15.3807) +M <- +38 +N <- +1978 +R <- +structure(c(0.1, 0.005, 0.005, 0.005, 0.1, 0.005, 0.005, 0.005, +0.1), .Dim = c(3, 3)) +school <- +c(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, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 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, 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, 2, +2, 2, 2, 2, 2, 3, 3,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, 9, 9, 9, +9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, +9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, +11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, +16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, +17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, +17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, +17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, +18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, +18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, +18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, +18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, +18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, +19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, +23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, +23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, +30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, +30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, +30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, +30, 30, 30, 30, 31, 32, 32, 32, 32, 32, 32, 32, 33, 34, 34, 35, +35, 36, 37, 37, 37, 37, 38) +School_denom <- +structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 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, +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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 0, 0, 0, 0, 0, 0, 0, +0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0), .Dim = c(1978, 2)) +Y <- +c(-0.6058763, 0.9911532, -1.5640939, 0.112787, 0.7515988, 0.5918959, +0.7515988, -1.0849851, -1.8036484, 1.3904106, 0.9113018, 0.4321929, +1.1508562, -0.3663218, 1.5501135, -0.2066189, 0.3523414, 0.4321929, +-0.9252821, 1.0710047, -0.3663218, -0.1267674, -1.244688, -0.2864704, +-0.4461733, -0.5260248, 0.1926385, -1.4842425, 1.1508562, -0.2066189, +-1.404391, -0.6857277, 0.112787, 0.27249, 1.1508562, 0.112787, +-0.5260248, 0.3523414, 1.1508562, 0.27249, -0.1267674, 0.5120444, +0.5120444, 0.9113018, 0.9113018, -1.0051336, 0.1926385, -0.5260247, +-0.6857277, -0.9252821, 0.4321929, 0.2724899, 0.7515988, -0.5260247, +-0.3663218, -1.6439454, -1.5640939, 0.2724899, -1.4043909, 0.1926384, +-1.1648365, -0.6058762, 1.8695194, 1.3904105, -1.7237968, -1.244688, +2.6680341, -1.3245395, -1.3245395, -0.8454306, -0.2066188, -1.0051336, +0.4321929, -0.3663218, -0.1267674, -1.1648365, -2.0432027, 0.5120443, +1.1508561, -0.5260247, 0.7515988, -0.3663218, 0.112787, -0.1267674, +1.2307076, 1.470262, 1.2307076, 1.3105591, 0.6717473, -1.3245395, +-0.3663218, 1.0710047, -0.0469159, 0.6717473, -0.6058762, -1.0849851, +-0.5260247, 1.5501135, 0.2724899, 0.3523414, 2.1090738, -0.6058762, +1.0710047, 0.4321929, -1.1648365, -0.0469159, -1.244688, -0.1267674, +-0.5260247, 2.0292223, 0.6717473, 0.5918958, -0.2066188, 1.470262, +0.4321929, -0.7655792, 0.5918958, -0.4461733, 0.0329355, 1.2307076, +-0.7655792, 0.4321929, -0.7655792, 0.3523414, 0.5918958, -1.4043909, +1.7896679, -0.4461733, 0.0329355, 0.0329355, -0.3663218, -0.0469159, +1.470262, -0.5260247, 2.5881827, -0.0469159, 0.3523414, 1.629965, +-1.3245395, -1.8834998, -0.6857277, -0.0469159, -1.8834998, -0.3663218, +0.5918958, -0.0469159, -1.8036483, 0.5120443, 0.9113017, -1.4842424, +-1.4043909, 1.0710047, -0.2864703, -1.0849851, -0.2864703, 0.9911532, +1.629965, -0.5260247, 1.470262, 0.6717473, -0.6857277, 0.4321929, +-0.6058762, 0.5918958, 0.112787, -0.6857277, 1.2307076, -0.9252821, +-0.0469159, -1.244688, 0.112787, -1.1648365, -0.6857277, -1.0849851, +1.3904105, 1.9493709, -1.0849851, -0.4461733, 2.1090738, -1.1648365, +-0.5260247, -0.2066188, 0.3523414, 1.7896679, 1.629965, 0.3523414, +-1.0051336, 0.6717473, 1.5501135, -0.2066188, 2.0292223, -0.0469159, +0.3523414, 0.1926384, 0.9911532, -0.2864703, -1.244688, -0.1267674, +0.9911532, -0.6857277, -0.5260247, 0.8314502, 1.2307076, 0.9911532, +0.7515988, 1.0710047, -0.7655792, 0.5918958, -0.9252821, -0.2864703, +-1.5640939, 0.2724899, -0.4461733, 0.8314502, -1.1648365, 0.7515988, +-0.0469159, -1.7237968, -1.3245395, 1.3904105, 1.0710047, 0.8314502, +-1.0849851, 1.7098164, -0.1267674, -0.2066188, -1.0051336, 1.7098164, +-0.3663218, 1.470262, 1.5501135, 0.9911532, 1.2307076, -0.8454306, +-0.1267674, 0.5918958, 0.7515988, 1.3904105, 0.4321929, 0.112787, +0.3523414, 0.2724899, -1.4842424, 0.1926384, 2.1889253, 0.2724899, +-1.4043909, -1.3245395, 1.470262, 1.0710047, 0.0329355, -0.2864703, +2.1889253, 0.1926384, -1.4043909, 0.0329355, 0.8314502, -1.8834998, +-0.1267674, -0.1267674, 0.8314502, -0.0469159, 2.2687768, 0.5120443, +1.2307076, 0.7515988, 1.470262, 0.0329355, 1.470262, 0.1926384, +0.2724899, 0.0329355, 0.5918958, -1.0849851, 0.8314502, -1.7237968, +1.3904105, -1.1648365, 0.6717473, -0.6857277, -0.6857277, -1.0051336, +-0.6857277, 0.9911532, 1.470262, -0.0469159, 1.9493709, 1.0710047, +-0.2066188, -0.0469159, 1.3904105, 0.6717473, 0.4321929, 0.8314502, +-0.2066188, 1.1508561, -0.2864703, 1.2307076, -0.5260247, -0.6058762, +0.112787, 0.4321929, -1.4043909, -0.9252821, -1.6439454, 1.470262, +0.7515988, -0.8454306, -0.1267674, -0.6058762, -0.0469159, 0.2724899, +2.5881827, 1.9493709, 0.4321929, -1.1648365, 1.9493709, 2.1889253, +0.8314502, 0.1926384, 0.3523414, 0.6717473, -0.4461733, -0.6058762, +0.8314502, -0.3663218, -1.7237968, 1.3904105, -0.8454306, 0.5120443, +-1.244688, 1.0710047, 0.5120443, 1.3904105, -0.4461733, -0.2864703, +-0.1267674, -0.8454306, -1.4842424, 0.3523414, -1.4842424, -0.0469159, +-0.8454306, -0.1267674, 0.9113017, -0.9252821, -0.9252821, 0.2724899, +-0.2066188, -1.0849851, -1.0051336, -0.8454306, 0.0329355, 1.7896679, +-0.2066188, 2.2687768, 0.0329355, -1.1648365, -1.0849851, 0.112787, +-0.6058762, 2.5083312, 1.2307076, -0.6857277, -0.8454306, 0.6717473, +0.5918958, 1.3904105, 1.9493709, 0.0329355, 0.2724899, -0.3663218, +0.8314502, -0.1267674, 0.8314502, -1.9633513, 1.629965, 1.470262, +-1.3245395, 0.3523414, -0.6058762, -0.1267674, -0.5260247, -0.5260247, +1.9493709, -1.0051336, 0.0329355, -1.4842424, 0.9113017, 1.3904105, +-0.2066188, 0.8314502, 0.9911532, -0.3663218, -0.7655792, -0.6058762, +-0.2066188, 0.112787, 0.6717473, -0.8454306, 0.9911532, 1.3105591, +1.0710047, -0.7655792, -0.0469159, 0.112787, 0.9113017, 0.0329355, +0.0329355, -0.8454306, 0.3523414, 0.112787, -0.2066188, -1.7237968, +0.8314502, 0.112787, -0.9252821, 0.5120443, -0.4461733, 0.5918958, +-0.0469159, -1.5640939, -1.8036483, -0.9252821, 0.5120443, 0.5120443, +-0.6857277, -0.3663218, -0.2066188, 0.0329355, -0.4461733, -1.0051336, +-1.7237968, 0.5120443, -1.4842424, 0.6717473, 1.0710047, -0.7655792, +0.8314502, -0.6058762, -0.3663218, -1.4043909, -0.5260247, -1.244688, +-0.2066188, -1.1648365, -0.1267674, -0.3663218, -0.0469159, -0.2864703, +-0.3663218, -0.7655792, -0.6058762, 0.2724899, 0.2724899, 0.9113017, +0.5918958, 0.8314502, 1.5501135, -1.1648365, 0.112787, 0.2724899, +-0.2864703, 1.2307076, 0.8314502, 0.9113017, -0.5260247, -0.0469159, +-0.2066188, -0.6857277, 0.7515988, -1.1648365, -0.9252821, -0.7655792, +-0.2864703, -0.2864703, -0.4461733, 0.112787, -0.8454306, -0.0469159, +-0.7655792, 1.1508561, -0.7655792, 0.112787, 0.5918958, -0.6857277, +-0.8454306, 0.7515988, 0.5120443, -1.9633513, -0.2864703, -0.2066188, +-1.4842424, -0.1267674, -0.5260247, -1.1648365, -1.4043909, 1.0710047, +0.1926384, 1.1508561, -0.1267674, -0.8454306, 0.7515988, 1.7098164, +-1.244688, -1.0849851, -1.9633513, 0.5120443, -0.3663218, 0.1926384, +-0.9252821, -0.2066188, 0.112787, -0.3663218, 0.5120443, -0.1267674, +0.5918958, 0.5120443, -0.3663218, -1.0051336, 0.8314502, -1.6439454, +1.470262, -0.3663218, 0.2724899, 1.470262, -0.5260247, 1.629965, +0.7515988, -0.1267674, -1.9633513, 0.0329355, -1.0849851, -1.244688, +1.3904105, 0.5918958, -0.2864703, -0.2864703, -0.0469159, 0.4321929, +-0.7655792, -1.244688, 0.9911532, 1.1508561, -0.3663218, 1.5501135, +-0.7655792, 0.5120443, 1.8695194, -0.1267674, 0.4321929, 0.5918958, +-0.1267674, -1.3245395, -0.4461733, -0.9252821, 1.1508561, 1.7896679, +0.112787, -0.2864703, -1.0849851, -1.3245395, 0.1926384, -1.1648365, +-0.4461733, 0.112787, -0.2066188, 0.2724899, 0.3523414, -1.0051336, +-1.5640939, 0.112787, -0.2066188, -0.6058762, -0.6058762, -0.0469159, +-0.2864703, -0.9252821, -0.9252821, -0.5260247, 1.3105591, -0.6058762, +-1.6439454, 0.9113017, -1.4043909, 0.9911532, 1.3105591, -0.0469159, +0.4321929, 0.5918958, 0.5918958, 1.629965, 1.470262, -1.8036483, +0.0329355, -0.8454306, 0.1926384, 0.4321929, 0.9911532, -0.3663218, +-0.3663218, 1.3105591, 0.4321929, 0.5918958, -0.4461733, 0.8314502, +-0.2864703, -0.6857277, -0.8454306, -1.6439454, -0.7655792, -2.1230542, +-1.244688, 2.5881827, -0.6857277, -0.0469159, -0.3663218, 1.0710047, +-0.3663218, -0.4461733, -0.6857277, -0.0469159, 0.9113017, 0.9911532, +-0.4461733, -0.6857277, -1.0849851, -0.1267674, 0.5120443, -1.0051336, +0.112787, 1.2307076, -0.2864703, 0.5918958, 0.112787, 0.7515988, +-0.2066188, -0.3663218, -0.7655792, -1.5640939, -1.0849851, 0.4321929, +-0.6857277, -0.7655792, 0.6717473, -1.244688, 0.3523414, 1.1508561, +2.0292223, -0.5260247, 0.0329355, 0.7515988, -0.0469159, 1.7896679, +0.112787, 0.112787, -0.2066188, 0.4321929, -1.0051336, 0.112787, +-0.6857277, 0.0329355, -0.2066188, -0.4461733, -0.6058762, 1.7896679, +-1.0849851, 0.9113017, -0.2066188, -0.0469159, 1.0710047, -0.2066188, +1.8695194, 0.4321929, -0.0469159, 1.7896679, -0.9252821, 0.9113017, +1.2307076, 0.9113017, -0.6857277, 1.7098164, -0.3663218, -1.1648365, +-0.3663218, -0.6058762, -1.3245395, -1.0051336, 0.8314502, 1.2307076, +1.7896679, -0.4461733, -0.5260247, 0.112787, 1.629965, 0.9911532, +-1.0051336, 1.5501135, -0.0469159, -1.7237968, 0.6717473, -0.8454306, +-1.0051336, 0.5120443, -1.8036483, -1.0051336, 0.112787, 1.470262, +0.5120443, -0.7655792, 1.0710047, 1.3105591, 1.1508561, 0.5120443, +0.9113017, 1.2307076, 1.0710047, -0.9252821, 0.1926384, 0.1926384, +-0.0469159, 0.6717473, 0.4321929, 0.1926384, 0.5918958, -0.0469159, +-0.5260247, -0.2864703, 0.7515988, 0.112787, -1.4842424, 0.5120443, +0.6717473, 1.7896679, -0.0469159, 1.9493709, 1.629965, -1.0051336, +-0.2864703, 0.5120443, 0.4321929, 0.6717473, 0.8314502, -0.7655792, +1.7896679, -0.6058762, -1.244688, 1.7896679, 0.0329355, 1.629965, +-0.7655792, -0.6857277, 2.34862828, 0.99115323, 0.03293554, -0.60587625, +1.23070765, -0.60587625, -0.7655792, -0.12676741, 0.59189586, +-0.04691593, 0.67174733, -0.12676741, 0.11278701, 0.43219291, +0.7515988, 0.59189586, 1.39041059, 1.62996502, 0.91130175, 0.99115323, +-0.68572773, -0.7655792, 1.94937091, -1.16483657, -0.60587625, +2.10907386, 0.19263849, 0.59189586, 0.7515988, -1.40439099, 2.02922239, +0.43219291, -0.68572773, -0.92528215, 1.15085617, 0.35234143, +0.43219291, -0.20661888, 1.55011354, -0.60587625, 2.18892533, +0.19263849, 0.67174733, 1.70981649, -1.88349983, 0.03293554, +1.62996502, -0.366321, 0.1926384, 0.7515988, 1.629965, -0.0469159, +-0.1267674, 1.3904105, 1.3105591, -0.2066188, -0.2864703, 0.2724899, +2.0292223, 2.0292223, 1.5501135, 0.9113017, 1.5501135, 1.9493709, +0.3523414, 0.8314502, 1.5501135, 1.1508561, 1.3105591, -0.1267674, +1.2307076, 0.5120443, -0.3663218, 0.9113017, 0.9911532, -0.2864703, +-0.4461733, 0.5120443, 0.5120443, 0.8314502, 0.5918958, 0.5918958, +1.3904105, 0.0329355, 1.629965, 1.7896679, 0.5918958, 1.470262, +2.2687768, 0.112787, 1.470262, -0.9252821, 1.3904105, 0.8314502, +-0.28647, -1.0051336, 2.1090738, 0.2724899, 1.470262, 2.2687768, +0.5918958, -0.6857277, 0.112787, 0.7515988, 0.4321929, 1.1508561, +1.3904105, 1.7098164, 0.9911532, -0.1267674, -1.0849851, 1.7896679, +1.3904105, 0.1926384, -1.1648365, 0.9113017, -0.2066188, 1.5501135, +-0.1267674, 1.2307076, -0.4461733, -1.4842424, 1.1508561, 0.4321929, +0.5918958, 0.3523414, 0.112787, 0.1926384, 0.112787, -0.6058762, +1.3904105, 0.3523414, 1.7098164, 0.3523414, 0.5918958, -0.0469159, +0.0329355, 1.8695194, 0.5918958, 0.9113017, 0.112787, 1.94937, +-0.206618, -0.126767, -0.28647, -0.206618, 2.109073, -1.40439, +1.150856, -0.046915, -0.366321, 0.591895, 0.432192, 0.512044, +0.512044, -0.206618, -1.084985, -0.605876, -1.244688, -0.28647, +-0.765579, 1.071004, -0.446173, -1.084985, 1.230707, 0.83145, +-1.40439, -0.526024, -0.446173, 0.032935, 0.751598, -1.244688, +0.751598, 0.83145, 0.112787, -0.046915, 0.032935, 0.352341, -0.366321, +-0.526024, 0.352341, 0.591895, -1.643945, -0.446173, -1.883499, +-1.084985, -0.765579, -0.446173, -0.92528, -0.84543, -0.605876, +1.789667, -0.925282, -0.84543, -0.84543, -0.605876, -1.643945, +-0.126767, -0.765579, -1.324539, -0.126767, 1.550113, -1.723796, +-0.925282, -0.925282, -0.366321, -0.925282, -1.40439, -1.40439, +0.83145, -1.883499, 0.512044, 0.352341, -0.28647, -1.723796, +-0.685727, -1.963351, -1.164836, -0.366321, -0.366321, 1.230707, +-0.046915, -0.28647, 0.352341, -0.84543, -1.883499, -0.366321, +-1.883499, -1.164836, 0.272489, 0.192638, 0.192638, -1.244688, +-1.244688, 0.192638, 0.512044, -1.8834998, -0.8454306, -0.5260247, +-1.0051336, 0.9911532, -0.2864703, -1.5640939, 0.7515988, -0.5260247, +0.9911532, -0.7655792, 0.8314502, -1.8036483, -2.0432027, 0.9911532, +-0.7655792, -1.0051336, -1.0051336, 0.0329355, -1.8834998, -0.2864703, +-1.9633513, 1.0710047, -1.7237968, -0.9252821, 0.4321929, 2.2687768, +-0.1267674, 1.1508561, 0.3523414, 1.7896679, -0.6857277, -1.1648365, +-0.5260247, -0.0469159, 1.2307076, 2.1090738, -0.2066188, -0.4461733, +0.112787, -1.3245395, 1.8695194, 0.4321929, 2.1889253, 0.6717473, +-1.9633513, -0.36632, 0.671747, 0.192638, -0.685727, -0.84543, +0.751598, -0.685727, -1.40439, 0.83145, -0.765579, -0.526024, +-0.925282, 1.310559, 0.991153, 0.83145, -1.084985, -0.84543, +-0.28647, 0.352341, -0.046915, 0.112787, -0.126767, -0.446173, +1.071004, -0.28647, -1.164836, -0.84543, 0.192638, 0.272489, +-0.046915, -0.206618, -1.643945, 0.671747, -1.963351, -2.123054, +-2.123054, -0.605876, -1.564093, 0.751598, -1.564093, -0.206618, +-1.244688, -1.084985, 0.352341, 0.032935, 1.150856, -0.126767, +-0.84543, -1.084985, -0.765579, 0.512044, -0.126767, -0.84543, +-0.28647, -0.366321, -0.685727, -0.685727, -1.564093, 0.432192, +-0.28647, 0.192638, -0.526024, -0.765579, -0.526024, 0.032935, +0.83145, -0.046915, -0.605876, -0.925282, 0.911301, -0.685727, +0.512044, -1.084985, -0.206618, -0.685727, -2.123054, -0.366321, +0.591895, -0.366321, -0.925282, -1.564093, -0.526024, -0.605876, +-1.40439, 0.192638, -1.164836, -1.164836, -1.963351, 0.272489, +-0.605876, 0.352341, 1.310559, -0.046915, 0.192638, 0.59189, +0.352341, -0.925282, -0.126767, 0.991153, -0.925282, -1.803648, +-0.685727, -1.164836, 0.591895, 0.911301, -0.446173, -0.446173, +1.310559, 0.27249, 0.192638, -1.324539, 0.27249, -0.605876, 1.470262, +-0.685727, 1.470262, -1.404391, 0.352341, 1.071004, -1.164836, +-0.366321, -1.164836, -1.164836, -0.366321, -0.366321, -1.164836, +0.83145, -0.126767, -0.366321, -0.446173, -1.005133, -1.164836, +-0.206618, -0.446173, -1.244688, -0.84543, 0.27249, -0.446173, +-1.484242, 0.112787, -0.366321, 0.67174, -0.366321, 0.991153, +0.352341, -1.723796, -0.526024, 0.671747, -0.28647, 0.591895, +-1.40439, 1.94937, -0.446173, -1.005133, 0.591895, 0.911301, +-2.043202, -0.765579, -1.244688, -1.803648, -0.126767, -0.765579, +-0.765579, -1.324539, 1.629965, 0.112787, 0.432192, 0.751598, +-1.883499, 0.032935, -0.685727, -1.564093, 0.192638, 0.512044, +0.591895, -1.005133, -0.84543, 0.991153, -0.126767, 0.991153, +-1.005133, -1.40439, -1.005133, 0.272489, -1.005133, 0.911301, +0.032935, -0.84543, 0.03293, -1.084985, 0.192638, 0.751598, -0.685727, +1.709816, -0.366321, -1.084985, -1.40439, -0.605876, -1.244688, +-1.324539, 0.352341, -0.206618, 0.991153, -1.005133, -0.925282, +0.352341, -0.84543, -0.366321, -1.005133, -0.605876, 0.112787, +-1.643945, -1.164836, -0.366321, -1.244688, -0.605876, -0.765579, +-1.324539, -1.084985, -1.084985, -0.526024, -1.244688, 0.032935, +0.192638, -0.366321, -1.40439, -1.40439, -1.723796, -1.244688, +0.192638, -0.28647, -1.244688, -0.206618, -1.40439, -1.484242, +-1.08498, -0.28647, -1.164836, -1.244688, -1.484242, -1.244688, +-0.84543, -0.206618, -0.366321, -0.765579, -1.40439, 0.112787, +-0.046915, -1.963351, -0.526024, -0.605876, 0.671747, -0.925282, +-1.164836, -1.005133, 0.192638, -1.005133, -1.484242, -0.526024, +-1.005133, 0.751598, -0.605876, 1.709816, 0.83145, -0.046915, +-0.046915, 1.230707, 0.671747, 0.192638, -0.366321, 1.150856, +-0.925282, 1.709816, -0.765579, -1.084985, -0.28647, 0.432192, +1.550113, 0.192638, 1.550113, -1.164836, 0.512044, -0.20661, +-0.206618, -0.605876, 0.352341, 1.150856, 0.432192, 0.83145, +-0.765579, -0.206618, 0.432192, 0.512044, -0.206618, 0.112787, +1.470262, 0.911301, 0.83145, 0.032935, 1.071004, 0.432192, 0.112787, +0.512044, -0.925282, -0.765579, 0.83145, 0.591895, 0.272489, +0.751598, -0.84543, -0.206618, 1.230707, 1.709816, 0.032935, +1.230707, 0.911301, -0.28647, -1.164836, 1.150856, -1.244688, +0.591895, -0.526024, -0.605876, 0.112787, 2.029222, -0.526024, +-0.605876, 0.272489, -1.244688, 0.19263, -0.925282, 0.591895, +-0.925282, -1.564093, 0.272489, 0.591895, 0.911301, 0.112787, +0.032935, 0.272489, 0.512044, 1.071004, 0.272489, -0.28647, 1.39041, +-1.244688, 2.508331, 1.230707, -1.564093, -0.046915, -1.244688, +0.671747, -1.643945, 2.188925, -1.564093, -0.366321, 1.150856, +2.827737, 0.911301, -1.164836, 0.911301, 1.071004, 2.188925, +-0.126767, 1.310559, 1.310559, 1.230707, 0.352341, -1.244688, +-1.164836, -1.244688, 1.629965, 1.470262, -0.28647, -1.084985, +1.150856, -0.52602, 2.98744, 3.5464, 2.188925, 0.272489, 0.751598, +-0.925282, 0.272489, -1.084985, -1.005133, 0.432192, -0.28647, +0.991153, 0.991153, 0.352341, -0.925282, -0.366321, -0.685727, +0.671747, 0.112787, -1.005133, -0.446173, -1.005133, -0.206618, +0.272489, -0.765579, 1.39041, 0.352341, -0.366321, -1.40439, +1.789667, 0.671747, -0.206618, 0.991153, 0.272489, 0.591895, +-0.046915, -1.643945, -0.28647, -1.164836, -0.765579, -1.005133, +-0.765579, 0.432192, -0.925282, -0.206618, -0.84543, -0.68572, +0.032935, -0.685727, 0.192638, 0.991153, 0.112787, -0.925282, +-0.28647, -0.526024, -0.84543, 0.352341, -1.324539, -1.084985, +0.112787, -0.366321, 1.310559, 1.310559, 0.591895, -0.206618, +-1.484242, -1.324539, 1.550113, 0.272489, -2.123054, 0.751598, +0.512044, -1.643945, 1.869519, -0.28647, -1.643945, -1.005133, +-0.046915, -1.723796, 0.352341, 0.911301, -0.605876, -0.28647, +0.432192, -0.605876, 0.112787, -0.206618, -0.925282, -0.046915, +1.230707, 0.991153, -1.484242, 0.911301, -1.64394, 0.751598, +0.671747, 0.192638, -1.244688, -1.244688, -0.526024, -0.28647, +0.112787, 0.991153, 0.432192, 1.150856, -0.84543, -0.765579, +0.112787, 0.991153, 0.192638, -0.28647, 1.150856, 1.310559, 0.911301, +-0.526024, -0.28647, 0.591895, -0.126767, -0.366321, -1.244688, +-0.28647, 0.83145, 0.591895, -0.685727, -0.126767, -1.244688, +-1.084985, 0.591895, 2.268776, -1.324539, 1.39041, 0.032935, +0.911301, -0.685727, 0.192638, 0.991153, -0.925282, 0.512044, +-0.206618, 1.789667, 1.31055, 1.709816, 1.789667, -0.28647, 0.352341, +-0.84543, 2.188925, -0.84543, 0.032935, 0.432192, -0.765579, +0.751598, 0.112787, 0.911301, 1.39041, -0.84543, -0.28647, -0.765579, +0.432192, 0.671747, 0.192638, -0.28647, -2.043202, -1.883499, +0.83145, -1.643945, 1.789667, -0.605876, 1.230707, -2.123054, +0.352341, -1.324539, -1.484242, 1.550113, 1.709816, 1.789667, +-1.484242, -1.40439, 1.709816, -0.28647, -1.164836, -0.685727, +0.671747, 0.671747, -0.366321, -0.366321, 0.512044, 0.11278, +1.071004, 0.751598, 1.629965, -0.046915, 0.991153, 0.591895, +0.911301, 0.83145, 0.591895, -0.28647, 0.192638, -1.005133, -0.28647, +-0.526024, 1.150856, 1.230707, -0.685727, -0.526024, -0.126767, +1.150856, -0.28647, -0.685727, -1.005133, -1.564093, 1.150856, +-1.084985, 0.272489, -0.685727, 1.230707, 1.629965, 0.512044, +0.83145, 0.432192, 0.272489, -0.206618, -0.206618, -1.564093, +1.310559, -1.564093, 0.112787, -1.564093, 1.789667, -0.84543, +-0.925282, 1.39041, -0.366321, -0.84543, -0.765579, -0.765579, +0.591895, -1.723796, -1.723796, -1.643945, 0.512044, -1.084985, +0.352341, 0.911301, 0.83145, -1.484242, -0.446173, -1.084985, +-1.803648, 0.512044, 0.512044, -0.685727, -0.765579, -0.046915, +-0.526024, -1.484242, -1.164836, 2.268776, 1.071004, 1.150856, +0.192638, -0.925282, 0.911301, 0.751598, 0.591895, -0.28647, +0.991153, 0.112787, -0.446173, 0.512044, 0.751598, 0.192638, +1.94937, -0.605876, 0.272489, 0.192638, 2.268776, 0.83145, 0.751598, +-0.126767, -0.20661, -0.28647, -0.126767, -1.324539, -0.84543, +0.032935, 0.671747, -1.643945, 0.432192, 0.192638, -0.925282, +-0.765579, 0.751598, 0.112787, -0.685727, -0.366321, 0.272489, +-0.126767, -1.803648, -1.484242, -1.164836, -0.765579, 0.112787, +-0.765579, -0.685727, -0.765579, -1.244688, -0.925282, 0.112787, +-1.643945, -1.40439, -0.28647, 0.192638, -0.046915, 0.591895, +-1.564093, 1.230707, 0.911301, -0.925282, -0.28647, 0.911301, +-0.28647, 1.150856, -0.046915, 0.432192, -0.126767, 1.869519, +-0.92528, -0.925282, -0.84543, 0.591895, -1.244688, -0.925282, +2.188925, 0.751598, -1.723796, 1.629965, 0.991153, 0.112787, +-0.84543, -1.723796, -0.605876, 0.112787, -1.084985, -1.244688, +-1.244688, 0.032935, 0.432192, -1.643945, -1.244688, 1.39041, +-0.925282, -1.40439, 0.352341, 1.150856, -0.366321, 0.192638, +-1.164836, -0.366321, -1.244688, -1.084985, 1.550113, -0.685727, +0.911301, 1.230707, 0.192638, -0.925282, -1.40439, 0.751598, +-0.366321, 0.751598, -0.206618, 0.591895, 0.751598, -0.36632, +-0.126767, -0.685727, -0.446173, -0.046915, -0.925282, 0.032935, +-1.244688, 0.112787, -0.126767, -0.126767, 0.432192, 1.94937, +0.83145, 0.112787, -1.005133, 2.109073, -0.84543, 1.629965, -0.446173, +1.39041, 0.751598, -0.28647, 0.512044, -1.005133, -0.28647, 0.432192, +-0.685727, 0.272489, -0.446173, 1.470262, 0.751598, 0.512044, +-0.526024, 1.230707, -1.005133, 1.550113, 0.911301, -0.366321, +-1.084985, 0.352341, 0.751598, 0.432192, -1.963351, 1.071004, +1.550113, 0.991153, -1.64394, -0.765579, 1.550113, 1.071004, +0.512044, 1.869519, -1.164836, 0.991153, 0.112787, -0.84543, +0.192638, -0.526024, -1.164836, -2.043202, 1.869519, 0.032935, +-1.40439, 0.192638, 0.272489, -0.765579, -1.084985, -0.126767, +1.150856, 1.629965, -0.366321, 1.150856, -0.925282, 0.671747, +-1.963351, -1.803648, 0.83145, 0.112787, -1.803648, -0.446173, +0.991153, 1.230707, 0.991153, -0.206618, 0.671747, -0.605876, +1.550113, -0.28647, -1.963351, 1.230707, 1.39041, -0.526024, +-1.244688, -0.36632, 1.310559, -1.963351, 1.629965, -1.324539, +-1.803648, -0.28647, 1.869519, 1.470262, 1.550113, -0.446173, +-1.963351, 1.470262, 0.512044, -1.883499, -1.883499, -0.605876, +-0.366321, -1.084985, -0.366321, 1.230707, 0.512044, 1.071004, +-0.765579, -1.244688, -0.526024, -1.244688, -0.605876, -1.40439, +-0.526024, 0.671747, 1.94937, 0.512044, 0.352341, -1.244688, +-0.366321, 1.550113, -1.564093, -0.366321, 0.911301, 2.348628, +1.629965, 0.671747, 0.991153, -0.046915, 0.192638, -0.366321, +-0.28647, 1.310559, -0.925282, 1.310559, 1.310559, 1.629965, +0.991153, -0.685727, -0.366321, -0.605876, 0.192638, 1.789667, +-1.164836, 0.032935, 1.789667, 0.112787, 0.272489, 1.39041, -1.324539, +-0.84543, 0.591895, -1.084985, 0.751598, 0.512044, -0.206618, +0.991153, 1.071004, -0.526024, 0.512044, 0.591895, 0.991153, +-0.366321, -0.843612, -1.560598, -0.285956, 2.183663, 1.148016, +0.112369, 0.59036, -1.799594, 0.59036, -0.684282, -0.046961, +-1.799594, 0.829355, -0.684282, 1.227681, 2.422658, 0.431029, +-1.560598, 0.032704) +VR <- +structure(c(0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, +1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, +0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, +1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, +0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, +1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, +0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, +0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, +0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, +1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, +1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, +0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,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1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, +0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, +0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, +0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, +1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, +1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, +1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, +1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, +0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, +0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, +0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, +0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0), .Dim = c(1978, 2)) diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools.data.json b/benchmark/stan/bugs_examples/vol2/schools/schools.data.json new file mode 100644 index 000000000..d53453a61 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools.data.json @@ -0,0 +1,5953 @@ +{ + "LRT": [-10.6193, 8.3807, -12.6193, 14.3807, 9.3807, 2.3807, 9.3807, -7.6193, -4.6193, 0.3807, 2.3807, -3.6193, 4.3807, -1.6193, 14.3807, -10.6193, 6.3807, 14.3807, -4.6193, 1.3807, -9.6193, -7.6193, -1.6193, -7.6193, 14.3807, -14.6193, 11.3807, -18.6193, 10.3807, 15.3807, -9.6193, -22.6193, 19.3807, 10.3807, 5.3807, -1.6193, 10.3807, 1.3807, -6.6193, -13.6193, -7.6193, -3.6193, 16.3807, 8.3807, 1.3807, -0.6193, 6.3807, -13.6193, -8.6193, -20.6193, -2.6193, 13.3807, 3.3807, -8.6193, 8.3807, -5.6193, -12.6193, 0.3807, -22.6193, -4.6193, -34.6193, -1.6193, 18.3807, 16.3807, -12.6193, 8.3807, 20.3807, -24.6193, -11.6193, -9.6193, -3.6193, -3.6193, -2.6193, -3.6193, 4.3807, -1.6193, -17.6193, -2.6193, 15.3807, -19.6193, -2.6193, -2.6193, 10.3807, 3.3807, 35.3807, 5.3807, 12.3807, -13.6193, 16.3807, -23.6193, -5.6193, 0.3807, -11.6193, -0.6193, -2.6193, -1.6193, 20.3807, 5.3807, 5.3807, 7.3807, 20.3807, -0.6193, 9.3807, 1.3807, -10.6193, -0.6193, -4.6193, 1.3807, -4.6193, 16.3807, -3.6193, 8.3807, 3.3807, 9.3807, 3.3807, 3.3807, 1.3807, 9.3807, -2.6193, 11.3807, -24.6193, 7.3807, 10.3807, -6.6193, 27.3807, -1.6193, 18.3807, -5.6193, 6.3807, -7.6193, 12.3807, -1.6193, 18.3807, 7.3807, 0.3807, 17.3807, 20.3807, 9.3807, -10.6193, -18.6193, -3.6193, -0.6193, -12.6193, 15.3807, 1.3807, 9.3807, -10.6193, 5.3807, 11.3807, -13.6193, 5.3807, 17.3807, -1.6193, -5.6193, -10.6193, 10.3807, 7.3807, -7.6193, 19.3807, 11.3807, 0.3807, 18.3807, -12.6193, 7.3807, -0.6193, 5.3807, 13.3807, -7.6193, -1.6193, -2.6193, 26.3807, 0.3807, 6.3807, 7.3807, 4.3807, 23.3807, 12.3807, -7.6193, 18.3807, 10.3807, -12.6193, 0.3807, 6.3807, 15.3807, -0.6193, 9.3807, -15.6193, -3.6193, 17.3807, 8.3807, 25.3807, 10.3807, -5.6193, 13.3807, 10.3807, -5.6193, 4.3807, 13.3807, 35.3807, -12.6193, 3.3807, 23.3807, 19.3807, 19.3807, 20.3807, 4.3807, 0.3807, 9.3807, -22.6193, 5.3807, -4.6193, 3.3807, 6.3807, -21.6193, -12.6193, 5.3807, 5.3807, -17.6193, 7.3807, 24.3807, 17.3807, 12.3807, -5.6193, 2.3807, 5.3807, 11.3807, 8.3807, 29.3807, -6.6193, 4.3807, 22.3807, -1.6193, 5.3807, -12.6193, 12.3807, 15.3807, 23.3807, 7.3807, 8.3807, 23.3807, 0.3807, -2.6193, -9.6193, 2.3807, 23.3807, -8.6193, 4.3807, 1.3807, 21.3807, 3.3807, 8.3807, -6.6193, 18.3807, -12.6193, -7.6193, -0.6193, 12.3807, -9.6193, 4.3807, -8.6193, 4.3807, 2.3807, 22.3807, 8.3807, 16.3807, 13.3807, 11.3807, 7.3807, 6.3807, 18.3807, 6.3807, 10.3807, 10.3807, -11.6193, 7.3807, -0.6193, 18.3807, 4.3807, 4.3807, -7.6193, 0.3807, 8.3807, 4.3807, 12.3807, 5.3807, 2.3807, 22.3807, 13.3807, -5.6193, 2.3807, 5.3807, 2.3807, -9.6193, -1.6193, 3.3807, 6.3807, 3.3807, -11.6193, 1.3807, -12.6193, 17.3807, 7.3807, -4.6193, 8.3807, -14.6193, 9.3807, 13.3807, -6.6193, 3.3807, -8.6193, 0.3807, 11.3807, 12.3807, 20.3807, 13.3807, 13.3807, 21.3807, 17.3807, 1.3807, 3.3807, -1.6193, 0.3807, 3.3807, -8.6193, 14.3807, -11.6193, -9.6193, 14.3807, -6.6193, 4.3807, -1.6193, 15.3807, 17.3807, 15.3807, 9.3807, 16.3807, -2.6193, 1.3807, 2.3807, 0.3807, -10.6193, -2.6193, -3.6193, -5.6193, 14.3807, -1.6193, -1.6193, 7.3807, 7.3807, -11.6193, -15.6193, -10.6193, -0.6193, 4.3807, 2.3807, 10.3807, -6.6193, 3.3807, -11.6193, 18.3807, -5.6193, 20.3807, 15.3807, -6.6193, -7.6193, -4.6193, 26.3807, 16.3807, 9.3807, 5.3807, 4.3807, 5.3807, 5.3807, -3.6193, 19.3807, -6.6193, 8.3807, 14.3807, 4.3807, 0.3807, 12.3807, 1.3807, 7.3807, 20.3807, 10.3807, 0.3807, 1.3807, -4.6193, -6.6193, 20.3807, -11.6193, 0.3807, 18.3807, 9.3807, -0.6193, 8.3807, 1.3807, 8.3807, 12.3807, 6.3807, -14.6193, 7.3807, 14.3807, 8.3807, 11.3807, 18.3807, 24.3807, 17.3807, -5.6193, 28.3807, 12.3807, 5.3807, 0.3807, 0.3807, 14.3807, 13.3807, -6.6193, -4.6193, 5.3807, 18.3807, 5.3807, -2.6193, 1.3807, 6.3807, 0.3807, 8.3807, -6.6193, 16.3807, 8.3807, 7.3807, -1.6193, -8.6193, -6.6193, 11.3807, 4.3807, 7.3807, 2.3807, -3.6193, 7.3807, -2.6193, 8.3807, -6.6193, 16.3807, -17.6193, -0.6193, -3.6193, 11.3807, 4.3807, 3.3807, -19.6193, 20.3807, -15.6193, -0.6193, 8.3807, 1.3807, 18.3807, 3.3807, 9.3807, 15.3807, 0.3807, 8.3807, 11.3807, -0.6193, 15.3807, 18.3807, 9.3807, -2.6193, 2.3807, 13.3807, -9.6193, 13.3807, -18.6193, 3.3807, 2.3807, -10.6193, 8.3807, -6.6193, 24.3807, -2.6193, 15.3807, 6.3807, 7.3807, 5.3807, 7.3807, 14.3807, -11.6193, -8.6193, -2.6193, 12.3807, -19.6193, -5.6193, -25.6193, -23.6193, -0.6193, 3.3807, -13.6193, -5.6193, 17.3807, -7.6193, -1.6193, -19.6193, -3.6193, 15.3807, 21.3807, 1.3807, -5.6193, -20.6193, 5.3807, 5.3807, -27.6193, -7.6193, -1.6193, 7.3807, 12.3807, -5.6193, -12.6193, 8.3807, 28.3807, -1.6193, -2.6193, -0.6193, -24.6193, 8.3807, -19.6193, 13.3807, 23.3807, 9.3807, 21.3807, -4.6193, 10.3807, -17.6193, -5.6193, -11.6193, 3.3807, 12.3807, 28.3807, -9.6193, 4.3807, -0.6193, 8.3807, 5.3807, -31.6193, 8.3807, 8.3807, -13.6193, 21.3807, -3.6193, 0.3807, 6.3807, -7.6193, -22.6193, -9.6193, -4.6193, -16.6193, -8.6193, 2.3807, 14.3807, 12.3807, 4.3807, 9.3807, -0.6193, -2.6193, -4.6193, -16.6193, 7.3807, 7.3807, 0.3807, 8.3807, -1.6193, 0.3807, 0.3807, 6.3807, -16.6193, -6.6193, -6.6193, 20.3807, 20.3807, 3.3807, -2.6193, 9.3807, 14.3807, -3.6193, 2.3807, 1.3807, -4.6193, 1.3807, 37.3807, -12.6193, -10.6193, 4.3807, 5.3807, -9.6193, -4.6193, -10.6193, 2.3807, -2.6193, 3.3807, 4.3807, 10.3807, -19.6193, -1.6193, 6.3807, 17.3807, 1.3807, 1.3807, 7.3807, -9.6193, -2.6193, -6.6193, -34.6193, 2.3807, -21.6193, 1.3807, 20.3807, -6.6193, -6.6193, 7.3807, -4.6193, -0.6193, 1.3807, 12.3807, 0.3807, 0.3807, 3.3807, 4.3807, -11.6193, 8.3807, 10.3807, 12.3807, 4.3807, 1.3807, 11.3807, 1.3807, 6.3807, 7.3807, 0.3807, -3.6193, 7.3807, 2.3807, -2.6193, 7.3807, 2.3807, 1.3807, -1.6193, -7.6193, -6.6193, 5.3807, 4.3807, -5.6193, -6.6193, 11.3807, 0.3807, 6.3807, 7.3807, 7.3807, 8.3807, 1.3807, 2.3807, 9.3807, 5.3807, -10.6193, -6.6193, -1.6193, -8.6193, 6.3807, 3.3807, -5.6193, 5.3807, 2.3807, 5.3807, -16.6193, -6.6193, 20.3807, 8.3807, -3.6193, 24.3807, 15.3807, 8.3807, -0.6193, -4.6193, 0.3807, 16.3807, 14.3807, -11.6193, 12.3807, 5.3807, -6.6193, -3.6193, 8.3807, 7.3807, 16.3807, -8.6193, -0.6193, 9.3807, 0.3807, -17.6193, -3.6193, 0.3807, -5.6193, -6.6193, 5.3807, 5.3807, -1.6193, 6.3807, 3.3807, 6.3807, 4.3807, 6.3807, -8.6193, -3.6193, 7.3807, 11.3807, 2.3807, 2.3807, 5.3807, 15.3807, 9.3807, -0.6193, -7.6193, 5.3807, 10.3807, 8.3807, -2.6193, -1.6193, 14.3807, 10.3807, 4.3807, 2.3807, 7.3807, 9.3807, -16.6193, 7.3807, 4.3807, 7.3807, 14.3807, 9.3807, 21.3807, 4.3807, 3.3807, 11.3807, 11.3807, 4.3807, -3.6193, -2.6193, 13.3807, 6.3807, 0.3807, 3.3807, 4.3807, 15.3807, 8.3807, 2.3807, 11.3807, 0.3807, 3.3807, -8.6193, 14.3807, 10.3807, 3.3807, -0.6193, 0.3807, 2.3807, 13.3807, -4.6193, 14.3807, 7.3807, 12.3807, 8.3807, 3.3807, 15.3807, -0.6193, 13.3807, -3.6193, -13.6193, 9.3807, -9.6193, 14.3807, 11.3807, 11.3807, -1.6193, 14.3807, 4.3807, 17.3807, 4.3807, -3.6193, 4.3807, 30.3807, 9.3807, -10.6193, -0.6193, 0.3807, 0.3807, 12.3807, -9.6193, -11.6193, 1.3807, -15.6193, 1.3807, 14.3807, -5.6193, -10.6193, -6.6193, 19.3807, 9.3807, -6.6193, 7.3807, 24.3807, 0.3807, 9.3807, 4.3807, 29.3807, 20.3807, 18.3807, 1.3807, 20.3807, 29.3807, 10.3807, 7.3807, 8.3807, 11.3807, 20.3807, 1.3807, -10.6193, 3.3807, -11.6193, 4.3807, -8.6193, 1.3807, -1.6193, -3.6193, 9.3807, 14.3807, 1.3807, 11.3807, -1.6193, -6.6193, 10.3807, 14.3807, -6.6193, 6.3807, 24.3807, -1.6193, 12.3807, 4.3807, 17.3807, 13.3807, 4.3807, 9.3807, 19.3807, 0.3807, 2.3807, 29.3807, 2.3807, -8.6193, -8.6193, -2.6193, 5.3807, 3.3807, 25.3807, 5.3807, 7.3807, -14.6193, -27.6193, 5.3807, 6.3807, 7.3807, -18.6193, 8.3807, 12.3807, 11.3807, -18.6193, 15.3807, -9.6193, -21.6193, -1.6193, 7.3807, 7.3807, -3.6193, -6.6193, 9.3807, 0.3807, -8.6193, 12.3807, -13.6193, 11.3807, 0.3807, 6.3807, 4.3807, 6.3807, 0.3807, -4.6193, 10.3807, 13.3807, 17.3807, 5.3807, 15.3807, -0.6193, -9.6193, 37.3807, 4.3807, 18.3807, 22.3807, 7.3807, -0.6193, 16.3807, -6.6193, 16.3807, -3.6193, -2.6193, 6.3807, 6.3807, -7.6193, 4.3807, 12.3807, 3.3807, -13.6193, 17.3807, 4.3807, -26.6193, -23.6193, 0.3807, 3.3807, 6.3807, -12.6193, -1.6193, -2.6193, 2.3807, -0.6193, -5.6193, 8.3807, -5.6193, 5.3807, 10.3807, -15.6193, -21.6193, 16.3807, -8.6193, -9.6193, 3.3807, -5.6193, 9.3807, -15.6193, 1.3807, 11.3807, -7.6193, -6.6193, 20.3807, 1.3807, -5.6193, 20.3807, 8.3807, -3.6193, 26.3807, 11.3807, -11.6193, -8.6193, -4.6193, 1.3807, -26.6193, -17.6193, -7.6193, 11.3807, -12.6193, 9.3807, 0.3807, -19.6193, -16.6193, -7.6193, -9.6193, 3.3807, -1.6193, -11.6193, 22.3807, 6.3807, 2.3807, 11.3807, -10.6193, -14.6193, -2.6193, -21.6193, -9.6193, -1.6193, 1.3807, 23.3807, 0.3807, -3.6193, 18.3807, -1.6193, -7.6193, 5.3807, 21.3807, -14.6193, -20.6193, 14.3807, -12.6193, 2.3807, 6.3807, -1.6193, 7.3807, 12.3807, -12.6193, -27.6193, 18.3807, 1.3807, -2.6193, -18.6193, 4.3807, 1.3807, -7.6193, -18.6193, -11.6193, 3.3807, -20.6193, 18.3807, 9.3807, -5.6193, -6.6193, -0.6193, 2.3807, -34.6193, -16.6193, -9.6193, -0.6193, 0.3807, 15.3807, 4.3807, 4.3807, -26.6193, -1.6193, -10.6193, 16.3807, 8.3807, -19.6193, -5.6193, 2.3807, 6.3807, 0.3807, -10.6193, -4.6193, -3.6193, -14.6193, -15.6193, -14.6193, 0.3807, 1.3807, -17.6193, -8.6193, -7.6193, 0.3807, -7.6193, 4.3807, -18.6193, -3.6193, 8.3807, -11.6193, -12.6193, -20.6193, -8.6193, 13.3807, -11.6193, -18.6193, 17.3807, -0.6193, 3.3807, -8.6193, -24.6193, 18.3807, -20.6193, -27.6193, -22.6193, 5.3807, -24.6193, 0.3807, -30.6193, -16.6193, -4.6193, -8.6193, 15.3807, -3.6193, 7.3807, 4.3807, -19.6193, -22.6193, -6.6193, 0.3807, 1.3807, -24.6193, -12.6193, -5.6193, 1.3807, -6.6193, -1.6193, 2.3807, 0.3807, 15.3807, -7.6193, -11.6193, 1.3807, 9.3807, 7.3807, -8.6193, -5.6193, -22.6193, -1.6193, -14.6193, 22.3807, -16.6193, -17.6193, -13.6193, -34.6193, -2.6193, -13.6193, -7.6193, -5.6193, -8.6193, -20.6193, -17.6193, 3.3807, -5.6193, -13.6193, -15.6193, -23.6193, 17.3807, -24.6193, 2.3807, -12.6193, -13.6193, 2.3807, -7.6193, 3.3807, -8.6193, 6.3807, -8.6193, -7.6193, -19.6193, -14.6193, -12.6193, 8.3807, 1.3807, -6.6193, -16.6193, 1.3807, -6.6193, -7.6193, -31.6193, -12.6193, 3.3807, 7.3807, -0.6193, 12.3807, 12.3807, 2.3807, 6.3807, 4.3807, -10.6193, -9.6193, -6.6193, -20.6193, -3.6193, -5.6193, 7.3807, -17.6193, -19.6193, 1.3807, -20.6193, -6.6193, 3.3807, -13.6193, -22.6193, -12.6193, 6.3807, -29.6193, -25.6193, -10.6193, 0.3807, 19.3807, -10.6193, -1.6193, -0.6193, -28.6193, -2.6193, -0.6193, -10.6193, 9.3807, -7.6193, 12.3807, -19.6193, -18.6193, -0.6193, -1.6193, -10.6193, -6.6193, -21.6193, -32.6193, -0.6193, -7.6193, -10.6193, -19.6193, 9.3807, -34.6193, -10.6193, 2.3807, -27.6193, -2.6193, -6.6193, -22.6193, 2.3807, -1.6193, 4.3807, 1.3807, 0.3807, 13.3807, -6.6193, 9.3807, -15.6193, -29.6193, -11.6193, -17.6193, -10.6193, 10.3807, 7.3807, -15.6193, -7.6193, -11.6193, -2.6193, -8.6193, -31.6193, 7.3807, -6.6193, -8.6193, -8.6193, -14.6193, -1.6193, -16.6193, 0.3807, -4.6193, 3.3807, 5.3807, 11.3807, -7.6193, -0.6193, 2.3807, -18.6193, -0.6193, 10.3807, -23.6193, -4.6193, 20.3807, -6.6193, -0.6193, -9.6193, -9.6193, 3.3807, 5.3807, -2.6193, 4.3807, -1.6193, 10.3807, 2.3807, -12.6193, -9.6193, 2.3807, -2.6193, 6.3807, -15.6193, -15.6193, 10.3807, 7.3807, 5.3807, -13.6193, 8.3807, -12.6193, -9.6193, -19.6193, 5.3807, -1.6193, 4.3807, -4.6193, -7.6193, -25.6193, 0.3807, 16.3807, -34.6193, 5.3807, -17.6193, -18.6193, -3.6193, 1.3807, 4.3807, -6.6193, -7.6193, -9.6193, -2.6193, -8.6193, 12.3807, -11.6193, 10.3807, -17.6193, -4.6193, 7.3807, 3.3807, 10.3807, -3.6193, -9.6193, -4.6193, -16.6193, 14.3807, -4.6193, -28.6193, 1.3807, -8.6193, 4.3807, -9.6193, 4.3807, -22.6193, -4.6193, 2.3807, -11.6193, -11.6193, -8.6193, -1.6193, 4.3807, 6.3807, 0.3807, -22.6193, -9.6193, 5.3807, 4.3807, -8.6193, -3.6193, 13.3807, -17.6193, -12.6193, 2.3807, -5.6193, -7.6193, -9.6193, -13.6193, -10.6193, 8.3807, 16.3807, -13.6193, -1.6193, -3.6193, -4.6193, 10.3807, 5.3807, -3.6193, -0.6193, -26.6193, -13.6193, -13.6193, -12.6193, -11.6193, 8.3807, 8.3807, -4.6193, -6.6193, 35.3807, 0.3807, 7.3807, 7.3807, -22.6193, -12.6193, -22.6193, 6.3807, -0.6193, 4.3807, -4.6193, -6.6193, 10.3807, -8.6193, -4.6193, -2.6193, -0.6193, 2.3807, 1.3807, -23.6193, 8.3807, -5.6193, 23.3807, -25.6193, -8.6193, -3.6193, -2.6193, 5.3807, -10.6193, 20.3807, -4.6193, 10.3807, 3.3807, 18.3807, 8.3807, -1.6193, 10.3807, 2.3807, 10.3807, -8.6193, 26.3807, 16.3807, 7.3807, 14.3807, -0.6193, -11.6193, -19.6193, 9.3807, 12.3807, -4.6193, -3.6193, 35.3807, -5.6193, 35.3807, 23.3807, 14.3807, -1.6193, 3.3807, -10.6193, -6.6193, -0.6193, -6.6193, -0.6193, 3.3807, 1.3807, -3.6193, -10.6193, -0.6193, 3.3807, -16.6193, 6.3807, 3.3807, -13.6193, -5.6193, -0.6193, -27.6193, -23.6193, -2.6193, 6.3807, -3.6193, -21.6193, -7.6193, -0.6193, -2.6193, 0.3807, 2.3807, 8.3807, 3.3807, -9.6193, -15.6193, -6.6193, -4.6193, -12.6193, -1.6193, -10.6193, 0.3807, -13.6193, -11.6193, -12.6193, -6.6193, 0.3807, -1.6193, -20.6193, -2.6193, -0.6193, -19.6193, -21.6193, -1.6193, -7.6193, 14.3807, -30.6193, -34.6193, 7.3807, -1.6193, 13.3807, 6.3807, 5.3807, -14.6193, -20.6193, -20.6193, 7.3807, -12.6193, -30.6193, -6.6193, -5.6193, -5.6193, 21.3807, -10.6193, -19.6193, 1.3807, 3.3807, -5.6193, 6.3807, -0.6193, -15.6193, 1.3807, 7.3807, -0.6193, -11.6193, -17.6193, -21.6193, -13.6193, 13.3807, -5.6193, -18.6193, 0.3807, -26.6193, 14.3807, 1.3807, 1.3807, -0.6193, -18.6193, -14.6193, -10.6193, 1.3807, 17.3807, -13.6193, 7.3807, -4.6193, -2.6193, -5.6193, 17.3807, 8.3807, -2.6193, 15.3807, 26.3807, 1.3807, -0.6193, -6.6193, 7.3807, -4.6193, 1.3807, -21.6193, -12.6193, 4.3807, 5.3807, -4.6193, 1.3807, -1.6193, -2.6193, 12.3807, 4.3807, -33.6193, 1.3807, 20.3807, 29.3807, -1.6193, 5.3807, 3.3807, 0.3807, -4.6193, -5.6193, 3.3807, 3.3807, 15.3807, -1.6193, -4.6193, -12.6193, -1.6193, 4.3807, -5.6193, -0.6193, 3.3807, 11.3807, 1.3807, 2.3807, 14.3807, 11.3807, -2.6193, -1.6193, 1.3807, -2.6193, 23.3807, -5.6193, 4.3807, -21.6193, -30.6193, 2.3807, -14.6193, 2.3807, 11.3807, -1.6193, -9.6193, 6.3807, -13.6193, -26.6193, 12.3807, 11.3807, 17.3807, -33.6193, -5.6193, 29.3807, -8.6193, -26.6193, 3.3807, -16.6193, 5.3807, -4.6193, -5.6193, -6.6193, -1.6193, 6.3807, -1.6193, 2.3807, 7.3807, 11.3807, -1.6193, -2.6193, 16.3807, -5.6193, -2.6193, -11.6193, -2.6193, -0.6193, -4.6193, 1.3807, 20.3807, -11.6193, -2.6193, -13.6193, -15.6193, 7.3807, -3.6193, 1.3807, -7.6193, 16.3807, -4.6193, 0.3807, -3.6193, -6.6193, 20.3807, -8.6193, 12.3807, 1.3807, -17.6193, -3.6193, -18.6193, -13.6193, 23.3807, -15.6193, -9.6193, -10.6193, 4.3807, -21.6193, 4.3807, -17.6193, -5.6193, -0.6193, 9.3807, -15.6193, -5.6193, -16.6193, -17.6193, -0.6193, 13.3807, 13.3807, 3.3807, -7.6193, 17.3807, -3.6193, 11.3807, -3.6193, -9.6193, 8.3807, 8.3807, 5.3807, -3.6193, 6.3807, -5.6193, -19.6193, -30.6193, 10.3807, 19.3807, 8.3807, 13.3807, -0.6193, 16.3807, 16.3807, 7.3807, 2.3807, 13.3807, -1.6193, 2.3807, -31.6193, 5.3807, -0.6193, 21.3807, 21.3807, -10.6193, -13.6193, 36.3807, -2.6193, 21.3807, -13.6193, -0.6193, -26.6193, -13.6193, -13.6193, -13.6193, -0.6193, 25.3807, -4.6193, 6.3807, 17.3807, -13.6193, 2.3807, 20.3807, -23.6193, -6.6193, -7.6193, -5.6193, 3.3807, -24.6193, -24.6193, -13.6193, -25.6193, -13.6193, 13.3807, -6.6193, -25.6193, -28.6193, 7.3807, -2.6193, 1.3807, -5.6193, 1.3807, -12.6193, -1.6193, -2.6193, -25.6193, 9.3807, 3.3807, -1.6193, -10.6193, 11.3807, -10.6193, 7.3807, 1.3807, 23.3807, -9.6193, 7.3807, -9.6193, 5.3807, -7.6193, -4.6193, -6.6193, -11.6193, 25.3807, 15.3807, -22.6193, 7.3807, 17.3807, -13.6193, -13.6193, -29.6193, 6.3807, 5.3807, -0.6193, -19.6193, -23.6193, 4.3807, 14.3807, -2.6193, -16.6193, 20.3807, -11.6193, 7.3807, 7.3807, 8.3807, -8.6193, 18.3807, -4.6193, 3.3807, -3.6193, -4.6193, -0.6193, 5.3807, 2.3807, 5.3807, -24.6193, -18.6193, -13.6193, -11.6193, -0.6193, 7.3807, -7.6193, 16.3807, 17.3807, -34.6193, 9.3807, -10.6193, -8.6193, -23.6193, -11.6193, -1.6193, -10.6193, -1.6193, -6.6193, -2.6193, 5.3807, 24.3807, 1.3807, 19.3807, -23.6193, 21.3807, -15.6193, 17.3807, -4.6193, 14.3807, -8.6193, -20.6193, 0.3807, -4.6193, -6.6193, 18.3807, -5.6193, 0.3807, -21.6193, 8.3807, 7.3807, -11.6193, -7.6193, 23.3807, -22.6193, -0.6193, 4.3807, -3.6193, -0.6193, -4.6193, 6.3807, 1.3807, -18.6193, 29.3807, 10.3807, -0.6193, -3.6193, -0.6193, 1.3807, 2.3807, -9.6193, 7.3807, -14.6193, 13.3807, -4.6193, 10.3807, 16.3807, -8.6193, -6.6193, -25.6193, 8.3807, -11.6193, 5.3807, 5.3807, -9.6193, 7.3807, -18.6193, 18.3807, 6.3807, 18.3807, 12.3807, 0.3807, -11.6193, 6.3807, -27.6193, -13.6193, 1.3807, -2.6193, 2.3807, -9.6193, 20.3807, -4.6193, 4.3807, -6.6193, 4.3807, -14.6193, 8.3807, 9.3807, -13.6193, -0.6193, 5.3807, 11.3807, -25.6193, -9.6193, 17.3807, -4.6193, 12.3807, -22.6193, -6.6193, 0.3807, 18.3807, 31.3807, 18.3807, -7.6193, -8.6193, 16.3807, -4.6193, 4.3807, -4.6193, 8.3807, -6.6193, 15.3807, 9.3807, 3.3807, -8.6193, 5.3807, -29.6193, -34.6193, -11.6193, -13.6193, 5.3807, -6.6193, 7.3807, -22.6193, -3.6193, -9.6193, -11.6193, -10.6193, -18.6193, 4.3807, -9.6193, -3.6193, -2.6193, 9.3807, 6.3807, -3.6193, 16.3807, 10.3807, 3.3807, -15.6193, -27.6193, -0.6193, -19.6193, 10.3807, 3.3807, 9.3807, 3.3807, 10.3807, -2.6193, 3.3807, 11.3807, 1.3807, -14.6193, 9.3807, 7.3807, 1.3807, 3.3807, -0.6193, -13.6193, 0.3807, -5.6193, -16.6193, -5.6193, 1.3807, 2.3807, 5.3807, 11.3807, -16.6193, 11.3807, 10.3807, -9.6193, -4.6193, 2.3807, -21.6193, 2.3807, 20.3807, 12.3807, 3.3807, 11.3807, -17.6193, 11.3807, -3.6193, -4.6193, -13.6193, 15.3807, -9.6193, 20.3807, 23.3807, 11.3807, -6.6193, 15.3807], + "Y": [-0.6058763, 0.9911532, -1.5640939, 0.112787, 0.7515988, 0.5918959, 0.7515988, -1.0849851, -1.8036484, 1.3904106, 0.9113018, 0.4321929, 1.1508562, -0.3663218, 1.5501135, -0.2066189, 0.3523414, 0.4321929, -0.9252821, 1.0710047, -0.3663218, -0.1267674, -1.244688, -0.2864704, -0.4461733, -0.5260248, 0.1926385, -1.4842425, 1.1508562, -0.2066189, -1.404391, -0.6857277, 0.112787, 0.27249, 1.1508562, 0.112787, -0.5260248, 0.3523414, 1.1508562, 0.27249, -0.1267674, 0.5120444, 0.5120444, 0.9113018, 0.9113018, -1.0051336, 0.1926385, -0.5260247, -0.6857277, -0.9252821, 0.4321929, 0.2724899, 0.7515988, -0.5260247, -0.3663218, -1.6439454, -1.5640939, 0.2724899, -1.4043909, 0.1926384, -1.1648365, -0.6058762, 1.8695194, 1.3904105, -1.7237968, -1.244688, 2.6680341, -1.3245395, -1.3245395, -0.8454306, -0.2066188, -1.0051336, 0.4321929, -0.3663218, -0.1267674, -1.1648365, -2.0432027, 0.5120443, 1.1508561, -0.5260247, 0.7515988, -0.3663218, 0.112787, -0.1267674, 1.2307076, 1.470262, 1.2307076, 1.3105591, 0.6717473, -1.3245395, -0.3663218, 1.0710047, -0.0469159, 0.6717473, -0.6058762, -1.0849851, -0.5260247, 1.5501135, 0.2724899, 0.3523414, 2.1090738, -0.6058762, 1.0710047, 0.4321929, -1.1648365, -0.0469159, -1.244688, -0.1267674, -0.5260247, 2.0292223, 0.6717473, 0.5918958, -0.2066188, 1.470262, 0.4321929, -0.7655792, 0.5918958, -0.4461733, 0.0329355, 1.2307076, -0.7655792, 0.4321929, -0.7655792, 0.3523414, 0.5918958, -1.4043909, 1.7896679, -0.4461733, 0.0329355, 0.0329355, -0.3663218, -0.0469159, 1.470262, -0.5260247, 2.5881827, -0.0469159, 0.3523414, 1.629965, -1.3245395, -1.8834998, -0.6857277, -0.0469159, -1.8834998, -0.3663218, 0.5918958, -0.0469159, -1.8036483, 0.5120443, 0.9113017, -1.4842424, -1.4043909, 1.0710047, -0.2864703, -1.0849851, -0.2864703, 0.9911532, 1.629965, -0.5260247, 1.470262, 0.6717473, -0.6857277, 0.4321929, -0.6058762, 0.5918958, 0.112787, -0.6857277, 1.2307076, -0.9252821, -0.0469159, -1.244688, 0.112787, -1.1648365, -0.6857277, -1.0849851, 1.3904105, 1.9493709, -1.0849851, -0.4461733, 2.1090738, -1.1648365, -0.5260247, -0.2066188, 0.3523414, 1.7896679, 1.629965, 0.3523414, -1.0051336, 0.6717473, 1.5501135, -0.2066188, 2.0292223, -0.0469159, 0.3523414, 0.1926384, 0.9911532, -0.2864703, -1.244688, -0.1267674, 0.9911532, -0.6857277, -0.5260247, 0.8314502, 1.2307076, 0.9911532, 0.7515988, 1.0710047, -0.7655792, 0.5918958, -0.9252821, -0.2864703, -1.5640939, 0.2724899, -0.4461733, 0.8314502, -1.1648365, 0.7515988, -0.0469159, -1.7237968, -1.3245395, 1.3904105, 1.0710047, 0.8314502, -1.0849851, 1.7098164, -0.1267674, -0.2066188, -1.0051336, 1.7098164, -0.3663218, 1.470262, 1.5501135, 0.9911532, 1.2307076, -0.8454306, -0.1267674, 0.5918958, 0.7515988, 1.3904105, 0.4321929, 0.112787, 0.3523414, 0.2724899, -1.4842424, 0.1926384, 2.1889253, 0.2724899, -1.4043909, -1.3245395, 1.470262, 1.0710047, 0.0329355, -0.2864703, 2.1889253, 0.1926384, -1.4043909, 0.0329355, 0.8314502, -1.8834998, -0.1267674, -0.1267674, 0.8314502, -0.0469159, 2.2687768, 0.5120443, 1.2307076, 0.7515988, 1.470262, 0.0329355, 1.470262, 0.1926384, 0.2724899, 0.0329355, 0.5918958, -1.0849851, 0.8314502, -1.7237968, 1.3904105, -1.1648365, 0.6717473, -0.6857277, -0.6857277, -1.0051336, -0.6857277, 0.9911532, 1.470262, -0.0469159, 1.9493709, 1.0710047, -0.2066188, -0.0469159, 1.3904105, 0.6717473, 0.4321929, 0.8314502, -0.2066188, 1.1508561, -0.2864703, 1.2307076, -0.5260247, -0.6058762, 0.112787, 0.4321929, -1.4043909, -0.9252821, -1.6439454, 1.470262, 0.7515988, -0.8454306, -0.1267674, -0.6058762, -0.0469159, 0.2724899, 2.5881827, 1.9493709, 0.4321929, -1.1648365, 1.9493709, 2.1889253, 0.8314502, 0.1926384, 0.3523414, 0.6717473, -0.4461733, -0.6058762, 0.8314502, -0.3663218, -1.7237968, 1.3904105, -0.8454306, 0.5120443, -1.244688, 1.0710047, 0.5120443, 1.3904105, -0.4461733, -0.2864703, -0.1267674, -0.8454306, -1.4842424, 0.3523414, -1.4842424, -0.0469159, -0.8454306, -0.1267674, 0.9113017, -0.9252821, -0.9252821, 0.2724899, -0.2066188, -1.0849851, -1.0051336, -0.8454306, 0.0329355, 1.7896679, -0.2066188, 2.2687768, 0.0329355, -1.1648365, -1.0849851, 0.112787, -0.6058762, 2.5083312, 1.2307076, -0.6857277, -0.8454306, 0.6717473, 0.5918958, 1.3904105, 1.9493709, 0.0329355, 0.2724899, -0.3663218, 0.8314502, -0.1267674, 0.8314502, -1.9633513, 1.629965, 1.470262, -1.3245395, 0.3523414, -0.6058762, -0.1267674, -0.5260247, -0.5260247, 1.9493709, -1.0051336, 0.0329355, -1.4842424, 0.9113017, 1.3904105, -0.2066188, 0.8314502, 0.9911532, -0.3663218, -0.7655792, -0.6058762, -0.2066188, 0.112787, 0.6717473, -0.8454306, 0.9911532, 1.3105591, 1.0710047, -0.7655792, -0.0469159, 0.112787, 0.9113017, 0.0329355, 0.0329355, -0.8454306, 0.3523414, 0.112787, -0.2066188, -1.7237968, 0.8314502, 0.112787, -0.9252821, 0.5120443, -0.4461733, 0.5918958, -0.0469159, -1.5640939, -1.8036483, -0.9252821, 0.5120443, 0.5120443, -0.6857277, -0.3663218, -0.2066188, 0.0329355, -0.4461733, -1.0051336, -1.7237968, 0.5120443, -1.4842424, 0.6717473, 1.0710047, -0.7655792, 0.8314502, -0.6058762, -0.3663218, -1.4043909, -0.5260247, -1.244688, -0.2066188, -1.1648365, -0.1267674, -0.3663218, -0.0469159, -0.2864703, -0.3663218, -0.7655792, -0.6058762, 0.2724899, 0.2724899, 0.9113017, 0.5918958, 0.8314502, 1.5501135, -1.1648365, 0.112787, 0.2724899, -0.2864703, 1.2307076, 0.8314502, 0.9113017, -0.5260247, -0.0469159, -0.2066188, -0.6857277, 0.7515988, -1.1648365, -0.9252821, -0.7655792, -0.2864703, -0.2864703, -0.4461733, 0.112787, -0.8454306, -0.0469159, -0.7655792, 1.1508561, -0.7655792, 0.112787, 0.5918958, -0.6857277, -0.8454306, 0.7515988, 0.5120443, -1.9633513, -0.2864703, -0.2066188, -1.4842424, -0.1267674, -0.5260247, -1.1648365, -1.4043909, 1.0710047, 0.1926384, 1.1508561, -0.1267674, -0.8454306, 0.7515988, 1.7098164, -1.244688, -1.0849851, -1.9633513, 0.5120443, -0.3663218, 0.1926384, -0.9252821, -0.2066188, 0.112787, -0.3663218, 0.5120443, -0.1267674, 0.5918958, 0.5120443, -0.3663218, -1.0051336, 0.8314502, -1.6439454, 1.470262, -0.3663218, 0.2724899, 1.470262, -0.5260247, 1.629965, 0.7515988, -0.1267674, -1.9633513, 0.0329355, -1.0849851, -1.244688, 1.3904105, 0.5918958, -0.2864703, -0.2864703, -0.0469159, 0.4321929, -0.7655792, -1.244688, 0.9911532, 1.1508561, -0.3663218, 1.5501135, -0.7655792, 0.5120443, 1.8695194, -0.1267674, 0.4321929, 0.5918958, -0.1267674, -1.3245395, -0.4461733, -0.9252821, 1.1508561, 1.7896679, 0.112787, -0.2864703, -1.0849851, -1.3245395, 0.1926384, -1.1648365, -0.4461733, 0.112787, -0.2066188, 0.2724899, 0.3523414, -1.0051336, -1.5640939, 0.112787, -0.2066188, -0.6058762, -0.6058762, -0.0469159, -0.2864703, -0.9252821, -0.9252821, -0.5260247, 1.3105591, -0.6058762, -1.6439454, 0.9113017, -1.4043909, 0.9911532, 1.3105591, -0.0469159, 0.4321929, 0.5918958, 0.5918958, 1.629965, 1.470262, -1.8036483, 0.0329355, -0.8454306, 0.1926384, 0.4321929, 0.9911532, -0.3663218, -0.3663218, 1.3105591, 0.4321929, 0.5918958, -0.4461733, 0.8314502, -0.2864703, -0.6857277, -0.8454306, -1.6439454, -0.7655792, -2.1230542, -1.244688, 2.5881827, -0.6857277, -0.0469159, -0.3663218, 1.0710047, -0.3663218, -0.4461733, -0.6857277, -0.0469159, 0.9113017, 0.9911532, -0.4461733, -0.6857277, -1.0849851, -0.1267674, 0.5120443, -1.0051336, 0.112787, 1.2307076, -0.2864703, 0.5918958, 0.112787, 0.7515988, -0.2066188, -0.3663218, -0.7655792, -1.5640939, -1.0849851, 0.4321929, -0.6857277, -0.7655792, 0.6717473, -1.244688, 0.3523414, 1.1508561, 2.0292223, -0.5260247, 0.0329355, 0.7515988, -0.0469159, 1.7896679, 0.112787, 0.112787, -0.2066188, 0.4321929, -1.0051336, 0.112787, -0.6857277, 0.0329355, -0.2066188, -0.4461733, -0.6058762, 1.7896679, -1.0849851, 0.9113017, -0.2066188, -0.0469159, 1.0710047, -0.2066188, 1.8695194, 0.4321929, -0.0469159, 1.7896679, -0.9252821, 0.9113017, 1.2307076, 0.9113017, -0.6857277, 1.7098164, -0.3663218, -1.1648365, -0.3663218, -0.6058762, -1.3245395, -1.0051336, 0.8314502, 1.2307076, 1.7896679, -0.4461733, -0.5260247, 0.112787, 1.629965, 0.9911532, -1.0051336, 1.5501135, -0.0469159, -1.7237968, 0.6717473, -0.8454306, -1.0051336, 0.5120443, -1.8036483, -1.0051336, 0.112787, 1.470262, 0.5120443, -0.7655792, 1.0710047, 1.3105591, 1.1508561, 0.5120443, 0.9113017, 1.2307076, 1.0710047, -0.9252821, 0.1926384, 0.1926384, -0.0469159, 0.6717473, 0.4321929, 0.1926384, 0.5918958, -0.0469159, -0.5260247, -0.2864703, 0.7515988, 0.112787, -1.4842424, 0.5120443, 0.6717473, 1.7896679, -0.0469159, 1.9493709, 1.629965, -1.0051336, -0.2864703, 0.5120443, 0.4321929, 0.6717473, 0.8314502, -0.7655792, 1.7896679, -0.6058762, -1.244688, 1.7896679, 0.0329355, 1.629965, -0.7655792, -0.6857277, 2.34862828, 0.99115323, 0.03293554, -0.60587625, 1.23070765, -0.60587625, -0.7655792, -0.12676741, 0.59189586, -0.04691593, 0.67174733, -0.12676741, 0.11278701, 0.43219291, 0.7515988, 0.59189586, 1.39041059, 1.62996502, 0.91130175, 0.99115323, -0.68572773, -0.7655792, 1.94937091, -1.16483657, -0.60587625, 2.10907386, 0.19263849, 0.59189586, 0.7515988, -1.40439099, 2.02922239, 0.43219291, -0.68572773, -0.92528215, 1.15085617, 0.35234143, 0.43219291, -0.20661888, 1.55011354, -0.60587625, 2.18892533, 0.19263849, 0.67174733, 1.70981649, -1.88349983, 0.03293554, 1.62996502, -0.366321, 0.1926384, 0.7515988, 1.629965, -0.0469159, -0.1267674, 1.3904105, 1.3105591, -0.2066188, -0.2864703, 0.2724899, 2.0292223, 2.0292223, 1.5501135, 0.9113017, 1.5501135, 1.9493709, 0.3523414, 0.8314502, 1.5501135, 1.1508561, 1.3105591, -0.1267674, 1.2307076, 0.5120443, -0.3663218, 0.9113017, 0.9911532, -0.2864703, -0.4461733, 0.5120443, 0.5120443, 0.8314502, 0.5918958, 0.5918958, 1.3904105, 0.0329355, 1.629965, 1.7896679, 0.5918958, 1.470262, 2.2687768, 0.112787, 1.470262, -0.9252821, 1.3904105, 0.8314502, -0.28647, -1.0051336, 2.1090738, 0.2724899, 1.470262, 2.2687768, 0.5918958, -0.6857277, 0.112787, 0.7515988, 0.4321929, 1.1508561, 1.3904105, 1.7098164, 0.9911532, -0.1267674, -1.0849851, 1.7896679, 1.3904105, 0.1926384, -1.1648365, 0.9113017, -0.2066188, 1.5501135, -0.1267674, 1.2307076, -0.4461733, -1.4842424, 1.1508561, 0.4321929, 0.5918958, 0.3523414, 0.112787, 0.1926384, 0.112787, -0.6058762, 1.3904105, 0.3523414, 1.7098164, 0.3523414, 0.5918958, -0.0469159, 0.0329355, 1.8695194, 0.5918958, 0.9113017, 0.112787, 1.94937, -0.206618, -0.126767, -0.28647, -0.206618, 2.109073, -1.40439, 1.150856, -0.046915, -0.366321, 0.591895, 0.432192, 0.512044, 0.512044, -0.206618, -1.084985, -0.605876, -1.244688, -0.28647, -0.765579, 1.071004, -0.446173, -1.084985, 1.230707, 0.83145, -1.40439, -0.526024, -0.446173, 0.032935, 0.751598, -1.244688, 0.751598, 0.83145, 0.112787, -0.046915, 0.032935, 0.352341, -0.366321, -0.526024, 0.352341, 0.591895, -1.643945, -0.446173, -1.883499, -1.084985, -0.765579, -0.446173, -0.92528, -0.84543, -0.605876, 1.789667, -0.925282, -0.84543, -0.84543, -0.605876, -1.643945, -0.126767, -0.765579, -1.324539, -0.126767, 1.550113, -1.723796, -0.925282, -0.925282, -0.366321, -0.925282, -1.40439, -1.40439, 0.83145, -1.883499, 0.512044, 0.352341, -0.28647, -1.723796, -0.685727, -1.963351, -1.164836, -0.366321, -0.366321, 1.230707, -0.046915, -0.28647, 0.352341, -0.84543, -1.883499, -0.366321, -1.883499, -1.164836, 0.272489, 0.192638, 0.192638, -1.244688, -1.244688, 0.192638, 0.512044, -1.8834998, -0.8454306, -0.5260247, -1.0051336, 0.9911532, -0.2864703, -1.5640939, 0.7515988, -0.5260247, 0.9911532, -0.7655792, 0.8314502, -1.8036483, -2.0432027, 0.9911532, -0.7655792, -1.0051336, -1.0051336, 0.0329355, -1.8834998, -0.2864703, -1.9633513, 1.0710047, -1.7237968, -0.9252821, 0.4321929, 2.2687768, -0.1267674, 1.1508561, 0.3523414, 1.7896679, -0.6857277, -1.1648365, -0.5260247, -0.0469159, 1.2307076, 2.1090738, -0.2066188, -0.4461733, 0.112787, -1.3245395, 1.8695194, 0.4321929, 2.1889253, 0.6717473, -1.9633513, -0.36632, 0.671747, 0.192638, -0.685727, -0.84543, 0.751598, -0.685727, -1.40439, 0.83145, -0.765579, -0.526024, -0.925282, 1.310559, 0.991153, 0.83145, -1.084985, -0.84543, -0.28647, 0.352341, -0.046915, 0.112787, -0.126767, -0.446173, 1.071004, -0.28647, -1.164836, -0.84543, 0.192638, 0.272489, -0.046915, -0.206618, -1.643945, 0.671747, -1.963351, -2.123054, -2.123054, -0.605876, -1.564093, 0.751598, -1.564093, -0.206618, -1.244688, -1.084985, 0.352341, 0.032935, 1.150856, -0.126767, -0.84543, -1.084985, -0.765579, 0.512044, -0.126767, -0.84543, -0.28647, -0.366321, -0.685727, -0.685727, -1.564093, 0.432192, -0.28647, 0.192638, -0.526024, -0.765579, -0.526024, 0.032935, 0.83145, -0.046915, -0.605876, -0.925282, 0.911301, -0.685727, 0.512044, -1.084985, -0.206618, -0.685727, -2.123054, -0.366321, 0.591895, -0.366321, -0.925282, -1.564093, -0.526024, -0.605876, -1.40439, 0.192638, -1.164836, -1.164836, -1.963351, 0.272489, -0.605876, 0.352341, 1.310559, -0.046915, 0.192638, 0.59189, 0.352341, -0.925282, -0.126767, 0.991153, -0.925282, -1.803648, -0.685727, -1.164836, 0.591895, 0.911301, -0.446173, -0.446173, 1.310559, 0.27249, 0.192638, -1.324539, 0.27249, -0.605876, 1.470262, -0.685727, 1.470262, -1.404391, 0.352341, 1.071004, -1.164836, -0.366321, -1.164836, -1.164836, -0.366321, -0.366321, -1.164836, 0.83145, -0.126767, -0.366321, -0.446173, -1.005133, -1.164836, -0.206618, -0.446173, -1.244688, -0.84543, 0.27249, -0.446173, -1.484242, 0.112787, -0.366321, 0.67174, -0.366321, 0.991153, 0.352341, -1.723796, -0.526024, 0.671747, -0.28647, 0.591895, -1.40439, 1.94937, -0.446173, -1.005133, 0.591895, 0.911301, -2.043202, -0.765579, -1.244688, -1.803648, -0.126767, -0.765579, -0.765579, -1.324539, 1.629965, 0.112787, 0.432192, 0.751598, -1.883499, 0.032935, -0.685727, -1.564093, 0.192638, 0.512044, 0.591895, -1.005133, -0.84543, 0.991153, -0.126767, 0.991153, -1.005133, -1.40439, -1.005133, 0.272489, -1.005133, 0.911301, 0.032935, -0.84543, 0.03293, -1.084985, 0.192638, 0.751598, -0.685727, 1.709816, -0.366321, -1.084985, -1.40439, -0.605876, -1.244688, -1.324539, 0.352341, -0.206618, 0.991153, -1.005133, -0.925282, 0.352341, -0.84543, -0.366321, -1.005133, -0.605876, 0.112787, -1.643945, -1.164836, -0.366321, -1.244688, -0.605876, -0.765579, -1.324539, -1.084985, -1.084985, -0.526024, -1.244688, 0.032935, 0.192638, -0.366321, -1.40439, -1.40439, -1.723796, -1.244688, 0.192638, -0.28647, -1.244688, -0.206618, -1.40439, -1.484242, -1.08498, -0.28647, -1.164836, -1.244688, -1.484242, -1.244688, -0.84543, -0.206618, -0.366321, -0.765579, -1.40439, 0.112787, -0.046915, -1.963351, -0.526024, -0.605876, 0.671747, -0.925282, -1.164836, -1.005133, 0.192638, -1.005133, -1.484242, -0.526024, -1.005133, 0.751598, -0.605876, 1.709816, 0.83145, -0.046915, -0.046915, 1.230707, 0.671747, 0.192638, -0.366321, 1.150856, -0.925282, 1.709816, -0.765579, -1.084985, -0.28647, 0.432192, 1.550113, 0.192638, 1.550113, -1.164836, 0.512044, -0.20661, -0.206618, -0.605876, 0.352341, 1.150856, 0.432192, 0.83145, -0.765579, -0.206618, 0.432192, 0.512044, -0.206618, 0.112787, 1.470262, 0.911301, 0.83145, 0.032935, 1.071004, 0.432192, 0.112787, 0.512044, -0.925282, -0.765579, 0.83145, 0.591895, 0.272489, 0.751598, -0.84543, -0.206618, 1.230707, 1.709816, 0.032935, 1.230707, 0.911301, -0.28647, -1.164836, 1.150856, -1.244688, 0.591895, -0.526024, -0.605876, 0.112787, 2.029222, -0.526024, -0.605876, 0.272489, -1.244688, 0.19263, -0.925282, 0.591895, -0.925282, -1.564093, 0.272489, 0.591895, 0.911301, 0.112787, 0.032935, 0.272489, 0.512044, 1.071004, 0.272489, -0.28647, 1.39041, -1.244688, 2.508331, 1.230707, -1.564093, -0.046915, -1.244688, 0.671747, -1.643945, 2.188925, -1.564093, -0.366321, 1.150856, 2.827737, 0.911301, -1.164836, 0.911301, 1.071004, 2.188925, -0.126767, 1.310559, 1.310559, 1.230707, 0.352341, -1.244688, -1.164836, -1.244688, 1.629965, 1.470262, -0.28647, -1.084985, 1.150856, -0.52602, 2.98744, 3.5464, 2.188925, 0.272489, 0.751598, -0.925282, 0.272489, -1.084985, -1.005133, 0.432192, -0.28647, 0.991153, 0.991153, 0.352341, -0.925282, -0.366321, -0.685727, 0.671747, 0.112787, -1.005133, -0.446173, -1.005133, -0.206618, 0.272489, -0.765579, 1.39041, 0.352341, -0.366321, -1.40439, 1.789667, 0.671747, -0.206618, 0.991153, 0.272489, 0.591895, -0.046915, -1.643945, -0.28647, -1.164836, -0.765579, -1.005133, -0.765579, 0.432192, -0.925282, -0.206618, -0.84543, -0.68572, 0.032935, -0.685727, 0.192638, 0.991153, 0.112787, -0.925282, -0.28647, -0.526024, -0.84543, 0.352341, -1.324539, -1.084985, 0.112787, -0.366321, 1.310559, 1.310559, 0.591895, -0.206618, -1.484242, -1.324539, 1.550113, 0.272489, -2.123054, 0.751598, 0.512044, -1.643945, 1.869519, -0.28647, -1.643945, -1.005133, -0.046915, -1.723796, 0.352341, 0.911301, -0.605876, -0.28647, 0.432192, -0.605876, 0.112787, -0.206618, -0.925282, -0.046915, 1.230707, 0.991153, -1.484242, 0.911301, -1.64394, 0.751598, 0.671747, 0.192638, -1.244688, -1.244688, -0.526024, -0.28647, 0.112787, 0.991153, 0.432192, 1.150856, -0.84543, -0.765579, 0.112787, 0.991153, 0.192638, -0.28647, 1.150856, 1.310559, 0.911301, -0.526024, -0.28647, 0.591895, -0.126767, -0.366321, -1.244688, -0.28647, 0.83145, 0.591895, -0.685727, -0.126767, -1.244688, -1.084985, 0.591895, 2.268776, -1.324539, 1.39041, 0.032935, 0.911301, -0.685727, 0.192638, 0.991153, -0.925282, 0.512044, -0.206618, 1.789667, 1.31055, 1.709816, 1.789667, -0.28647, 0.352341, -0.84543, 2.188925, -0.84543, 0.032935, 0.432192, -0.765579, 0.751598, 0.112787, 0.911301, 1.39041, -0.84543, -0.28647, -0.765579, 0.432192, 0.671747, 0.192638, -0.28647, -2.043202, -1.883499, 0.83145, -1.643945, 1.789667, -0.605876, 1.230707, -2.123054, 0.352341, -1.324539, -1.484242, 1.550113, 1.709816, 1.789667, -1.484242, -1.40439, 1.709816, -0.28647, -1.164836, -0.685727, 0.671747, 0.671747, -0.366321, -0.366321, 0.512044, 0.11278, 1.071004, 0.751598, 1.629965, -0.046915, 0.991153, 0.591895, 0.911301, 0.83145, 0.591895, -0.28647, 0.192638, -1.005133, -0.28647, -0.526024, 1.150856, 1.230707, -0.685727, -0.526024, -0.126767, 1.150856, -0.28647, -0.685727, -1.005133, -1.564093, 1.150856, -1.084985, 0.272489, -0.685727, 1.230707, 1.629965, 0.512044, 0.83145, 0.432192, 0.272489, -0.206618, -0.206618, -1.564093, 1.310559, -1.564093, 0.112787, -1.564093, 1.789667, -0.84543, -0.925282, 1.39041, -0.366321, -0.84543, -0.765579, -0.765579, 0.591895, -1.723796, -1.723796, -1.643945, 0.512044, -1.084985, 0.352341, 0.911301, 0.83145, -1.484242, -0.446173, -1.084985, -1.803648, 0.512044, 0.512044, -0.685727, -0.765579, -0.046915, -0.526024, -1.484242, -1.164836, 2.268776, 1.071004, 1.150856, 0.192638, -0.925282, 0.911301, 0.751598, 0.591895, -0.28647, 0.991153, 0.112787, -0.446173, 0.512044, 0.751598, 0.192638, 1.94937, -0.605876, 0.272489, 0.192638, 2.268776, 0.83145, 0.751598, -0.126767, -0.20661, -0.28647, -0.126767, -1.324539, -0.84543, 0.032935, 0.671747, -1.643945, 0.432192, 0.192638, -0.925282, -0.765579, 0.751598, 0.112787, -0.685727, -0.366321, 0.272489, -0.126767, -1.803648, -1.484242, -1.164836, -0.765579, 0.112787, -0.765579, -0.685727, -0.765579, -1.244688, -0.925282, 0.112787, -1.643945, -1.40439, -0.28647, 0.192638, -0.046915, 0.591895, -1.564093, 1.230707, 0.911301, -0.925282, -0.28647, 0.911301, -0.28647, 1.150856, -0.046915, 0.432192, -0.126767, 1.869519, -0.92528, -0.925282, -0.84543, 0.591895, -1.244688, -0.925282, 2.188925, 0.751598, -1.723796, 1.629965, 0.991153, 0.112787, -0.84543, -1.723796, -0.605876, 0.112787, -1.084985, -1.244688, -1.244688, 0.032935, 0.432192, -1.643945, -1.244688, 1.39041, -0.925282, -1.40439, 0.352341, 1.150856, -0.366321, 0.192638, -1.164836, -0.366321, -1.244688, -1.084985, 1.550113, -0.685727, 0.911301, 1.230707, 0.192638, -0.925282, -1.40439, 0.751598, -0.366321, 0.751598, -0.206618, 0.591895, 0.751598, -0.36632, -0.126767, -0.685727, -0.446173, -0.046915, -0.925282, 0.032935, -1.244688, 0.112787, -0.126767, -0.126767, 0.432192, 1.94937, 0.83145, 0.112787, -1.005133, 2.109073, -0.84543, 1.629965, -0.446173, 1.39041, 0.751598, -0.28647, 0.512044, -1.005133, -0.28647, 0.432192, -0.685727, 0.272489, -0.446173, 1.470262, 0.751598, 0.512044, -0.526024, 1.230707, -1.005133, 1.550113, 0.911301, -0.366321, -1.084985, 0.352341, 0.751598, 0.432192, -1.963351, 1.071004, 1.550113, 0.991153, -1.64394, -0.765579, 1.550113, 1.071004, 0.512044, 1.869519, -1.164836, 0.991153, 0.112787, -0.84543, 0.192638, -0.526024, -1.164836, -2.043202, 1.869519, 0.032935, -1.40439, 0.192638, 0.272489, -0.765579, -1.084985, -0.126767, 1.150856, 1.629965, -0.366321, 1.150856, -0.925282, 0.671747, -1.963351, -1.803648, 0.83145, 0.112787, -1.803648, -0.446173, 0.991153, 1.230707, 0.991153, -0.206618, 0.671747, -0.605876, 1.550113, -0.28647, -1.963351, 1.230707, 1.39041, -0.526024, -1.244688, -0.36632, 1.310559, -1.963351, 1.629965, -1.324539, -1.803648, -0.28647, 1.869519, 1.470262, 1.550113, -0.446173, -1.963351, 1.470262, 0.512044, -1.883499, -1.883499, -0.605876, -0.366321, -1.084985, -0.366321, 1.230707, 0.512044, 1.071004, -0.765579, -1.244688, -0.526024, -1.244688, -0.605876, -1.40439, -0.526024, 0.671747, 1.94937, 0.512044, 0.352341, -1.244688, -0.366321, 1.550113, -1.564093, -0.366321, 0.911301, 2.348628, 1.629965, 0.671747, 0.991153, -0.046915, 0.192638, -0.366321, -0.28647, 1.310559, -0.925282, 1.310559, 1.310559, 1.629965, 0.991153, -0.685727, -0.366321, -0.605876, 0.192638, 1.789667, -1.164836, 0.032935, 1.789667, 0.112787, 0.272489, 1.39041, -1.324539, -0.84543, 0.591895, -1.084985, 0.751598, 0.512044, -0.206618, 0.991153, 1.071004, -0.526024, 0.512044, 0.591895, 0.991153, -0.366321, -0.843612, -1.560598, -0.285956, 2.183663, 1.148016, 0.112369, 0.59036, -1.799594, 0.59036, -0.684282, -0.046961, -1.799594, 0.829355, -0.684282, 1.227681, 2.422658, 0.431029, -1.560598, 0.032704], + "School_gender": [ + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 0] + ], + "VR": [ + [0, 0], + [1, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [1, 0], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 0], + [1, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 0], + [0, 0], + [1, 0], + [1, 0], + [1, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 0], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [0, 1], + [0, 0], + [0, 0], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [0, 0], + [0, 1], + [1, 0], + [1, 0], + [0, 1], + [1, 0], + [0, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1], + [1, 0], + [0, 1], + [1, 0], + [1, 0], + [1, 0], + [0, 0], + [1, 0] + ], + "School_denom": [ + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [1, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 1], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 1, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], +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 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 32, 32, 32, 32, 32, 32, 32, 33, 34, 34, 35, 35, 36, 37, 37, 37, 37, 38], + "M": 38, + "N": 1978, + "R": [ + [0.1, 0.005, 0.005], + [0.005, 0.1, 0.005], + [0.005, 0.005, 0.1] + ] +} diff --git a/benchmark/stan/bugs_examples/vol2/schools/schools.stan b/benchmark/stan/bugs_examples/vol2/schools/schools.stan new file mode 100644 index 000000000..3f9bd7eea --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/schools/schools.stan @@ -0,0 +1,85 @@ +// Schools: ranking school examination resutls using +// multivariate hierarcical models +// http://www.openbugs.net/Examples/Schools.html + +data { + int N; + int M; + vector[N] LRT; + array[N] int school; + array[N, 3] int School_denom; + array[N, 2] int School_gender; + array[N, 2] int VR; + array[N] real Y; + array[N] int Gender; + cov_matrix[3] R; +} +transformed data { + vector[3] gamma_mu; + cov_matrix[3] gamma_Sigma; + cov_matrix[3] invR; + invR = inverse(R); + gamma_mu[1] = 0; + gamma_mu[2] = 0; + gamma_mu[3] = 0; + for (i in 1 : 3) { + for (j in 1 : 3) { + gamma_Sigma[i, j] = 0; + } + } + for (i in 1 : 3) { + gamma_Sigma[i, i] = 100; + } +} +parameters { + array[8] real beta; + array[M] vector[3] alpha; + vector[3] gamma; + cov_matrix[3] Sigma; + real theta; + real phi; +} +model { + array[N] real Ymu; + for (p in 1 : N) { + Ymu[p] = alpha[school[p], 1] + alpha[school[p], 2] * LRT[p] + + alpha[school[p], 3] * VR[p, 1] + beta[1] * LRT[p] * LRT[p] + + beta[2] * VR[p, 2] + beta[3] * Gender[p] + + beta[4] * School_gender[p, 1] + beta[5] * School_gender[p, 2] + + beta[6] * School_denom[p, 1] + beta[7] * School_denom[p, 2] + + beta[8] * School_denom[p, 3]; + } + Y ~ normal(Ymu, exp(-.5 * (theta + phi * LRT))); + // for(p in 1:N) { + // Y[p] ~ normal(, exp(-.5 * (theta + phi * LRT[p]))); + // } + // min.var <- exp(-(theta + phi * (-34.6193))) # lowest LRT score = -34.6193 + // max.var <- exp(-(theta + phi * (37.3807))) # highest LRT score = 37.3807 + + // Priors for fixed effects: + beta ~ normal(0, 100); + // for (k in 1:8) beta[k] ~ normal(0.0, 100); + theta ~ normal(0.0, 100); + phi ~ normal(0.0, 100); + + // Priors for random coefficients: + for (m in 1 : M) { + alpha[m] ~ multi_normal(gamma, Sigma); + } + // Hyper-priors: + gamma ~ multi_normal(gamma_mu, gamma_Sigma); + Sigma ~ inv_wishart(3, invR); +} +generated quantities { + // real alpha1[M]; + array[M] real ranks; + // for (m in 1:M) alpha1[m] <- alpha[m, 1]; + //# compute ranks + for (j in 1 : M) { + array[M] real greater_than; + for (k in 1 : M) { + greater_than[k] = step(alpha[k, 1] - alpha[j, 1]); + } + ranks[j] = sum(greater_than); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/makefile b/benchmark/stan/bugs_examples/vol2/stagnant/makefile new file mode 100644 index 000000000..799123b9c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/makefile @@ -0,0 +1,17 @@ +STAN_HOME = ../../../../.. +PGM = stagnant +CXX= g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) --data=$(PGM).data.R + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.data.R b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.data.R new file mode 100644 index 000000000..bd2945494 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.data.R @@ -0,0 +1,9 @@ +"N" <- 29 +"x" <- +c(-1.39, -1.39, -1.08, -1.08, -0.94, -0.8, -0.63, -0.63, -0.25, +-0.25, -0.12, -0.12, 0.01, 0.11, 0.11, 0.11, 0.25, 0.25, 0.34, +0.34, 0.44, 0.59, 0.7, 0.7, 0.85, 0.85, 0.99, 0.99, 1.19) +"Y" <- +c(1.12, 1.12, 0.99, 1.03, 0.92, 0.9, 0.81, 0.83, 0.65, 0.67, +0.6, 0.59, 0.51, 0.44, 0.43, 0.43, 0.33, 0.3, 0.25, 0.24, 0.13, +-0.01, -0.13, -0.14, -0.3, -0.33, -0.46, -0.43, -0.65) diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.data.json b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.data.json new file mode 100644 index 000000000..b8b9ebe42 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.data.json @@ -0,0 +1,5 @@ +{ + "Y": [1.12, 1.12, 0.99, 1.03, 0.92, 0.9, 0.81, 0.83, 0.65, 0.67, 0.6, 0.59, 0.51, 0.44, 0.43, 0.43, 0.33, 0.3, 0.25, 0.24, 0.13, -0.01, -0.13, -0.14, -0.3, -0.33, -0.46, -0.43, -0.65], + "x": [-1.39, -1.39, -1.08, -1.08, -0.94, -0.8, -0.63, -0.63, -0.25, -0.25, -0.12, -0.12, 0.01, 0.11, 0.11, 0.11, 0.25, 0.25, 0.34, 0.34, 0.44, 0.59, 0.7, 0.7, 0.85, 0.85, 0.99, 0.99, 1.19], + "N": 29 +} diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.fit.R b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.fit.R new file mode 100644 index 000000000..94d9ed37a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.fit.R @@ -0,0 +1,5 @@ +library('rstan') +source('stagnant.data.R') +fit <- stan('stagnant2.stan', + data=c("N","x","Y"), + chains=4, iter=2000); diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.stan b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.stan new file mode 100644 index 000000000..469544940 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant.stan @@ -0,0 +1,42 @@ +// Change point model with very poor parameterization from BUGS, vol 2 + +// Bradley P. Carlin; Alan E. Gelfand; Adrian F. M. Smith. +// Hierarchical Bayesian Analysis of Changepoint Problems +// Applied Statistics, Vol. 41, No. 2. (1992), pp. 389-405. +// +// In these data, X represents the logarithm of the flow rate of +// water down an inclined channel (grams per centimetre per second) +// and Y represents the logarithm of the height of the stagnant +// surface layer (centimetres) for different surfactants. + +data { + int N; + array[N] real x; + array[N] real Y; +} +parameters { + real sigma; + real alpha; + array[2] real beta; + simplex[N] theta; +} +model { + // local variables + array[N] real log_probs; + array[N] real mu; + + // priors + theta ~ dirichlet(rep_vector(0.01, N)); + alpha ~ normal(0, 5); + beta ~ normal(0, 5); + sigma ~ cauchy(0, 5); + + // mixture likelihood + for (k in 1 : N) { + for (n in 1 : N) { + mu[n] = alpha + ((n <= k) ? beta[1] : beta[2]) * (x[n] - x[k]); + } + log_probs[k] = log(theta[k]) + normal_lpdf(Y | mu, sigma); + } + target += log_sum_exp(log_probs); +} diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.data.R b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.data.R new file mode 100644 index 000000000..bd2945494 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.data.R @@ -0,0 +1,9 @@ +"N" <- 29 +"x" <- +c(-1.39, -1.39, -1.08, -1.08, -0.94, -0.8, -0.63, -0.63, -0.25, +-0.25, -0.12, -0.12, 0.01, 0.11, 0.11, 0.11, 0.25, 0.25, 0.34, +0.34, 0.44, 0.59, 0.7, 0.7, 0.85, 0.85, 0.99, 0.99, 1.19) +"Y" <- +c(1.12, 1.12, 0.99, 1.03, 0.92, 0.9, 0.81, 0.83, 0.65, 0.67, +0.6, 0.59, 0.51, 0.44, 0.43, 0.43, 0.33, 0.3, 0.25, 0.24, 0.13, +-0.01, -0.13, -0.14, -0.3, -0.33, -0.46, -0.43, -0.65) diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.data.json b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.data.json new file mode 100644 index 000000000..b8b9ebe42 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.data.json @@ -0,0 +1,5 @@ +{ + "Y": [1.12, 1.12, 0.99, 1.03, 0.92, 0.9, 0.81, 0.83, 0.65, 0.67, 0.6, 0.59, 0.51, 0.44, 0.43, 0.43, 0.33, 0.3, 0.25, 0.24, 0.13, -0.01, -0.13, -0.14, -0.3, -0.33, -0.46, -0.43, -0.65], + "x": [-1.39, -1.39, -1.08, -1.08, -0.94, -0.8, -0.63, -0.63, -0.25, -0.25, -0.12, -0.12, 0.01, 0.11, 0.11, 0.11, 0.25, 0.25, 0.34, 0.34, 0.44, 0.59, 0.7, 0.7, 0.85, 0.85, 0.99, 0.99, 1.19], + "N": 29 +} diff --git a/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.stan b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.stan new file mode 100644 index 000000000..b5fcd1f2b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/stagnant/stagnant2.stan @@ -0,0 +1,25 @@ +data { + int N; + array[N] real x; + array[N] real Y; +} +parameters { + real sigma; + real alpha; + array[2] real beta; + real x_change; +} +model { + array[N] real mu; + + alpha ~ normal(0, 5); + beta ~ normal(0, 5); + sigma ~ cauchy(0, 5); + + for (n in 1 : N) { + mu[n] = alpha + + ((x[n] < x_change) ? beta[1] : beta[2]) * (x[n] - x_change); + } + + Y ~ normal(mu, sigma); +} diff --git a/benchmark/stan/bugs_examples/vol2/t_df/estdof.data.R b/benchmark/stan/bugs_examples/vol2/t_df/estdof.data.R new file mode 100644 index 000000000..8092f9a96 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/estdof.data.R @@ -0,0 +1,159 @@ +N <- +1000 +y <- +c(-0.817845, -0.103711, 1.42764, 0.827274, 0.183036, -0.454249, +-1.42342, -0.706751, -0.133675, -0.293978, 0.536184, -1.29365, +-0.418235, 0.0303628, 0.214827, -0.694282, 0.0512933, 1.96652, +0.915971, -0.77679, 0.360802, -0.125192, 2.67898, 1.05706, 0.192836, +1.07721, 2.01583, 0.172582, -1.20317, -1.57785, -0.0468516, -1.07973, +-0.794801, 0.404395, -1.57645, -3.48887, 0.374557, -1.57088, +1.013, -0.103245, -0.495745, 0.218023, 0.709256, 0.9077, 0.190439, +-1.24673, -1.63626, -1.8668, 0.6443, -0.733189, -0.809323, 0.487547, +-0.34016, 1.25067, -0.0143931, 0.401131, 6.0641, -2.75308, 0.0330596, +-0.0517554, -0.404975, -1.55097, 0.825607, -0.899226, 0.81909, +0.0674916, -0.381729, -0.395215, -0.639249, -0.578736, 0.67132, +0.0676066, 0.221666, 0.300809, 1.54157, -1.44174, -0.223093, +1.19035, -0.280898, 0.823555, -0.296334, -0.38366, 0.564009, +0.0682745, 0.962608, 1.37681, 1.18086, 0.927797, -1.35533, 1.06674, +-0.0631941, -0.880621, -0.268662, 1.14512, -0.302208, 0.114894, +-2.02352, 0.00270829, 2.30023, 3.16079, -1.70491, -0.643957, +-0.429836, 0.0340905, -2.3454, -0.0926452, -1.36019, 1.68442, +-1.99524, -0.891559, 1.16109, 0.275438, -1.20692, 0.0471873, +-0.162069, -1.25291, -0.47286, -1.91801, -0.0752052, 0.783756, +-1.73121, -2.10792, 0.593537, -1.60028, 0.500638, -0.330708, +3.15836, 5.46682, -0.748392, -0.133866, -0.0491846, -0.57946, +0.346713, 1.38651, 0.990721, 1.21658, 0.943635, 0.0911945, -1.56568, +0.0487876, -1.84982, -0.773624, -0.0154016, -1.48399, -0.601149, +2.37484, -0.479003, 0.286268, 1.22769, -0.147855, -1.09533, -0.419268, +-0.170291, 0.921545, 0.163983, -1.46292, -0.214565, 0.0803115, +0.944385, 0.00693036, -0.707184, 0.355326, -0.72782, 1.51318, +-0.265302, 0.133755, 0.815683, -0.962956, -0.654079, 0.796571, +-0.701074, -0.0366477, 2.11657, 0.232824, 0.592603, 0.137009, +-1.04385, 0.702276, 2.71952, 1.28931, 0.773662, -1.15848, -1.22168, +-0.538066, -1.34538, 0.827211, 0.664716, -1.08524, -0.463508, +-1.44337, 0.178952, -0.477346, 0.0507882, 0.464013, -0.923876, +-2.89461, -0.155918, 0.669771, -0.647432, -0.505292, -1.52653, +-0.308109, -1.27065, -0.962953, -0.375142, -0.672879, 0.83057, +-1.18045, -0.455549, 1.11852, -0.013159, -0.276366, 1.28657, +0.431971, -2.48339, 1.77692, -1.10438, -0.387477, 1.26687, -0.441253, +-0.268171, -0.326211, 0.966355, 1.42405, 1.53156, 0.767378, -0.959419, +0.463373, -0.582453, -0.290379, 0.050107, -0.416412, -0.314933, +2.40501, 0.231817, -0.287083, 0.0247413, 0.116101, -1.03797, +-0.119077, -0.624377, -0.1257, -0.0942679, -0.0545283, 0.786115, +0.0664632, 0.665984, 1.24105, 0.557682, 1.14123, -0.279469, 0.226504, +-0.163838, 0.689612, -2.18322, 0.0597184, -1.10708, 1.44559, +-0.302577, 0.330477, -1.05008, 1.16545, 0.441814, 0.900864, 0.454737, +-1.7139, -0.162065, -0.306533, -4.18218, -3.1885, 0.901692, 0.204923, +1.68928, -2.06611, -0.429855, -0.696685, -2.33614, 1.50655, -0.830301, +0.0674373, 0.496048, 1.26616, 3.79389, -0.66835, -0.438044, 0.00993774, +-1.99443, 2.71631, -0.135936, -0.169228, -0.184666, 2.5875, -1.47696, +-1.55034, -0.503298, 1.14055, -0.272939, 2.49968, -0.586318, +-0.46302, 0.683668, 0.533062, 0.0325403, 1.33661, 3.53585, -0.327395, +0.326601, -0.906528, 0.874176, -1.33531, 2.10194, -1.04577, 1.28152, +0.489685, -1.33451, 1.00266, 0.760348, -1.78752, 2.45659, -0.110117, +0.639545, -0.619145, -1.37268, -3.06855, 0.225569, -0.25371, +-0.473503, 1.25307, -0.513341, -0.426346, -0.461125, -1.54002, +-1.85711, -2.14043, 1.68084, 1.18461, -0.720707, -0.389284, 0.122942, +-0.202199, 0.606091, 0.746065, 0.553401, -0.834712, -0.185936, +1.19346, 1.22295, 1.68288, -0.867397, -0.917259, -1.42289, 0.0175332, +0.592769, 0.509623, 1.27444, -1.88544, 0.604006, -1.34068, 0.852041, +0.10609, -0.565207, 0.181977, 0.540482, -1.77908, 5.29888, 2.10049, +1.14845, 1.93668, -0.428552, -0.142355, -1.90506, -0.305555, +-0.234101, -0.0393298, 0.671328, 1.53932, -0.371812, -0.682843, +1.30888, 1.18836, -0.549056, 0.971372, -0.464377, -0.559409, +-2.4182, -1.8589, -0.227692, -0.214827, 1.98121, -0.390156, 0.129776, +0.135301, 1.01447, 1.65102, -1.43774, 0.516341, -1.06959, -2.08333, +-0.437428, 1.92736, 0.609327, -0.411361, -0.328122, -0.949214, +-1.69082, 0.270003, 1.77823, -0.057675, 1.19387, 0.270129, 1.69887, +1.3189, -0.00742435, -3.226, 1.0399, 0.679883, 1.09151, 0.429384, +-0.405909, 0.69043, -0.245564, 1.36644, 2.06639, -1.21849, 1.6139, +0.508066, -1.69592, -0.609227, -1.84829, 0.153134, 0.374684, +-0.312467, -2.54723, 0.31917, -0.722391, 0.55788, -0.065684, +0.0759953, 0.18949, -0.338046, -1.76933, -0.378623, -0.472832, +-0.997973, -0.542731, 0.635812, -1.61554, 1.85079, 4.29712, 0.770464, +-0.201797, -0.057689, -0.838368, -0.961949, 2.52252, 1.3739, +-0.554681, -0.20428, -0.774775, 1.5302, 0.55811, 0.60082, -0.272155, +-0.961242, -0.0630986, -2.66867, -0.659212, -0.361373, 1.36111, +-1.54682, -0.217919, 0.46271, -0.434716, 0.43529, -0.866228, +-0.447083, 0.00647346, 0.26954, -1.84314, -0.239216, -0.560364, +-2.9354, 1.27372, 0.00228936, -2.21244, -1.44777, 1.21817, -1.51898, +0.572702, -0.65908, 1.68405, 0.124283, 0.710749, 1.05177, 3.29229, +-1.45113, -0.441869, 2.0898, 2.4537, 1.43409, -1.95905, -0.428616, +0.391798, -0.38544, -0.122729, -0.6036, -1.39297, 0.0962887, +-0.451168, -0.90995, -0.321203, 3.0976, 0.342913, 1.17447, -6.21376, +-0.321376, -0.192798, -0.820011, 1.50067, 0.965114, -0.89682, +4.51557, 0.130391, -0.588566, 0.771883, -0.496106, 0.0885056, +-0.684699, 0.115476, 0.362103, 1.42093, 0.706881, 3.79473, 0.117767, +1.07593, -0.356269, 2.95087, -0.578431, 0.430975, -1.3222, -0.429446, +1.60477, -1.02978, -2.82895, 0.828071, 0.748398, -0.0627361, +1.00729, -0.131904, -0.605922, 0.55787, -1.91236, 0.199418, 0.896695, +-1.46746, -0.260249, 2.17096, 1.15726, -0.767627, 0.428945, -2.16, +-2.74251, -0.471207, -0.539919, -0.44441, 0.64677, 0.94357, -1.70868, +1.43182, 0.703199, -1.92973, -1.1745, 0.17238, 0.793359, 1.60842, +0.899481, -2.21447, -2.1551, -0.143391, -0.141851, -0.762628, +-1.95633, 0.19763, -0.196598, -0.442044, -0.0114935, -8.50536, +-0.522577, -1.84074, 0.1211, 0.476229, 2.68082, 0.418211, 0.186626, +0.0653767, -0.377161, 0.623174, 0.821468, 0.688092, -0.249279, +1.13429, 0.147186, 0.168089, 0.48639, 0.752596, 2.63625, -0.451032, +0.717551, 0.782556, -0.606436, 0.149142, 1.80807, 0.368006, -0.701583, +-1.08664, -0.0631614, -0.692835, -2.38091, -0.903029, 0.576135, +-0.192353, 0.410126, 2.59122, -0.254933, 0.560436, -1.61516, +0.181666, -0.550611, -0.241469, 1.228, 0.248717, -0.576808, -0.933142, +0.251987, -0.109949, -0.141312, 1.00954, 0.176338, -0.0294174, +2.3373, -1.16453, 0.0424615, 0.0828937, -0.848767, -0.461161, +-1.51222, 0.23703, 0.762034, -1.50813, 0.601593, 1.8587, -0.566075, +-0.660889, 3.32599, 1.30353, -0.993977, 0.479887, -0.135774, +-0.590276, -0.451796, -1.05276, -0.0375069, -1.62425, 0.514314, +0.254623, -0.576527, 1.16765, 0.22149, -1.46263, -0.525889, 1.05342, +0.00650677, -0.896864, -0.81421, -0.355196, -0.0187164, 0.818413, +0.698866, 0.421887, -0.17439, 0.685672, 0.852837, 0.0275932, +-2.14197, 0.277517, 0.13136, 0.496906, -0.0531739, 0.806401, +0.530064, 0.323924, 0.985921, -0.744742, -0.640952, 0.0473535, +-0.348235, -1.27053, 0.102462, 0.11478, -0.368237, -2.1179, -0.848408, +0.869458, -2.06643, 0.974726, -0.316548, 1.37003, 0.292384, 0.628395, +0.906947, 0.285401, 0.391408, 0.760652, 0.536166, -0.316046, +4.42389, 0.779558, 1.74807, -1.46169, 0.419126, 1.32498, 1.26758, +0.0674401, 0.012992, -0.816921, 2.6976, 1.55858, -0.260063, -0.0023777, +-0.88384, 0.447074, -0.308521, 0.282714, -1.01022, -1.54083, +1.66856, -0.418595, 0.257394, -1.85197, -0.727673, -0.251666, +5.07479, -0.39398, 0.068045, 0.208634, 1.09911, 0.498541, -0.932894, +-1.09236, 0.248094, 1.74604, -1.10987, 0.802812, 0.31512, 0.380596, +-0.307121, 0.587218, 0.362611, -0.9062, 0.545485, -0.816717, +0.110991, -0.856638, -0.0793812, 0.4417, 1.77724, 2.11925, 0.246244, +-0.270385, 0.0558522, -1.72309, -0.250033, 0.232433, -0.869515, +0.995592, -0.694216, -0.771087, 0.714881, 0.449009, -0.401518, +-6.80446, 0.948948, -0.883153, -0.915936, 0.540097, -1.21679, +0.779897, 4.66683, 1.16849, 0.699487, -0.131034, 1.60046, -0.336936, +-0.0750943, -0.219364, 0.474354, 0.401402, 1.77794, -1.49575, +0.389436, -0.712351, -5.71727, 0.94424, 0.142553, -0.0209691, +-2.00991, -1.94029, -0.472317, 0.621016, 0.694714, -0.49251, +0.573014, 1.46, 0.505826, -0.57995, -1.42483, -2.42491, 0.650556, +2.43125, -0.514413, 0.194745, -0.782428, -0.866613, -0.919896, +0.781724, 0.626892, 1.22135, 0.253382, -1.4955, -2.00449, 1.12032, +-0.102855, -0.375626, -0.0111173, 0.0160724, -0.0486727, -1.78223, +-0.788743, 2.36817, 0.375773, 3.21353, -1.68863, -1.41502, -0.268008, +-0.273934, -2.18853, -0.321689, -1.53334, -0.302529, -0.708199, +-0.515191, 0.190927, -1.04425, 0.620589, -0.948573, -0.63444, +1.35042, -0.0337609, 0.52204, -1.26807, 1.66492, -0.286996, -0.167648, +0.90591, 0.599167, -0.709669, 0.0698033, 0.830141, 0.31689, -0.306766, +-0.163829, -1.30053, -1.09435, -0.37976, -0.412886, 0.336108, +-1.0613, 1.82895, 1.63015, -1.5459, 1.04706, -0.798129, 1.46781, +-3.20952, -1.07752, -1.20255, 1.40173, -3.09779, -4.71973, -0.391884, +0.778569, -1.32687, 0.285925, 1.1969, 1.20694, 2.34679, -1.25738, +2.14194, -0.0729247, 0.576063, 0.0773842, 0.618094, 1.40651, +-0.979653, -1.38483, 2.0659, -0.107518, 0.440427, 0.204085, -1.12146, +0.452605, 0.900507, -2.95162, 0.788242, -0.674166, 0.97549, 0.963879, +-0.598712, -1.39283, -1.92637, 1.61554, 0.907171, 0.559835, 1.12299, +0.811359, 0.735545, 0.252023, 0.824692, -0.838971, 1.04166, -0.204302, +-0.812468, 2.27581, 0.00282123, 0.436391, -0.214845, -1.01202, +-0.216677, -0.817311, 0.0868439, -1.07285, -0.645481, -0.747386, +2.57396, -0.313113, 0.852527, 0.238207, -2.14327, 2.47467, 1.52749, +0.780893, 0.0323062, -1.052, -0.98425, 1.16239, -0.788171, -0.359831, +-1.76634, -0.0107236, 0.546469, -1.73911, 0.332703, -5.09733e-05, +0.522664, -0.205437, -1.18861, -0.749759, -0.555907, -2.25461, +-0.289969, 2.1984, -0.558306, -1.10131, 0.062126, -0.837723, +0.917098, 0.624373, -1.16332, 0.99562, -0.054476, -0.186614, +0.0144295, -3.65142, 0.276402, -0.446231, -1.07758, 0.893216, +-0.0643286, 1.76603, -1.65065, -1.98831, -2.35082, -0.0351186, +2.11055, 2.03975, -0.941497, -0.779052, -1.4606, -0.159627, -1.44066 +) diff --git a/benchmark/stan/bugs_examples/vol2/t_df/estdof.data.json b/benchmark/stan/bugs_examples/vol2/t_df/estdof.data.json new file mode 100644 index 000000000..8d0d339ab --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/estdof.data.json @@ -0,0 +1,4 @@ +{ + "y": [-0.817845, -0.103711, 1.42764, 0.827274, 0.183036, -0.454249, -1.42342, -0.706751, -0.133675, -0.293978, 0.536184, -1.29365, -0.418235, 0.0303628, 0.214827, -0.694282, 0.0512933, 1.96652, 0.915971, -0.77679, 0.360802, -0.125192, 2.67898, 1.05706, 0.192836, 1.07721, 2.01583, 0.172582, -1.20317, -1.57785, -0.0468516, -1.07973, -0.794801, 0.404395, -1.57645, -3.48887, 0.374557, -1.57088, 1.013, -0.103245, -0.495745, 0.218023, 0.709256, 0.9077, 0.190439, -1.24673, -1.63626, -1.8668, 0.6443, -0.733189, -0.809323, 0.487547, -0.34016, 1.25067, -0.0143931, 0.401131, 6.0641, -2.75308, 0.0330596, -0.0517554, -0.404975, -1.55097, 0.825607, -0.899226, 0.81909, 0.0674916, -0.381729, -0.395215, -0.639249, -0.578736, 0.67132, 0.0676066, 0.221666, 0.300809, 1.54157, -1.44174, -0.223093, 1.19035, -0.280898, 0.823555, -0.296334, -0.38366, 0.564009, 0.0682745, 0.962608, 1.37681, 1.18086, 0.927797, -1.35533, 1.06674, -0.0631941, -0.880621, -0.268662, 1.14512, -0.302208, 0.114894, -2.02352, 0.00270829, 2.30023, 3.16079, -1.70491, -0.643957, -0.429836, 0.0340905, -2.3454, -0.0926452, -1.36019, 1.68442, -1.99524, -0.891559, 1.16109, 0.275438, -1.20692, 0.0471873, -0.162069, -1.25291, -0.47286, -1.91801, -0.0752052, 0.783756, -1.73121, -2.10792, 0.593537, -1.60028, 0.500638, -0.330708, 3.15836, 5.46682, -0.748392, -0.133866, -0.0491846, -0.57946, 0.346713, 1.38651, 0.990721, 1.21658, 0.943635, 0.0911945, -1.56568, 0.0487876, -1.84982, -0.773624, -0.0154016, -1.48399, -0.601149, 2.37484, -0.479003, 0.286268, 1.22769, -0.147855, -1.09533, -0.419268, -0.170291, 0.921545, 0.163983, -1.46292, -0.214565, 0.0803115, 0.944385, 0.00693036, -0.707184, 0.355326, -0.72782, 1.51318, -0.265302, 0.133755, 0.815683, -0.962956, -0.654079, 0.796571, -0.701074, -0.0366477, 2.11657, 0.232824, 0.592603, 0.137009, -1.04385, 0.702276, 2.71952, 1.28931, 0.773662, -1.15848, -1.22168, -0.538066, -1.34538, 0.827211, 0.664716, -1.08524, -0.463508, -1.44337, 0.178952, -0.477346, 0.0507882, 0.464013, -0.923876, -2.89461, -0.155918, 0.669771, -0.647432, -0.505292, -1.52653, -0.308109, -1.27065, -0.962953, -0.375142, -0.672879, 0.83057, -1.18045, -0.455549, 1.11852, -0.013159, -0.276366, 1.28657, 0.431971, -2.48339, 1.77692, -1.10438, -0.387477, 1.26687, -0.441253, -0.268171, -0.326211, 0.966355, 1.42405, 1.53156, 0.767378, -0.959419, 0.463373, -0.582453, -0.290379, 0.050107, -0.416412, -0.314933, 2.40501, 0.231817, -0.287083, 0.0247413, 0.116101, -1.03797, -0.119077, -0.624377, -0.1257, -0.0942679, -0.0545283, 0.786115, 0.0664632, 0.665984, 1.24105, 0.557682, 1.14123, -0.279469, 0.226504, -0.163838, 0.689612, -2.18322, 0.0597184, -1.10708, 1.44559, -0.302577, 0.330477, -1.05008, 1.16545, 0.441814, 0.900864, 0.454737, -1.7139, -0.162065, -0.306533, -4.18218, -3.1885, 0.901692, 0.204923, 1.68928, -2.06611, -0.429855, -0.696685, -2.33614, 1.50655, -0.830301, 0.0674373, 0.496048, 1.26616, 3.79389, -0.66835, -0.438044, 0.00993774, -1.99443, 2.71631, -0.135936, -0.169228, -0.184666, 2.5875, -1.47696, -1.55034, -0.503298, 1.14055, -0.272939, 2.49968, -0.586318, -0.46302, 0.683668, 0.533062, 0.0325403, 1.33661, 3.53585, -0.327395, 0.326601, -0.906528, 0.874176, -1.33531, 2.10194, -1.04577, 1.28152, 0.489685, -1.33451, 1.00266, 0.760348, -1.78752, 2.45659, -0.110117, 0.639545, -0.619145, -1.37268, -3.06855, 0.225569, -0.25371, -0.473503, 1.25307, -0.513341, -0.426346, -0.461125, -1.54002, -1.85711, -2.14043, 1.68084, 1.18461, -0.720707, -0.389284, 0.122942, -0.202199, 0.606091, 0.746065, 0.553401, -0.834712, -0.185936, 1.19346, 1.22295, 1.68288, -0.867397, -0.917259, -1.42289, 0.0175332, 0.592769, 0.509623, 1.27444, -1.88544, 0.604006, -1.34068, 0.852041, 0.10609, -0.565207, 0.181977, 0.540482, -1.77908, 5.29888, 2.10049, 1.14845, 1.93668, -0.428552, -0.142355, -1.90506, -0.305555, -0.234101, -0.0393298, 0.671328, 1.53932, -0.371812, -0.682843, 1.30888, 1.18836, -0.549056, 0.971372, -0.464377, -0.559409, -2.4182, -1.8589, -0.227692, -0.214827, 1.98121, -0.390156, 0.129776, 0.135301, 1.01447, 1.65102, -1.43774, 0.516341, -1.06959, -2.08333, -0.437428, 1.92736, 0.609327, -0.411361, -0.328122, -0.949214, -1.69082, 0.270003, 1.77823, -0.057675, 1.19387, 0.270129, 1.69887, 1.3189, -0.00742435, -3.226, 1.0399, 0.679883, 1.09151, 0.429384, -0.405909, 0.69043, -0.245564, 1.36644, 2.06639, -1.21849, 1.6139, 0.508066, -1.69592, -0.609227, -1.84829, 0.153134, 0.374684, -0.312467, -2.54723, 0.31917, -0.722391, 0.55788, -0.065684, 0.0759953, 0.18949, -0.338046, -1.76933, -0.378623, -0.472832, -0.997973, -0.542731, 0.635812, -1.61554, 1.85079, 4.29712, 0.770464, -0.201797, -0.057689, -0.838368, -0.961949, 2.52252, 1.3739, -0.554681, -0.20428, -0.774775, 1.5302, 0.55811, 0.60082, -0.272155, -0.961242, -0.0630986, -2.66867, -0.659212, -0.361373, 1.36111, -1.54682, -0.217919, 0.46271, -0.434716, 0.43529, -0.866228, -0.447083, 0.00647346, 0.26954, -1.84314, -0.239216, -0.560364, -2.9354, 1.27372, 0.00228936, -2.21244, -1.44777, 1.21817, -1.51898, 0.572702, -0.65908, 1.68405, 0.124283, 0.710749, 1.05177, 3.29229, -1.45113, -0.441869, 2.0898, 2.4537, 1.43409, -1.95905, -0.428616, 0.391798, -0.38544, -0.122729, -0.6036, -1.39297, 0.0962887, -0.451168, -0.90995, -0.321203, 3.0976, 0.342913, 1.17447, -6.21376, -0.321376, -0.192798, -0.820011, 1.50067, 0.965114, -0.89682, 4.51557, 0.130391, -0.588566, 0.771883, -0.496106, 0.0885056, -0.684699, 0.115476, 0.362103, 1.42093, 0.706881, 3.79473, 0.117767, 1.07593, -0.356269, 2.95087, -0.578431, 0.430975, -1.3222, -0.429446, 1.60477, -1.02978, -2.82895, 0.828071, 0.748398, -0.0627361, 1.00729, -0.131904, -0.605922, 0.55787, -1.91236, 0.199418, 0.896695, -1.46746, -0.260249, 2.17096, 1.15726, -0.767627, 0.428945, -2.16, -2.74251, -0.471207, -0.539919, -0.44441, 0.64677, 0.94357, -1.70868, 1.43182, 0.703199, -1.92973, -1.1745, 0.17238, 0.793359, 1.60842, 0.899481, -2.21447, -2.1551, -0.143391, -0.141851, -0.762628, -1.95633, 0.19763, -0.196598, -0.442044, -0.0114935, -8.50536, -0.522577, -1.84074, 0.1211, 0.476229, 2.68082, 0.418211, 0.186626, 0.0653767, -0.377161, 0.623174, 0.821468, 0.688092, -0.249279, 1.13429, 0.147186, 0.168089, 0.48639, 0.752596, 2.63625, -0.451032, 0.717551, 0.782556, -0.606436, 0.149142, 1.80807, 0.368006, -0.701583, -1.08664, -0.0631614, -0.692835, -2.38091, -0.903029, 0.576135, -0.192353, 0.410126, 2.59122, -0.254933, 0.560436, -1.61516, 0.181666, -0.550611, -0.241469, 1.228, 0.248717, -0.576808, -0.933142, 0.251987, -0.109949, -0.141312, 1.00954, 0.176338, -0.0294174, 2.3373, -1.16453, 0.0424615, 0.0828937, -0.848767, -0.461161, -1.51222, 0.23703, 0.762034, -1.50813, 0.601593, 1.8587, -0.566075, -0.660889, 3.32599, 1.30353, -0.993977, 0.479887, -0.135774, -0.590276, -0.451796, -1.05276, -0.0375069, -1.62425, 0.514314, 0.254623, -0.576527, 1.16765, 0.22149, -1.46263, -0.525889, 1.05342, 0.00650677, -0.896864, -0.81421, -0.355196, -0.0187164, 0.818413, 0.698866, 0.421887, -0.17439, 0.685672, 0.852837, 0.0275932, -2.14197, 0.277517, 0.13136, 0.496906, -0.0531739, 0.806401, 0.530064, 0.323924, 0.985921, -0.744742, -0.640952, 0.0473535, -0.348235, -1.27053, 0.102462, 0.11478, -0.368237, -2.1179, -0.848408, 0.869458, -2.06643, 0.974726, -0.316548, 1.37003, 0.292384, 0.628395, 0.906947, 0.285401, 0.391408, 0.760652, 0.536166, -0.316046, 4.42389, 0.779558, 1.74807, -1.46169, 0.419126, 1.32498, 1.26758, 0.0674401, 0.012992, -0.816921, 2.6976, 1.55858, -0.260063, -0.0023777, -0.88384, 0.447074, -0.308521, 0.282714, -1.01022, -1.54083, 1.66856, -0.418595, 0.257394, -1.85197, -0.727673, -0.251666, 5.07479, -0.39398, 0.068045, 0.208634, 1.09911, 0.498541, -0.932894, -1.09236, 0.248094, 1.74604, -1.10987, 0.802812, 0.31512, 0.380596, -0.307121, 0.587218, 0.362611, -0.9062, 0.545485, -0.816717, 0.110991, -0.856638, -0.0793812, 0.4417, 1.77724, 2.11925, 0.246244, -0.270385, 0.0558522, -1.72309, -0.250033, 0.232433, -0.869515, 0.995592, -0.694216, -0.771087, 0.714881, 0.449009, -0.401518, -6.80446, 0.948948, -0.883153, -0.915936, 0.540097, -1.21679, 0.779897, 4.66683, 1.16849, 0.699487, -0.131034, 1.60046, -0.336936, -0.0750943, -0.219364, 0.474354, 0.401402, 1.77794, -1.49575, 0.389436, -0.712351, -5.71727, 0.94424, 0.142553, -0.0209691, -2.00991, -1.94029, -0.472317, 0.621016, 0.694714, -0.49251, 0.573014, 1.46, 0.505826, -0.57995, -1.42483, -2.42491, 0.650556, 2.43125, -0.514413, 0.194745, -0.782428, -0.866613, -0.919896, 0.781724, 0.626892, 1.22135, 0.253382, -1.4955, -2.00449, 1.12032, -0.102855, -0.375626, -0.0111173, 0.0160724, -0.0486727, -1.78223, -0.788743, 2.36817, 0.375773, 3.21353, -1.68863, -1.41502, -0.268008, -0.273934, -2.18853, -0.321689, -1.53334, -0.302529, -0.708199, -0.515191, 0.190927, -1.04425, 0.620589, -0.948573, -0.63444, 1.35042, -0.0337609, 0.52204, -1.26807, 1.66492, -0.286996, -0.167648, 0.90591, 0.599167, -0.709669, 0.0698033, 0.830141, 0.31689, -0.306766, -0.163829, -1.30053, -1.09435, -0.37976, -0.412886, 0.336108, -1.0613, 1.82895, 1.63015, -1.5459, 1.04706, -0.798129, 1.46781, -3.20952, -1.07752, -1.20255, 1.40173, -3.09779, -4.71973, -0.391884, 0.778569, -1.32687, 0.285925, 1.1969, 1.20694, 2.34679, -1.25738, 2.14194, -0.0729247, 0.576063, 0.0773842, 0.618094, 1.40651, -0.979653, -1.38483, 2.0659, -0.107518, 0.440427, 0.204085, -1.12146, 0.452605, 0.900507, -2.95162, 0.788242, -0.674166, 0.97549, 0.963879, -0.598712, -1.39283, -1.92637, 1.61554, 0.907171, 0.559835, 1.12299, 0.811359, 0.735545, 0.252023, 0.824692, -0.838971, 1.04166, -0.204302, -0.812468, 2.27581, 0.00282123, 0.436391, -0.214845, -1.01202, -0.216677, -0.817311, 0.0868439, -1.07285, -0.645481, -0.747386, 2.57396, -0.313113, 0.852527, 0.238207, -2.14327, 2.47467, 1.52749, 0.780893, 0.0323062, -1.052, -0.98425, 1.16239, -0.788171, -0.359831, -1.76634, -0.0107236, 0.546469, -1.73911, 0.332703, -5.09733e-05, 0.522664, -0.205437, -1.18861, -0.749759, -0.555907, -2.25461, -0.289969, 2.1984, -0.558306, -1.10131, 0.062126, -0.837723, 0.917098, 0.624373, -1.16332, 0.99562, -0.054476, -0.186614, 0.0144295, -3.65142, 0.276402, -0.446231, -1.07758, 0.893216, -0.0643286, 1.76603, -1.65065, -1.98831, -2.35082, -0.0351186, 2.11055, 2.03975, -0.941497, -0.779052, -1.4606, -0.159627, -1.44066], + "N": 1000 +} diff --git a/benchmark/stan/bugs_examples/vol2/t_df/estdof.stan b/benchmark/stan/bugs_examples/vol2/t_df/estdof.stan new file mode 100644 index 000000000..0217cbc9f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/estdof.stan @@ -0,0 +1,18 @@ +//# estimated the degree of freedom (dof) from +//# samples by sim.stan +// http://www.openbugs.net/Examples/t-df.html + +//# estimate dof using continuous priors + +data { + int N; + array[N] real y; +} +parameters { + // learning about the dof as a continuous quantity + real d; +} +model { + y ~ student_t(d, 0, 1); + // d ~ uniform(2, 100); +} diff --git a/benchmark/stan/bugs_examples/vol2/t_df/estdof2.stan.0 b/benchmark/stan/bugs_examples/vol2/t_df/estdof2.stan.0 new file mode 100644 index 000000000..4d7234d65 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/estdof2.stan.0 @@ -0,0 +1,35 @@ + +## estimated the degree of freedom (dof) from +## samples by sim.stan +# http://www.openbugs.net/Examples/t-df.html + +## estimate dof using discrete priors + +## status: not work since K is discrete + + +data { + int N; + real y[N]; +} + +transformed data { + vector[49] p; + for (i in 1:49) p[i] <- 1.0 / 49; +} + +parameters { + int K; +} +transformed parameters { + // learning about the dof as a continuous quantity + int d; + d <- K + 2; +} + +model { + K ~ categorical(p); + for (i in 1:N) { + y[i] ~ student_t(d, 0, 1); + } +} diff --git a/benchmark/stan/bugs_examples/vol2/t_df/makefile b/benchmark/stan/bugs_examples/vol2/t_df/makefile new file mode 100644 index 000000000..b0d0460fc --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/makefile @@ -0,0 +1,30 @@ +STAN_HOME = ../../../../.. +PGM = simt4# +PGM2 = estdof# +PGM3 = estdof2# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample output sample=samples1.csv + +$(PGM2) : + $(STAN_HOME)/bin/stanc --name=$(PGM2) $(PGM2).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM2).cpp -o $(PGM2) $(LIBFLAGS) + ./$(PGM2) data=$(PGM2).data.R sample output sample=samples2.csv + +$(PGM3) : + $(STAN_HOME)/bin/stanc --name=$(PGM3) $(PGM3).stan.0 + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM3).cpp -o $(PGM3) $(LIBFLAGS) + ./$(PGM3) data=$(PGM3).data.R sample output sample=samples3.csv + +clean : + rm -f $(PGM).cpp samples1.csv $(PGM) + rm -f $(PGM2).cpp samples2.csv $(PGM2) + rm -f $(PGM3).cpp samples3.csv $(PGM3) diff --git a/benchmark/stan/bugs_examples/vol2/t_df/post.R b/benchmark/stan/bugs_examples/vol2/t_df/post.R new file mode 100644 index 000000000..c8e568170 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/post.R @@ -0,0 +1,8 @@ + +library(coda) +post1 <- read.csv(file = "samples1.csv", header = TRUE, comment.char = '#'); +summary(as.mcmc(post1[, 'y.1'])) + +post2 <- read.csv(file = "samples2.csv", header = TRUE, comment.char = '#'); +summary(as.mcmc(post2[, 'd'])) + diff --git a/benchmark/stan/bugs_examples/vol2/t_df/simt4.stan b/benchmark/stan/bugs_examples/vol2/t_df/simt4.stan new file mode 100644 index 000000000..53d939342 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol2/t_df/simt4.stan @@ -0,0 +1,14 @@ +//# simulate samples from student t distribution +//# +// http://www.openbugs.net/Examples/t-df.html + +transformed data { + int d; + d = 4; +} +parameters { + array[1000] real y; +} +model { + y ~ student_t(d, 0, 1); +} diff --git a/benchmark/stan/bugs_examples/vol3/camel/camel.stan b/benchmark/stan/bugs_examples/vol3/camel/camel.stan new file mode 100644 index 000000000..db7eca850 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/camel/camel.stan @@ -0,0 +1,66 @@ +/** + * Camel: Multivariate normal with structured missing data + * http://www.openbugs.net/Examples/Camel.html + * + * status: results not verified with in those in bugs + */ +transformed data { + vector[2] mu; + matrix[2, 2] S; + mu[1] = 0; + mu[2] = 0; + S[1, 1] = 1000; + S[1, 2] = 0; + S[2, 1] = 0; + S[2, 2] = 1000; +} +parameters { + cov_matrix[2] Sigma; + real y52; + real y62; + real y72; + real y82; + real y91; + real y101; + real y111; + real y121; +} +model { + array[12] vector[2] Y; + Y[1, 1] = 1; + Y[1, 2] = 1; + Y[2, 1] = 1; + Y[2, 2] = -1; + Y[3, 1] = -1; + Y[3, 2] = 1; + Y[4, 1] = -1; + Y[4, 2] = -1; + + Y[5, 1] = 2; + Y[6, 1] = 2; + Y[7, 1] = -2; + Y[8, 1] = -2; + Y[5, 2] = y52; + Y[6, 2] = y62; + Y[7, 2] = y72; + Y[8, 2] = y82; + Y[9, 1] = y91; + Y[10, 1] = y101; + Y[11, 1] = y111; + Y[12, 1] = y121; + Y[9, 2] = 2; + Y[10, 2] = 2; + Y[11, 2] = -2; + Y[12, 2] = -2; + + // instead of Sigma ~ inv_wishart(2, S), + // using the prior as in Tanner and Wong (1987) + target += -1.5 * log(determinant(Sigma)); + for (n in 1 : 12) { + Y[n] ~ multi_normal(mu, Sigma); + } +} +generated quantities { + real rho; + rho = Sigma[1, 2] / sqrt(Sigma[1, 1] * Sigma[2, 2]); +} diff --git a/benchmark/stan/bugs_examples/vol3/camel/camel2.stan b/benchmark/stan/bugs_examples/vol3/camel/camel2.stan new file mode 100644 index 000000000..eba3848b4 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/camel/camel2.stan @@ -0,0 +1,55 @@ +/* + * Camel: Multivariate normal with structured missing data + * http://www.openbugs.net/Examples/Camel.html + * + * integrate out the missing data + */ +transformed data { + array[4] vector[2] Y; + array[4] real Y1; // missing y2 + array[4] real Y2; // msising y1 + + vector[2] mu; + matrix[2, 2] S; + + mu[1] = 0; + mu[2] = 0; + S[1, 1] = 1000; + S[1, 2] = 0; + S[2, 1] = 0; + S[2, 2] = 1000; + + Y[1, 1] = 1.; + Y[1, 2] = 1.; + Y[2, 1] = 1.; + Y[2, 2] = -1.; + Y[3, 1] = -1.; + Y[3, 2] = 1.; + Y[4, 1] = -1.; + Y[4, 2] = -1.; + + Y1[1] = 2.; + Y1[2] = 2.; + Y1[3] = -2.; + Y1[4] = -2.; + + Y2[1] = 2.; + Y2[2] = 2.; + Y2[3] = -2.; + Y2[4] = -2.; +} +parameters { + cov_matrix[2] Sigma; +} +transformed parameters { + real rho; + rho = Sigma[1, 2] / sqrt(Sigma[1, 1] * Sigma[2, 2]); +} +model { + for (n in 1 : 4) { + Y[n] ~ multi_normal(mu, Sigma); + } + Y1 ~ normal(0, sqrt(Sigma[1, 1])); + Y2 ~ normal(0, sqrt(Sigma[2, 2])); + target += -1.5 * log(determinant(Sigma)); +} diff --git a/benchmark/stan/bugs_examples/vol3/camel/makefile b/benchmark/stan/bugs_examples/vol3/camel/makefile new file mode 100644 index 000000000..f4e4dffa3 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/camel/makefile @@ -0,0 +1,22 @@ +STAN_HOME = ../../../../.. +PGM = camel# +PGM2 = camel2# +CXX = g++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) sample + +$(PGM2) : + $(STAN_HOME)/bin/stanc --name=$(PGM2) $(PGM2).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM2).cpp -o $(PGM2) $(LIBFLAGS) + ./$(PGM2) sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) + rm -f $(PGM2).cpp samples.csv $(PGM2) diff --git a/benchmark/stan/bugs_examples/vol3/camel/post.R b/benchmark/stan/bugs_examples/vol3/camel/post.R new file mode 100644 index 000000000..fe69a9491 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/camel/post.R @@ -0,0 +1,32 @@ +library(coda) +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#') + +plot(as.mcmc(post)) + +beginwith <- function(vstr, patterns, sort = TRUE) { + patterns <- paste(patterns, ".*", sep = ''); + a <- lapply(patterns, FUN = function(p) {grep(p, vstr)}) + if (!sort) return(do.call("c", a)) + sort(do.call("c", a)) +} + +poiidx <- beginwith(colnames(post), c("Sigma", "rho")) +poi <- post[, poiidx] +summary(as.mcmc(poi)) + +plot(as.mcmc(poi)) + + +## JAGS does not support the missing data here +## +# library(BUGSExamples); +# pars <- c("mu", "Sigma2", "tau", "rho"); +# ex <- list(name = "Camel", parameters = pars, +# nSample = 10000, nBurnin = 1000, nThin = 1, +# nChain = 3) + +# jagspost <- runExample(ex, engine = "JAGS") +# summary(jagspost) + + + diff --git a/benchmark/stan/bugs_examples/vol3/data_cloning/makefile b/benchmark/stan/bugs_examples/vol3/data_cloning/makefile new file mode 100644 index 000000000..d48873c0a --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/data_cloning/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = seeds# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -rf $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol3/data_cloning/post.R b/benchmark/stan/bugs_examples/vol3/data_cloning/post.R new file mode 100644 index 000000000..f2a8a2583 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/data_cloning/post.R @@ -0,0 +1,5 @@ +library(coda); +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#'); + +poi <- post[, c("alpha0", "alpha1", "alpha12", "alpha2", "sigma")] +summary(as.mcmc(poi)) diff --git a/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.data.R b/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.data.R new file mode 100644 index 000000000..ac897d34b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.data.R @@ -0,0 +1,14 @@ +"I" <- +21 +"n" <- +c(10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0, +3, 22, 15, 32, 3) +"N" <- +c(39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45, +4, 12, 41, 30, 51, 7) +"x1" <- +c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1) +"x2" <- +c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, +1) diff --git a/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.data.json b/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.data.json new file mode 100644 index 000000000..bd87198be --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.data.json @@ -0,0 +1,7 @@ +{ + "I": 21, + "N": [39, 62, 81, 51, 39, 6, 74, 72, 51, 79, 13, 16, 30, 28, 45, 4, 12, 41, 30, 51, 7], + "n": [10, 23, 23, 26, 17, 5, 53, 55, 32, 46, 10, 8, 10, 8, 23, 0, 3, 22, 15, 32, 3], + "x1": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "x2": [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1] +} diff --git a/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.stan b/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.stan new file mode 100644 index 000000000..6b32f50dd --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/data_cloning/seeds.stan @@ -0,0 +1,50 @@ +// Using Data Cloning to Calculate MLEs for the Seeds Model in vol1 +// http://www.openbugs.net/Examples/DataCloning.html + +// The basic idea is that we raise the likelihood in the +// posterior to the power of K so that the posterior +// estimates would concentrate on the MLE estimates. +// Reference: +// Ecology Letters +// Subhash R. Lele Brian Dennis Frithjof Lutscher +// DOI: 10.1111/j.1461-0248.2007.01047.x +// http://onlinelibrary.wiley.com/doi/10.1111/j.1461-0248.2007.01047.x/abstract + +data { + int I; + array[I] int n; + array[I] int N; + vector[I] x1; + vector[I] x2; +} +transformed data { + int K; + vector[I] x1x2; + K = 8; // {1, 2, 4, 8, 16, 32, 64, 128, 256} + x1x2 = x1 .* x2; +} +parameters { + real alpha0; + real alpha1; + real alpha2; + real alpha12; + real tau; + array[I] vector[K] b; +} +transformed parameters { + real sigma; + sigma = 1 / sqrt(tau); +} +model { + alpha0 ~ normal(0.0, 1.0E3); + alpha1 ~ normal(0.0, 1.0E3); + alpha2 ~ normal(0.0, 1.0E3); + alpha12 ~ normal(0.0, 1.0E3); + tau ~ gamma(1.0E-3, 1.0E-3); + for (i in 1 : I) { + b[i] ~ normal(0.0, sigma); + n[i] ~ binomial_logit(N[i], + alpha0 + alpha1 * x1[i] + alpha2 * x2[i] + + alpha12 * x1x2[i] + b[i]); + } +} diff --git a/benchmark/stan/bugs_examples/vol3/fire/fire.data.R b/benchmark/stan/bugs_examples/vol3/fire/fire.data.R new file mode 100644 index 000000000..3a3464dd5 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/fire/fire.data.R @@ -0,0 +1,404 @@ +N <- 2492 +x <- +c(1.6837482, 2.0937042, 1.7325813, 1.779754, 4.6120059, 8.7252738, +7.8989751, 2.2080454, 1.4860908, 2.7961713, 7.3206442, 3.3674963, +1.4641288, 1.7222225, 11.374817, 2.4827394, 26.2146413, 2.0024305, +4.5300146, 1.8417526, 3.806735, 14.1220761, 5.4242533, 11.7130307, +1.5153734, 2.5385886, 2.0497804, 12.465593, 1.7354451, 1.6837482, +3.3238521, 1.8210249, 2.4158126, 1.4641288, 5.8759019, 1.7924392, +3.3382138, 1.5844876, 1.9313206, 2.0497804, 1.5737584, 1.7569546, +4.9311859, 5.4172767, 1.5373353, 17.5695461, 1.691123, 1.581612, +1.4671157, 2.0497804, 1.9287116, 3.2631537, 1.704246, 2.0746076, +3.2942899, 1.8399751, 7.3206442, 7.3206442, 1.5762152, 4.8560981, +1.5422753, 13.6207906, 1.7569546, 1.6398243, 2.0363777, 21.9619327, +1.7990264, 2.4524158, 2.6691069, 2.0241464, 1.7247438, 1.6438638, +1.9619327, 4.6266471, 1.4641288, 3.9632504, 5.5638521, 4.3923865, +3.6403133, 1.6778917, 1.4494876, 263.250366, 2.5007321, 1.8257687, +9.8828697, 2.1466179, 2.8702592, 6.3199136, 2.1234612, 2.9238653, +2.0363763, 1.7364568, 2.0497804, 1.9033675, 1.6105417, 1.7174231, +3.1294378, 2.0519575, 1.9675183, 2.102489, 3.2591508, 1.9985359, +5.4172767, 2.819836, 3.6970835, 2.045388, 2.6793558, 3.426224, +1.5885798, 4.2628712, 1.7558594, 1.9870059, 1.6619253, 7.61347, +1.7948785, 6.674817, 2.1859444, 3.8550512, 3.2210835, 2.1229868, +1.7602914, 2.041653, 3.7559385, 2.2421113, 1.7211127, 1.4641288, +4.7118917, 2.1538243, 3.8748126, 19.0702782, 1.8872621, 1.4641288, +1.536164, 2.5600659, 2.7997072, 2.0131772, 1.4641288, 6.3250366, +1.5673001, 2.1961933, 2.3352855, 2.1156662, 1.4695447, 5.4026354, +5.3147877, 2.8726208, 2.7818448, 2.5768214, 3.1010249, 1.4641288, +2.0497804, 1.9619327, 1.4641288, 2.6354319, 1.4641288, 5.8565154, +3.2942899, 2.5208565, 19.4729136, 1.8354627, 2.0497804, 2.7833089, +2.7818448, 1.7569546, 2.84041, 2.3308931, 1.7562254, 1.3145478, +2.4039712, 6.9156304, 1.4918768, 1.5323958, 1.8738611, 1.8152031, +8.2568807, 1.4102045, 2.2066252, 34.1415465, 2.4433106, 3.5943696, +2.3722149, 3.6697248, 6.8884535, 1.802097, 1.4416776, 9.1743119, +2.0969856, 2.8145478, 1.684903, 2.0996068, 2.621232, 1.3761468, +1.6644823, 2.3591088, 4.1364875, 1.3943958, 1.802097, 1.819135, +1.5137615, 3.0807733, 20.9698558, 4.1939712, 1.8616435, 2.4967235, +2.2137811, 5.242464, 1.3222543, 8.5517693, 1.965924, 12.8951507, +1.7889908, 2.176827, 8.7776278, 1.8152031, 1.6831402, 3.6435125, +1.6133683, 1.4678899, 1.4056042, 3.1208034, 1.5981809, 3.8007864, +1.5100891, 1.5727392, 1.8300524, 2.621232, 2.806481, 1.3577982, +1.6186107, 1.965924, 3.0222805, 56.225426, 4.9803408, 1.9871625, +1.965924, 2.7112923, 1.9003932, 1.72346, 1.5727392, 1.7038008, +3.0196592, 1.8348624, 1.4193971, 4.3905636, 7.8636959, 1.5727392, +1.3366134, 1.7038008, 2.6356225, 1.8647182, 1.4577549, 7.5583224, +2.0313971, 1.3499345, 1.4748624, 5.1114024, 5.242464, 1.4416776, +3.9361389, 4.0629096, 1.3761468, 1.6841415, 1.4406199, 1.3645491, +1.5727392, 2.185422, 3.281346, 1.3631009, 2.1231979, 2.6343381, +2.0982962, 3.4343526, 1.4787955, 2.621232, 3.0013106, 1.4297339, +10.2228047, 2.5793958, 1.7553591, 1.473405, 1.9528178, 1.7798689, +1.9868624, 1.9397117, 1.6759004, 1.5727392, 2.5249017, 14.6788991, +3.034076, 1.9790301, 5.9377588, 1.4416776, 2.621232, 2.0380079, +3.7549148, 2.4377457, 1.7020315, 7.1098702, 2.0196592, 1.8504902, +1.4159502, 7.6933159, 3.0144168, 2.3591088, 1.5923159, 1.3892529, +1.3329685, 1.423329, 2.9775714, 1.3873552, 1.4049803, 2.621232, +4.2791612, 1.6055046, 2.0117955, 2.2673657, 1.4646501, 3.3740655, +1.4907995, 2.0969856, 1.5701664, 1.3761468, 3.1454784, 8.4537353, +3.0332831, 2.0642202, 6.4220183, 1.8987877, 1.4901704, 50.0655308, +1.559633, 1.965924, 1.8000524, 2.4246396, 1.310616, 1.6120577, +4.2211653, 1.2604043, 1.4036932, 1.2972652, 1.9274923, 1.9154578, +1.2074518, 5.6985826, 1.902497, 1.1891344, 10.1780238, 1.6020797, +4.1617122, 2.3630499, 1.965044, 1.9459822, 2.8537455, 1.20244, +10.8204518, 1.5887634, 2.0963496, 5.469679, 1.8929845, 2.0332937, +1.6052319, 1.4030916, 1.1950059, 3.2461356, 1.2631225, 2.9726516, +1.2049501, 1.8812735, 1.783591, 3.9239001, 1.902497, 1.6646849, +4.4528252, 1.3236207, 1.6052319, 24.9702735, 2.7348395, 1.783591, +1.8109394, 2.1141498, 1.391201, 1.3460166, 1.5073841, 1.9404875, +2.5697979, 1.5807658, 1.4875149, 1.5219976, 1.6908442, 1.783591, +1.2588656, 1.5737479, 1.4673008, 2.7137051, 2.7360285, 1.4565993, +2.1374316, 2.4790904, 2.3781213, 4.6373365, 1.1890606, 1.5457788, +2.3424495, 2.3376932, 1.3971463, 4.2211653, 1.6399524, 1.2187872, +3.686088, 2.4970273, 2.4970273, 5.2318668, 1.3079667, 1.2681249, +2.1652794, 4.6401926, 2.9726516, 1.6646849, 1.1890606, 11.8906064, +2.8656361, 1.2443674, 1.7241379, 5.6956005, 1.3595696, 7.0749108, +1.4034756, 1.4024185, 1.3198573, 4.3205886, 1.843044, 1.4149822, +1.4863258, 4.9460321, 1.9131986, 20.0499405, 1.4365077, 5.5077289, +3.2104637, 1.3993282, 5.0017348, 3.4482759, 3.5564804, 1.3575684, +2.1315113, 1.8418858, 1.4268728, 2.4175981, 1.2521546, 1.8997027, +1.5591831, 1.2492533, 1.9032414, 1.6052319, 2.2296587, 1.2128419, +3.4482759, 1.2432675, 1.674931, 1.353151, 1.7875446, 2.0368609, +1.9738407, 1.6409037, 2.9099322, 2.5509584, 1.8073722, 4.0025779, +1.4268728, 0.9512485, 2.3431118, 1.3888228, 4.1736029, 1.2785375, +3.5588585, 1.2001498, 1.5512342, 1.6996195, 65.7074911, 27.2625945, +15.9262782, 1.279497, 3.0984411, 2.9469619, 1.2247325, 1.6646849, +1.3196017, 1.5165993, 1.2732307, 1.6646849, 1.3079667, 5.469679, +1.2485137, 1.9868252, 1.4268728, 1.4268728, 2.1640904, 2.1403092, +1.3079667, 1.4983841, 1.6884661, 1.8399489, 4.3757432, 1.786692, +1.6559441, 1.1890606, 3.8507598, 4.1617122, 2.1403092, 2.1403092, +2.6159334, 4.1617122, 22.2582259, 2.2592152, 4.2806183, 1.3062473, +5.588585, 2.7942925, 1.4416018, 1.3496463, 1.5650723, 1.1123471, +2.8101635, 1.7834527, 2.1286986, 4.349277, 2.7107898, 1.134594, +2.6236863, 2.3937709, 6.2347052, 1.378198, 1.2169077, 1.163515, +2.4594071, 4.727475, 1.5572859, 1.3070078, 3.1434928, 1.1971079, +1.1679644, 1.1123471, 1.7797553, 1.6474027, 1.7236919, 5.5617353, +1.3348165, 0.862069, 1.4460512, 1.3348165, 1.5906563, 1.1123471, +3.032436, 3.7864294, 2.2246941, 2.4471635, 10.0111235, 1.1635473, +1.1123471, 3.1528632, 3.7263626, 4.4493882, 2.2812636, 3.5595106, +4.4493882, 1.2091212, 1.1568409, 2.2246941, 1.240267, 1.1592558, +1.6685206, 3.3370412, 10.0723026, 2.1412681, 1.4749722, 1.1123471, +1.6896552, 1.6685206, 1.6173526, 1.1123471, 2.1690768, 1.4938821, +1.4082314, 2.5027809, 2.2580645, 3.7263626, 1.8936997, 1.7041157, +2.3428543, 1.9466073, 1.2791991, 1.5106963, 2.4471635, 3.6751947, +2.3782414, 1.7741935, 1.5151279, 2.2347052, 1.8164627, 3.4482759, +4.6718576, 1.1568409, 1.2235818, 4.0789299, 1.192436, 1.2040934, +2.5583982, 1.618465, 1.8220245, 1.610564, 1.8609566, 7.9920701, +1.785317, 4.894327, 2.5205784, 1.3948832, 1.3904338, 1.2971791, +3.6707453, 3.8765295, 3.5873192, 1.4379544, 1.1752748, 1.5016685, +1.5060033, 5.9254727, 12.6318131, 3.0611791, 1.43604, 2.2791991, +1.4917664, 6.9165539, 1.6042291, 1.6685206, 1.1572113, 1.320356, +3.4482759, 1.975762, 1.8565072, 2.0022247, 5.3005039, 4.0044494, +1.1244683, 1.546495, 2.5583982, 1.4791657, 1.2593993, 3.1979978, +3.1145717, 1.3125695, 5.67297, 13.3481646, 11.4315907, 4.2591769, +3.3668265, 1.1123471, 1.1123471, 1.4460512, 2.0731146, 1.2235818, +1.6129032, 1.3192436, 1.1290323, 2.3359288, 1.7241379, 11.1234705, +1.6685206, 1.5572859, 1.5572859, 1.9333115, 1.7241379, 1.5016685, +2.2074346, 1.0471204, 1.4253613, 1.3612565, 9.3141361, 1.6448901, +2.617801, 2.541112, 1.5706806, 1.2565445, 1.4586387, 1.0471204, +2.2314136, 2.1989529, 5.026178, 2.408377, 1.652178, 1.1518325, +1.3196838, 2.7015707, 2.5445026, 2.3560209, 1.2565445, 1.6753927, +1.3612565, 3.8743456, 1.7696335, 1.1183246, 2.2094241, 1.0984293, +1.1518325, 2.9637497, 11.6230366, 14.2931937, 1.2879581, 1.4659686, +13.6230366, 1.1298429, 2.4031414, 5.4450262, 1.046911, 1.0591623, +2.0942408, 1.8554974, 1.5706806, 1.9371728, 2.2031414, 2.460733, +1.4276168, 1.7350785, 4.0837696, 2.1570681, 1.4659686, 1.1685864, +1.2251309, 1.1518325, 3.7696335, 1.0950524, 1.2041885, 2.617801, +1.8712042, 4.3979058, 4.6073298, 18.6464838, 1.0471204, 1.0471204, +1.0471204, 15.8115183, 1.9895288, 1.0471204, 1.2565445, 1.1518325, +1.0732984, 1.1944209, 1.0643613, 1.3842932, 1.1308901, 1.1518325, +1.7937173, 1.1413613, 1.6329058, 2.6439791, 1.2868963, 4.4502618, +1.2366492, 1.9591623, 1.1910503, 1.3144335, 1.9895288, 1.6495707, +2.7225131, 1.1324209, 1.7801047, 1.6073298, 0.9897749, 1.2041885, +1.0732984, 1.0994764, 1.4062827, 1.965445, 3.3631906, 1.5706806, +1.2565445, 2.7624408, 1.0664859, 1.3779508, 1.3002534, 1.3193717, +3.4031414, 1.3612565, 1.1780105, 4.2931937, 4.808377, 1.0994764, +2.2198953, 2.617801, 1.4344963, 1.0471204, 2.513089, 1.6214597, +19.1623037, 1.5706806, 2.3036649, 1.845555, 1.0471204, 1.9895288, +2.8272251, 1.2565445, 3.9790576, 1.3612565, 1.6335079, 0.9424084, +18.8481675, 1.1256545, 5.305578, 1.7277487, 1.1653424, 1.1518325, +1.2565445, 3.5685864, 7.2356021, 1.5706806, 7.6439791, 2.1220031, +2.9319372, 1.2879581, 1.0680073, 1.2756147, 1.6230366, 2.6701571, +1.2565445, 1.1030482, 1.2041885, 1.1518325, 1.8848168, 7.539267, +1.0994764, 1.5706806, 2.6701571, 1.1518325, 3.8743456, 5.026178, +1.7801047, 4.7643979, 1.1518325, 1.5, 1.251, 1.03, 1.05, 1.9, +1.1, 1.88175, 1.007, 1.63, 1.025, 1.007274, 3.5, 2.9, 2.463137, +4.625, 1.03, 1.4, 1.077075, 1.32, 2.6, 1.08, 1.517, 1.07, 2.256823, +1.788413, 1.278896, 4.609074, 3.183, 1.2, 2.743, 3, 1.008938, +1.004084, 1.85, 1.520994, 1.250089, 1, 1.956, 1.05, 2.779, 22.137567, +1.445, 1.0051, 1, 1, 16.3, 1.11, 1.475, 1.049873, 1.753542, 6.143355, +1.23, 1.939, 46.5, 1.241472, 3.4, 1, 6.2, 1.966237, 2.17, 1.296, +1.555, 1.15, 1.33, 4.124285, 1.394239, 4.761228, 4.868852, 4, +1.6, 7.085, 1.765054, 6.306654, 1.25, 1.2, 1.226412, 6.563, 4.17, +2.68, 1.075, 1.932957, 1.375, 1.25, 3.38, 1.3801, 2.283, 2.35, +3.15, 3.35, 4, 10.5, 2.89, 5.5, 2.8, 1.26, 1.1, 2.126759, 2.2, +1.07, 9.2, 1.5, 1.65, 12.225, 1.4, 14.239, 1.085, 1.05, 2.65, +2.123, 5.2, 1.825, 1.1, 1, 2.065, 1.2774, 1.195, 1.2, 1.1, 1.4, +1.585, 3.265042, 1.2, 2.433, 1.6, 2, 4.76, 1.165, 1.372, 1.2, +1.65, 1.7, 1.3, 1.1, 1.1, 1.241012, 1.005, 3.282, 1.05, 57.410636, +1.088, 1.118, 2.67, 1.0749, 2.141, 5.85, 14.3, 1.971, 1.7, 6.167, +1.05, 1.156058, 3.58215, 13.5, 1.2015, 1.65, 1.3776, 3.8, 1.3255, +4.05, 6.7, 1.16, 1.5, 1.06, 1.491287, 1.981813, 1.5, 3.21436, +4.1, 1, 10.7, 19.4, 1.605603, 1.132, 2.255, 2.02, 1.231, 4.1, +7.23, 1.85, 1, 2.56, 1.553, 1.7, 1.045472, 1.054, 1, 8.71, 1.5, +1.5, 1.26106, 1.055, 1.282, 1.3, 1.3, 1.422078, 1, 1.2, 1.85, +1.18, 1.043, 1, 1.6, 5.6, 1.8, 2.5, 1.75, 1.45, 1.460945, 1.1571842, +1.495757, 5.2073288, 3.683703, 1.4464802, 1.0386577, 1.2536162, +1.0607522, 1.3982642, 1.3982642, 2.4108004, 1.4418515, 1.6393443, +1.0506268, 1.7550627, 0.9643202, 4.4840887, 0.9643202, 1.6779171, +1.0607522, 1, 3.0829315, 1.2777242, 1.2073288, 1.9286403, 1.002893, +1.0896818, 1.7581292, 1.4464802, 1.5911283, 1.1089682, 1.0231099, +2.0009643, 1.3143105, 0.9726905, 2.0684667, 3.0858245, 6.7984571, +1.6393443, 1.6393443, 1.2295082, 1.7357763, 2.8234166, 2.5072324, +1.8667396, 4.4358727, 1.9286403, 1.0607522, 1.7414658, 3.0858245, +12.0540019, 1.1571842, 2.4108004, 1.5583414, 0.9643202, 1.3500482, +3.1822565, 1.9006635, 2.3143684, 3.707811, 3.2063645, 1.0607522, +0.9643202, 1.4464802, 1.1571842, 5.2073288, 3.6644166, 1.6592285, +2.5072324, 0.9903568, 3.1918997, 16.4416586, 1.0829315, 2.4108004, +3.6692478, 1.1812922, 29.0260366, 4.9180328, 1.1485053, 1.5429122, +1.5670203, 1.2536162, 1.5429122, 1.8322083, 1.6634523, 1.2777242, +2.4435892, 2.8929605, 3.1340405, 2.6036644, 3.7897782, 1.9026037, +3.7704388, 1.1668274, 1.1890067, 0.9643202, 1.3211186, 1.7357763, +12.536162, 1.3211186, 1.1571842, 5.7859209, 1.8322083, 1.3889797, +1.2054002, 1.1089682, 1.7293578, 0.313404, 1.6393443, 1.087648, +1.5429122, 1.4320154, 2.1697203, 5.4001929, 0.9739634, 5.7859209, +1.3500482, 6.075217, 0.9643202, 18.3220829, 1.1571842, 0.9643202, +1.5911283, 1.9286403, 1.4464802, 1.6779171, 1.1571842, 1.0109981, +2.8447445, 1.7357763, 1.1504339, 2.5072324, 2.8929605, 2.0973963, +2.0864995, 0.9884282, 1.4464802, 0.9643202, 2.1502893, 1.1220926, +1.6586307, 1.6972035, 1.5911283, 5.7859209, 1.0559306, 1.4464802, +2.8929605, 1.1571842, 1.12054, 1.1571842, 1.2033751, 5.5930569, +1.4329797, 1.2643202, 1.3992285, 0.9643202, 1.147704, 1.2382343, +1.7598843, 1.5429122, 2.1215043, 1.5429122, 1.2536162, 1.9286403, +1.3307618, 0.9990357, 1.9286403, 1.1089682, 2.0250723, 8.6788814, +0.9836066, 2.2179364, 1.3018322, 1.1238968, 1.7275796, 1.3741562, +1.0069576, 8.1002893, 1.002893, 1.171649, 0.9643202, 10.2700096, +1.2713954, 2.8929605, 3.3452324, 1.0607522, 2.8929605, 1.1215043, +1.6972035, 1.7164899, 1.1024108, 17.0684667, 2.6036644, 1.2536162, +3.5679846, 1.4946962, 1.6393443, 1.7222758, 2.3510125, 1.6875603, +1.4705882, 2.3143684, 1.2536162, 1.1444291, 1.2054002, 2.6027001, +2.9417936, 2.1812922, 1.4464802, 4.8216008, 3.8379942, 1.3500482, +1.5429122, 1.1571842, 1.9286403, 2.2420444, 1.2632594, 1.0125362, +1.9286403, 0.9643202, 1.1378978, 1.0376085, 1.2536162, 2.1875603, +4.7672951, 1.5429122, 1.0607522, 2.7521697, 3.1822565, 1.4464802, +1.9286403, 1.5911283, 3.0858245, 4.0983607, 1.8804243, 2.4108004, +1.0125362, 1.9286403, 1.0607522, 0.9643202, 1.6393443, 1.1282546, +1.4464802, 1.4464802, 2.8929605, 1.388621, 1.6393443, 2.0221794, +1.7051591, 1.051109, 17.7434908, 1.1571842, 3.8572806, 1.7051591, +1.3500482, 5.4966249, 1.0231911, 1.3042672, 1.0667904, 1.8089054, +3.2467532, 1.4174397, 0.974026, 2.4907236, 1.0111317, 2.971243, +0.9276438, 3.0046382, 0.9461967, 0.9276438, 1.4202226, 2.2337662, +1.3979592, 2.3191095, 2.8525046, 1.9944341, 1.742115, 1.6465677, +2.9730983, 1.1131725, 1.4842301, 1.1131725, 1.1493506, 3.1846011, +2.2263451, 3.8961039, 1.4378479, 2.3682746, 1.0213358, 1.0204082, +2.7365492, 23.283859, 1.3914657, 1.3914657, 2.0408163, 1.0204082, +2.1530612, 0.9628942, 1.0667904, 1.3914657, 1.4591837, 4.9907236, +1.0575139, 4.1280148, 0.9833024, 1.0769944, 1.5027829, 1.0213358, +4.5, 3.1076067, 2.2541744, 1.757885, 1.3988868, 0.9461967, 1.2523191, +4.4981447, 2.4118738, 2.1057514, 3.1883117, 3.6846011, 1.5769944, +1.6512059, 2.5231911, 1.6697588, 1.9044527, 1.8552876, 1.6233766, +0.9434137, 1.8552876, 2.3191095, 1.4378479, 0.9443414, 3.0380334, +1.2569573, 1.244898, 3.8961039, 1.1131725, 1.2801484, 6.5862709, +0.9276438, 1.0853432, 1.606679, 1.2987013, 1.7625232, 1.1131725, +1.2504638, 1.2356215, 1.1131725, 0.932282, 0.9944341, 4.8237477, +2.4257885, 3.1474954, 1.6187384, 1.5213358, 1.8552876, 7.1428571, +0.9276438, 1.2170686, 1.1131725, 0.974026, 1.5769944, 1.6233766, +1.7625232, 1.3914657, 1.1595547, 0.974026, 11.1317254, 1.1131725, +1.8552876, 1.6697588, 12.5231911, 2.0408163, 0.974026, 5.7513915, +0.9276438, 5.5658627, 5.7513915, 1.1131725, 4.174397, 8.812616, +3.7801484, 32.4675325, 0.974026, 2.0871985, 3.2931354, 3.3395176, +1.390538, 1.6233766, 4.4526902, 1.0538033, 1.3914657, 0.9276438, +1.3914657, 1.6697588, 1.690167, 0.9573284, 1.3172542, 0.9276438, +4.406308, 1.3914657, 2.1335807, 0.9424861, 1.2059369, 1.3636364, +2.3979592, 3.2467532, 1.0695733, 0.9564007, 2.8756957, 1.0204082, +1.1131725, 0.9406308, 0.974026, 1.8163265, 1.3562152, 1.4842301, +2.7829314, 1.6141002, 0.932282, 29.0371058, 18.5528757, 2.5046382, +3.0612245, 1.1641929, 1.1131725, 1.3636364, 0.9703154, 1.0760668, +1.5120594, 1.8478664, 16.8831169, 1.3914657, 0.9619666, 1.9016698, +1.4489796, 1.7680891, 1.0204082, 1.5797774, 0.9758813, 0.9276438, +1.2059369, 0.9833024, 0.974026, 1.5166976, 1.0204082, 0.9276438, +1.8552876, 1.2059369, 1.0204082, 0.9350649, 1.2244898, 1.0046382, +7.7922078, 1.3497217, 0.9925789, 27.8293135, 4.174397, 5.8998145, +1.0064935, 1.5074212, 1.2059369, 1.1131725, 12.0593692, 2.3191095, +3.3395176, 1.1595547, 2.3729128, 1.096475, 1.1048237, 1.2523191, +3.6502783, 1.3914657, 1.2987013, 6.3079777, 9.4619666, 2.8756957, +1.6836735, 3.4814471, 7.606679, 0.9276438, 1.3914657, 0.9276438, +3.8961039, 1.1252319, 11.5955473, 3.0769944, 2.1150278, 1.8552876, +1.7569573, 1.4842301, 3.0612245, 1.5769944, 0.9276438, 0.974026, +1.7346939, 0.9879406, 1.7625232, 1.2894249, 1.4684601, 5.1948052, +1.9480519, 4.1187384, 4.9628942, 5.1020408, 0.9276438, 1.3450835, +1.0751391, 7.1011132, 2.0705009, 0.9276438, 2.4118738, 1.2374768, +2.0408163, 1.2987013, 2.8942486, 1.0667904, 0.9285714, 1.3914657, +1.5306122, 1.0482375, 1.1781076, 0.974026, 1.3450835, 2.0408163, +0.9276438, 1.6697588, 1.6184561, 1.0275067, 0.931677, 16.4152618, +1.5084295, 0.8873114, 0.9760426, 1.6858917, 1.3309672, 2.3070098, +1.920142, 3.7710736, 0.8873114, 1.1535049, 5.094055, 0.9387755, +2.9565217, 1.7985803, 1.552795, 1.3309672, 1.8873114, 1.7746229, +1.3309672, 6.0159716, 3.2617569, 0.9405501, 1.1668146, 2.5208518, +0.9405501, 1.2937001, 18.4241349, 0.6876664, 1.0647737, 1.9556344, +2.0408163, 7.985803, 3.4968944, 0.971606, 6.5110914, 1.2599823, +1.8535936, 1.552795, 0.9591837, 1.2670807, 2.1295475, 2.7062999, +1.552795, 1.3309672, 1.4676131, 2.3070098, 0.931677, 1.9077196, +0.9689441, 1.242236, 0.9103815, 0.8961846, 1.2111801, 1.9964508, +38.1543922, 2.1295475, 2.484472, 1.6903283, 1.7657498, 1.538598, +1.6858917, 1.242236, 0.8873114, 0.8873114, 1.3309672, 1.9822538, +1.863354, 0.8873114, 1.8855368, 5.2102928, 1.1535049, 1.7888199, +0.9671695, 0.8961846, 5.7675244, 1.3309672, 0.8873114, 6.8322981, +1.3620231, 0.945874, 0.9760426, 3.5492458, 1.3753327, 2.3070098, +0.931677, 0.8873114, 2.6619343, 0.931677, 7.5421473, 5.6814552, +9.228039, 0.931677, 1.0807453, 1.6122449, 1.242236, 1.3566992, +1.5084295, 2.3070098, 1.3753327, 0.9263531, 1.552795, 0.9724933, +27.3380657, 1.2377995, 0.8873114, 1.1925466, 0.9840284, 1.2777285, +0.8873114, 1.3309672, 7.5421473, 2.2236025, 1.1535049, 0.9405501, +1.7879326, 1.4374445, 6.1401952, 1.6166815, 2.094055, 11.8012422, +0.9405501, 2.9724933, 1.9520852, 2.4880213, 3.9929015, 2.2227152, +25.2883762, 2.4401065, 3.7267081, 3.7524401, 0.8873114, 1.6415262, +1.242236, 0.8873114, 0.8873114, 1.242236, 4.4365572, 0.9432121, +0.9041704, 1.0647737, 1.1978705, 2.3957409, 10.2040816, 0.931677, +0.9760426, 1.7746229, 2.3203194, 2.3070098, 1.0878438, 1.1428571, +1.1535049, 1.8669033, 2.484472, 0.9157054, 0.905945, 2.5732032, +0.8873114, 1.1215617, 5.9893523, 2.5093168, 0.9973381, 1.3283052, +1.0452529, 1.3877551, 0.9148181, 1.1535049, 1.2866016, 1.0470275, +4.6140195, 20.4525288, 2.2182786, 5.3238687, 0.9405501, 1.216504, +7.0984916, 0.931677, 1.3309672, 1.7746229, 0.8873114, 3.0124224, +0.9645075, 0.9813665, 47.0195209, 1.1002662, 2.3096717, 1.1455191, +1.3762201, 1.1428571, 2.8961846, 1.7746229, 0.8873114, 1.3540373, +24.5785271, 2.2617569, 4.4365572, 1.3487134, 0.9822538, 15.8828749, +1.0204082, 0.9405501, 1.2626442, 2.6619343, 0.9760426, 1.0514641, +1.9520852, 0.9050577, 1.3575865, 0.9538598, 1.6415262, 7.5421473, +2.2182786, 5.501331, 2.2111801, 1.4773736, 0.9574091, 1.6415262, +1.0204082, 0.9503106, 3.2830524, 0.9139308, 25.9538598, 1.0647737, +0.9148181, 0.9937888, 4.0816327, 2.2883762, 0.931677, 0.9503106, +0.9449867, 1.1002662, 2.8385093, 3.1943212, 0.931677, 1.5971606, +0.891748, 0.7054126, 1.7746229, 0.9840284, 1.7213842, 0.9094942, +2.3336291, 4.4942325, 8.8731145, 2.6761313, 0.8873114, 1.1472937, +1.3309672, 1.5084295, 1.242236, 1.1091393, 0.9094942, 6.2111801, +1.7302573, 1.1535049, 0.9370009, 1.0559006, 1.8793256, 1.4019521, +0.7542147, 0.8873114, 0.9760426, 1.4196983, 2.715173, 4.0816327, +1.7524401, 0.931677, 1.0887311, 3.5492458, 1.2830524, 2.173913, +2.8393966, 3.3717835, 1.3309672, 0.4436557, 4.6140195, 10.8251996, +5.7675244, 1.1091393, 31.0559006, 0.891748, 3.1055901, 1.3309672, +0.9849157, 1.6858917, 3.9929015, 0.9937888, 0.8970719, 1.8408129, +1.2828112, 5.3767993, 0.8839966, 1.361558, 1.0584251, 1.003387, +2.9635902, 1.2709568, 1.9051651, 4.2337003, 1.9475021, 2.9110923, +0.8890771, 24.5554615, 1.2277731, 1.2193057, 3.2684166, 4.8264183, +1.6596105, 0.8467401, 1.2142252, 0.8704488, 1.0160881, 1.5232854, +2.684166, 0.9314141, 1.5622354, 0.9390347, 1.1210838, 0.9424217, +1.0143946, 42.0914479, 1.6934801, 1.6401355, 1.9475021, 4.6570703, +1.0584251, 0.9339543, 1.1160034, 1.5241321, 1.3920406, 1.2277731, +0.8467401, 0.9314141, 14.3945809, 1.130398, 1.7442845, 1.9475021, +0.9017782, 1.1854361, 0.9822185, 2.5656224, 1.1481795, 0.9822185, +2.1761219, 1.3310754, 20.8636749, 1.8941575, 2.1168501, 1.6511431, +1.0584251, 9.2294666, 0.8679086, 1.1430991, 0.9102456, 5.9271804, +1.1981372, 1.7747671, 1.8755292, 5.6646909, 1.1007621, 0.9923793, +4.1490262, 0.9314141, 1.2836579, 1.0584251, 2.2015241, 1.2895851, +1.3547841, 4.4165961, 0.8467401, 1.2701101, 14.3945809, 2.6867062, +1.6934801, 1.6240474, 3.3869602, 4.0643522, 1.3014395, 1.2701101, +1.553768, 1.4767146, 1.1896698, 0.9906859, 1.0160881, 10.1371719, +2.6629975, 1.045724, 0.8890771, 3.8103302, 1.2701101, 1.6934801, +1.4817951, 0.8975445, 1.5241321, 2.9635902, 1.1812024, 1.5656224, +3.0482642, 3.3378493, 1.4572396, 1.0160881, 4.3014395, 0.8890771, +0.381033, 0.876376, 0.9314141, 2.0321761, 4.0220152, 1.1219306, +0.9889924, 1.8797629, 0.9060119, 2.2015241, 0.8721423, 1.2701101, +0.8806097, 1.7341236, 0.938188, 1.1685013, 6.7739204, 1.1769687, +4.5004234, 2.2133785, 1.0160881, 1.8628281, 2.2015241, 0.918713, +0.8628281, 0.9356478, 1.2193057, 5.7154953, 6.4352244, 5.5038103, +2.5402202, 5.0804403, 5.0804403, 0.8467401, 0.9906859, 0.8975445, +2.0321761, 4.0914479, 0.9390347, 1.9017782, 0.8950042, 4.8264183, +2.1320914, 1.5698561, 0.9026249, 1.2531753, 0.8890771, 0.8467401, +0.8806097, 1.2701101, 3.0990686, 1.9102456, 0.9339543, 1.2955123, +2.5402202, 2.4877223, 2.2861981, 1.4055885, 1.1024555, 1.0160881, +0.9314141, 3.8526672, 12.8018628, 1.6088061, 1.5241321, 1.9729043, +1.2701101, 1.784928, 16.088061, 1.4394581, 152.4132091, 1.4394581, +3.130398, 6.2870449, 2.7773074, 1.0330229, 1.0160881, 14.0135478, +0.8467401, 1.2701101, 0.9060119, 1.215072, 0.9847587, 8.3674852, +1.0584251, 1.1176969, 3.8103302, 1.1007621, 0.9652837, 1.5207451, +0.869602, 0.9263336, 1.4877223, 3.3869602, 4.6570703, 0.8467401, +2.2777307, 1.0414903, 1.1769687, 1.5241321, 1.2887384, 1.2701101, +3.7739204, 0.9314141, 1.1981372, 2.3522439, 1.0668925, 1.0668925, +9.3988146, 1.2701101, 0.8467401, 5.7705334, 1.0499577, 1.5368332, +0.8467401, 0.9695174, 1.0838273, 0.9314141, 1.8797629, 1.2785775, +1.3547841, 3.9796782, 5.2497883, 1.5656224, 12.7011008, 0.9314141, +4.5723963, 2.9212532, 1.7781541, 1.5241321, 11.6850127, 2.1168501, +0.9906859, 1.7332769, 2.5402202, 1.1761219, 0.8467401, 6.0118544, +32.3878069, 10.5842506, 1.6426757, 3.3869602, 0.895851, 1.0160881, +4.8687553, 1.5283658, 1.1007621, 0.8467401, 1.0795936, 0.9314141, +1.6934801, 18.6282811, 1.7315834, 3.8103302, 1.1007621, 1.8374259, +1.0160881, 0.9822185, 4.6570703, 1.3149873, 1.5241321, 2.2861981, +0.8467401, 1.0160881, 1.8856901, 1.3116003, 1.2277731, 1.1007621, +3.3869602, 0.9017782, 1.6342083, 1.0135478, 1.726503, 3.8103302, +2.4563929, 2.6867062, 0.8467401, 1.003387, 1.0152413, 0.8679086, +1.8628281, 1.0838273, 2.1168501, 4.1490262, 1.0160881, 0.9314141, +1.0160881, 1.1769687, 0.9686469, 0.9447195, 1.8770627, 0.8539604, +0.9158416, 1.2681518, 1.3564356, 7.4257426, 1.1344884, 1.3292079, +0.990099, 1.2871287, 1.5651815, 0.8457096, 1.0726073, 2.310231, +1.0940594, 2.6171617, 1.990099, 1.9876238, 0.8316832, 0.9075908, +0.6023102, 1.1559406, 0.8745875, 3.3787129, 1.2169967, 1.9513201, +4.1254125, 1.4026403, 1.0264026, 0.8465347, 1.7079208, 1.2376238, +3.30033, 0.9067657, 0.8250825, 0.9240924, 1.2788779, 2.9810231, +4.0759076, 3.7128713, 0.8712871, 1.2376238, 0.8374587, 1.0313531, +1.4546205, 0.8622112, 0.879538, 0.9653465, 0.990099, 1.689769, +2.3679868, 3.4653465, 1.2376238, 1.0643564, 1.4232673, 1.4851485, +2.4752475, 1.7367987, 0.990099, 0.8250825, 10.9983498, 1.0849835, +0.9942244, 0.8547855, 1.1551155, 1.2582508, 1.8976898, 1.0066007, +1.1089109, 0.9727723, 1.0313531, 1.320132, 1.9026403, 8.2508251, +1.0948845, 0.9282178, 0.9075908, 2.8877888, 2.3028053, 0.8663366, +1.7359736, 0.8927393, 3.2178218, 0.9570957, 0.8250825, 1.0849835, +0.8910891, 0.8844884, 0.9447195, 0.8910891, 1.4851485, 2.4991749, +4.8679868, 0.8622112, 1.1056106, 12.3762376, 1.7466997, 0.8663366, +0.9405941, 0.9356436, 3.5891089, 0.9117162, 1.0214521, 3.4653465, +4.5379538, 5.1980198, 2.6757426, 0.8919142, 0.8250825, 1.2755776, +1.650165, 3.30033, 1.320132, 0.990099, 0.8844884, 0.8333333, +1.4851485, 2.5330033, 3.8556106, 0.8415842, 0.8910891, 1.2087459, +0.8374587, 1.290429, 2.8052805, 1.2656766, 5.6122112, 1.4438944, +2.1039604, 0.8745875, 0.919967, 0.8787129, 2.4752475, 0.8663366, +1.8151815, 1.4950495, 2.0429043, 1.0709571, 1.2376238, 0.8333333, +0.9653465, 2.0627063, 1.0173267, 1.650165, 15.2846535, 2.2937294, +1.0726073, 4.5379538, 0.8250825, 1.2376238, 0.8580858, 0.8250825, +10.1848185, 0.9727723, 1.6641914, 0.8993399, 2.310231, 6.3729373, +0.870462, 0.849835, 1.4108911, 1.1146865, 1.870462, 0.8250825, +2.0627063, 1.0684818, 1.6707921, 0.8663366, 1.3184818, 0.9282178, +1.1155116, 2.0627063, 1.0726073, 4.290429, 0.8457096, 2.9826733, +1.0214521, 8.0858086, 3.1765677, 1.6542904, 1.2656766, 1.0816832, +1.0841584, 2.8052805, 2.1633663, 1.2788779, 0.9075908, 1.3209571, +1.3391089, 1.4834984, 1.8226073, 6.200495, 0.990099, 13.2013201, +4.3143564, 2.4075908, 1.3646865, 0.8663366, 0.8250825, 1.0057756, +0.8663366, 2.1452145, 1.9018152, 1.4612211, 20.8267327, 5.9405941, +2.7227723, 2.7623762, 0.9612211, 1.0272277, 0.9950495, 1.1419142, +1.6460396, 1.7706271, 0.8663366, 4.1254125, 1.980198, 1.320132, +1.0066007, 8.2508251, 0.8910891, 1.1138614, 0.990099, 1.650165, +0.9158416, 1.2665016, 1.5536304, 4.0841584, 1.4488449, 0.849835, +14.8514851, 0.8250825, 0.8919142, 1.5965347, 0.8910891, 3.8778878, +0.8605611, 2.0214521, 1.650165, 0.8250825, 0.9653465, 0.9653465, +1.0107261, 1.4851485, 0.8712871, 1.2788779, 0.990099, 1.0231023, +4.7029703, 3.1353135, 1.8646865, 2.0379538, 2.1452145, 1.1551155, +1.0561056, 144.6575908, 0.880363, 0.919967, 0.9282178, 28.630363, +19.2656766, 5.5280528, 1.5429043, 4.620462, 1.0726073, 3.7128713, +1.0140264, 0.8250825, 0.9579208, 1.1138614, 0.8828383, 0.8663366, +0.9191419, 0.9983498, 2.339934, 1.9389439, 0.990099, 1.2376238, +3.0528053, 1.4092409, 2.5536304, 0.8250825, 0.990099, 5.7755776, +1.1344884, 3.4075908, 1.0726073, 1.1674917, 0.8745875, 0.990099, +1.0726073, 1.2706271, 0.9661716, 1.4727723, 1.0363036, 1.650165, +1.6782178, 2.640264, 1.6014851, 17.7392739, 0.8663366, 4.3729373, +1.3613861, 1.1839934, 0.9282178, 2.970297, 1.0231023, 0.9075908, +1.130363, 3.0115512, 1.4026403, 0.9075908, 0.9752475, 0.8745875, +2.3226073, 1.1155116, 1.6914191, 1.2376238, 1.1146865, 0.9735974, +1.4026403, 4.8679868, 1.0726073, 4.1254125) diff --git a/benchmark/stan/bugs_examples/vol3/fire/fire.data.json b/benchmark/stan/bugs_examples/vol3/fire/fire.data.json new file mode 100644 index 000000000..335f69bb1 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/fire/fire.data.json @@ -0,0 +1,4 @@ +{ + "x": [1.6837482, 2.0937042, 1.7325813, 1.779754, 4.6120059, 8.7252738, 7.8989751, 2.2080454, 1.4860908, 2.7961713, 7.3206442, 3.3674963, 1.4641288, 1.7222225, 11.374817, 2.4827394, 26.2146413, 2.0024305, 4.5300146, 1.8417526, 3.806735, 14.1220761, 5.4242533, 11.7130307, 1.5153734, 2.5385886, 2.0497804, 12.465593, 1.7354451, 1.6837482, 3.3238521, 1.8210249, 2.4158126, 1.4641288, 5.8759019, 1.7924392, 3.3382138, 1.5844876, 1.9313206, 2.0497804, 1.5737584, 1.7569546, 4.9311859, 5.4172767, 1.5373353, 17.5695461, 1.691123, 1.581612, 1.4671157, 2.0497804, 1.9287116, 3.2631537, 1.704246, 2.0746076, 3.2942899, 1.8399751, 7.3206442, 7.3206442, 1.5762152, 4.8560981, 1.5422753, 13.6207906, 1.7569546, 1.6398243, 2.0363777, 21.9619327, 1.7990264, 2.4524158, 2.6691069, 2.0241464, 1.7247438, 1.6438638, 1.9619327, 4.6266471, 1.4641288, 3.9632504, 5.5638521, 4.3923865, 3.6403133, 1.6778917, 1.4494876, 263.250366, 2.5007321, 1.8257687, 9.8828697, 2.1466179, 2.8702592, 6.3199136, 2.1234612, 2.9238653, 2.0363763, 1.7364568, 2.0497804, 1.9033675, 1.6105417, 1.7174231, 3.1294378, 2.0519575, 1.9675183, 2.102489, 3.2591508, 1.9985359, 5.4172767, 2.819836, 3.6970835, 2.045388, 2.6793558, 3.426224, 1.5885798, 4.2628712, 1.7558594, 1.9870059, 1.6619253, 7.61347, 1.7948785, 6.674817, 2.1859444, 3.8550512, 3.2210835, 2.1229868, 1.7602914, 2.041653, 3.7559385, 2.2421113, 1.7211127, 1.4641288, 4.7118917, 2.1538243, 3.8748126, 19.0702782, 1.8872621, 1.4641288, 1.536164, 2.5600659, 2.7997072, 2.0131772, 1.4641288, 6.3250366, 1.5673001, 2.1961933, 2.3352855, 2.1156662, 1.4695447, 5.4026354, 5.3147877, 2.8726208, 2.7818448, 2.5768214, 3.1010249, 1.4641288, 2.0497804, 1.9619327, 1.4641288, 2.6354319, 1.4641288, 5.8565154, 3.2942899, 2.5208565, 19.4729136, 1.8354627, 2.0497804, 2.7833089, 2.7818448, 1.7569546, 2.84041, 2.3308931, 1.7562254, 1.3145478, 2.4039712, 6.9156304, 1.4918768, 1.5323958, 1.8738611, 1.8152031, 8.2568807, 1.4102045, 2.2066252, 34.1415465, 2.4433106, 3.5943696, 2.3722149, 3.6697248, 6.8884535, 1.802097, 1.4416776, 9.1743119, 2.0969856, 2.8145478, 1.684903, 2.0996068, 2.621232, 1.3761468, 1.6644823, 2.3591088, 4.1364875, 1.3943958, 1.802097, 1.819135, 1.5137615, 3.0807733, 20.9698558, 4.1939712, 1.8616435, 2.4967235, 2.2137811, 5.242464, 1.3222543, 8.5517693, 1.965924, 12.8951507, 1.7889908, 2.176827, 8.7776278, 1.8152031, 1.6831402, 3.6435125, 1.6133683, 1.4678899, 1.4056042, 3.1208034, 1.5981809, 3.8007864, 1.5100891, 1.5727392, 1.8300524, 2.621232, 2.806481, 1.3577982, 1.6186107, 1.965924, 3.0222805, 56.225426, 4.9803408, 1.9871625, 1.965924, 2.7112923, 1.9003932, 1.72346, 1.5727392, 1.7038008, 3.0196592, 1.8348624, 1.4193971, 4.3905636, 7.8636959, 1.5727392, 1.3366134, 1.7038008, 2.6356225, 1.8647182, 1.4577549, 7.5583224, 2.0313971, 1.3499345, 1.4748624, 5.1114024, 5.242464, 1.4416776, 3.9361389, 4.0629096, 1.3761468, 1.6841415, 1.4406199, 1.3645491, 1.5727392, 2.185422, 3.281346, 1.3631009, 2.1231979, 2.6343381, 2.0982962, 3.4343526, 1.4787955, 2.621232, 3.0013106, 1.4297339, 10.2228047, 2.5793958, 1.7553591, 1.473405, 1.9528178, 1.7798689, 1.9868624, 1.9397117, 1.6759004, 1.5727392, 2.5249017, 14.6788991, 3.034076, 1.9790301, 5.9377588, 1.4416776, 2.621232, 2.0380079, 3.7549148, 2.4377457, 1.7020315, 7.1098702, 2.0196592, 1.8504902, 1.4159502, 7.6933159, 3.0144168, 2.3591088, 1.5923159, 1.3892529, 1.3329685, 1.423329, 2.9775714, 1.3873552, 1.4049803, 2.621232, 4.2791612, 1.6055046, 2.0117955, 2.2673657, 1.4646501, 3.3740655, 1.4907995, 2.0969856, 1.5701664, 1.3761468, 3.1454784, 8.4537353, 3.0332831, 2.0642202, 6.4220183, 1.8987877, 1.4901704, 50.0655308, 1.559633, 1.965924, 1.8000524, 2.4246396, 1.310616, 1.6120577, 4.2211653, 1.2604043, 1.4036932, 1.2972652, 1.9274923, 1.9154578, 1.2074518, 5.6985826, 1.902497, 1.1891344, 10.1780238, 1.6020797, 4.1617122, 2.3630499, 1.965044, 1.9459822, 2.8537455, 1.20244, 10.8204518, 1.5887634, 2.0963496, 5.469679, 1.8929845, 2.0332937, 1.6052319, 1.4030916, 1.1950059, 3.2461356, 1.2631225, 2.9726516, 1.2049501, 1.8812735, 1.783591, 3.9239001, 1.902497, 1.6646849, 4.4528252, 1.3236207, 1.6052319, 24.9702735, 2.7348395, 1.783591, 1.8109394, 2.1141498, 1.391201, 1.3460166, 1.5073841, 1.9404875, 2.5697979, 1.5807658, 1.4875149, 1.5219976, 1.6908442, 1.783591, 1.2588656, 1.5737479, 1.4673008, 2.7137051, 2.7360285, 1.4565993, 2.1374316, 2.4790904, 2.3781213, 4.6373365, 1.1890606, 1.5457788, 2.3424495, 2.3376932, 1.3971463, 4.2211653, 1.6399524, 1.2187872, 3.686088, 2.4970273, 2.4970273, 5.2318668, 1.3079667, 1.2681249, 2.1652794, 4.6401926, 2.9726516, 1.6646849, 1.1890606, 11.8906064, 2.8656361, 1.2443674, 1.7241379, 5.6956005, 1.3595696, 7.0749108, 1.4034756, 1.4024185, 1.3198573, 4.3205886, 1.843044, 1.4149822, 1.4863258, 4.9460321, 1.9131986, 20.0499405, 1.4365077, 5.5077289, 3.2104637, 1.3993282, 5.0017348, 3.4482759, 3.5564804, 1.3575684, 2.1315113, 1.8418858, 1.4268728, 2.4175981, 1.2521546, 1.8997027, 1.5591831, 1.2492533, 1.9032414, 1.6052319, 2.2296587, 1.2128419, 3.4482759, 1.2432675, 1.674931, 1.353151, 1.7875446, 2.0368609, 1.9738407, 1.6409037, 2.9099322, 2.5509584, 1.8073722, 4.0025779, 1.4268728, 0.9512485, 2.3431118, 1.3888228, 4.1736029, 1.2785375, 3.5588585, 1.2001498, 1.5512342, 1.6996195, 65.7074911, 27.2625945, 15.9262782, 1.279497, 3.0984411, 2.9469619, 1.2247325, 1.6646849, 1.3196017, 1.5165993, 1.2732307, 1.6646849, 1.3079667, 5.469679, 1.2485137, 1.9868252, 1.4268728, 1.4268728, 2.1640904, 2.1403092, 1.3079667, 1.4983841, 1.6884661, 1.8399489, 4.3757432, 1.786692, 1.6559441, 1.1890606, 3.8507598, 4.1617122, 2.1403092, 2.1403092, 2.6159334, 4.1617122, 22.2582259, 2.2592152, 4.2806183, 1.3062473, 5.588585, 2.7942925, 1.4416018, 1.3496463, 1.5650723, 1.1123471, 2.8101635, 1.7834527, 2.1286986, 4.349277, 2.7107898, 1.134594, 2.6236863, 2.3937709, 6.2347052, 1.378198, 1.2169077, 1.163515, 2.4594071, 4.727475, 1.5572859, 1.3070078, 3.1434928, 1.1971079, 1.1679644, 1.1123471, 1.7797553, 1.6474027, 1.7236919, 5.5617353, 1.3348165, 0.862069, 1.4460512, 1.3348165, 1.5906563, 1.1123471, 3.032436, 3.7864294, 2.2246941, 2.4471635, 10.0111235, 1.1635473, 1.1123471, 3.1528632, 3.7263626, 4.4493882, 2.2812636, 3.5595106, 4.4493882, 1.2091212, 1.1568409, 2.2246941, 1.240267, 1.1592558, 1.6685206, 3.3370412, 10.0723026, 2.1412681, 1.4749722, 1.1123471, 1.6896552, 1.6685206, 1.6173526, 1.1123471, 2.1690768, 1.4938821, 1.4082314, 2.5027809, 2.2580645, 3.7263626, 1.8936997, 1.7041157, 2.3428543, 1.9466073, 1.2791991, 1.5106963, 2.4471635, 3.6751947, 2.3782414, 1.7741935, 1.5151279, 2.2347052, 1.8164627, 3.4482759, 4.6718576, 1.1568409, 1.2235818, 4.0789299, 1.192436, 1.2040934, 2.5583982, 1.618465, 1.8220245, 1.610564, 1.8609566, 7.9920701, 1.785317, 4.894327, 2.5205784, 1.3948832, 1.3904338, 1.2971791, 3.6707453, 3.8765295, 3.5873192, 1.4379544, 1.1752748, 1.5016685, 1.5060033, 5.9254727, 12.6318131, 3.0611791, 1.43604, 2.2791991, 1.4917664, 6.9165539, 1.6042291, 1.6685206, 1.1572113, 1.320356, 3.4482759, 1.975762, 1.8565072, 2.0022247, 5.3005039, 4.0044494, 1.1244683, 1.546495, 2.5583982, 1.4791657, 1.2593993, 3.1979978, 3.1145717, 1.3125695, 5.67297, 13.3481646, 11.4315907, 4.2591769, 3.3668265, 1.1123471, 1.1123471, 1.4460512, 2.0731146, 1.2235818, 1.6129032, 1.3192436, 1.1290323, 2.3359288, 1.7241379, 11.1234705, 1.6685206, 1.5572859, 1.5572859, 1.9333115, 1.7241379, 1.5016685, 2.2074346, 1.0471204, 1.4253613, 1.3612565, 9.3141361, 1.6448901, 2.617801, 2.541112, 1.5706806, 1.2565445, 1.4586387, 1.0471204, 2.2314136, 2.1989529, 5.026178, 2.408377, 1.652178, 1.1518325, 1.3196838, 2.7015707, 2.5445026, 2.3560209, 1.2565445, 1.6753927, 1.3612565, 3.8743456, 1.7696335, 1.1183246, 2.2094241, 1.0984293, 1.1518325, 2.9637497, 11.6230366, 14.2931937, 1.2879581, 1.4659686, 13.6230366, 1.1298429, 2.4031414, 5.4450262, 1.046911, 1.0591623, 2.0942408, 1.8554974, 1.5706806, 1.9371728, 2.2031414, 2.460733, 1.4276168, 1.7350785, 4.0837696, 2.1570681, 1.4659686, 1.1685864, 1.2251309, 1.1518325, 3.7696335, 1.0950524, 1.2041885, 2.617801, 1.8712042, 4.3979058, 4.6073298, 18.6464838, 1.0471204, 1.0471204, 1.0471204, 15.8115183, 1.9895288, 1.0471204, 1.2565445, 1.1518325, 1.0732984, 1.1944209, 1.0643613, 1.3842932, 1.1308901, 1.1518325, 1.7937173, 1.1413613, 1.6329058, 2.6439791, 1.2868963, 4.4502618, 1.2366492, 1.9591623, 1.1910503, 1.3144335, 1.9895288, 1.6495707, 2.7225131, 1.1324209, 1.7801047, 1.6073298, 0.9897749, 1.2041885, 1.0732984, 1.0994764, 1.4062827, 1.965445, 3.3631906, 1.5706806, 1.2565445, 2.7624408, 1.0664859, 1.3779508, 1.3002534, 1.3193717, 3.4031414, 1.3612565, 1.1780105, 4.2931937, 4.808377, 1.0994764, 2.2198953, 2.617801, 1.4344963, 1.0471204, 2.513089, 1.6214597, 19.1623037, 1.5706806, 2.3036649, 1.845555, 1.0471204, 1.9895288, 2.8272251, 1.2565445, 3.9790576, 1.3612565, 1.6335079, 0.9424084, 18.8481675, 1.1256545, 5.305578, 1.7277487, 1.1653424, 1.1518325, 1.2565445, 3.5685864, 7.2356021, 1.5706806, 7.6439791, 2.1220031, 2.9319372, 1.2879581, 1.0680073, 1.2756147, 1.6230366, 2.6701571, 1.2565445, 1.1030482, 1.2041885, 1.1518325, 1.8848168, 7.539267, 1.0994764, 1.5706806, 2.6701571, 1.1518325, 3.8743456, 5.026178, 1.7801047, 4.7643979, 1.1518325, 1.5, 1.251, 1.03, 1.05, 1.9, 1.1, 1.88175, 1.007, 1.63, 1.025, 1.007274, 3.5, 2.9, 2.463137, 4.625, 1.03, 1.4, 1.077075, 1.32, 2.6, 1.08, 1.517, 1.07, 2.256823, 1.788413, 1.278896, 4.609074, 3.183, 1.2, 2.743, 3, 1.008938, 1.004084, 1.85, 1.520994, 1.250089, 1, 1.956, 1.05, 2.779, 22.137567, 1.445, 1.0051, 1, 1, 16.3, 1.11, 1.475, 1.049873, 1.753542, 6.143355, 1.23, 1.939, 46.5, 1.241472, 3.4, 1, 6.2, 1.966237, 2.17, 1.296, 1.555, 1.15, 1.33, 4.124285, 1.394239, 4.761228, 4.868852, 4, 1.6, 7.085, 1.765054, 6.306654, 1.25, 1.2, 1.226412, 6.563, 4.17, 2.68, 1.075, 1.932957, 1.375, 1.25, 3.38, 1.3801, 2.283, 2.35, 3.15, 3.35, 4, 10.5, 2.89, 5.5, 2.8, 1.26, 1.1, 2.126759, 2.2, 1.07, 9.2, 1.5, 1.65, 12.225, 1.4, 14.239, 1.085, 1.05, 2.65, 2.123, 5.2, 1.825, 1.1, 1, 2.065, 1.2774, 1.195, 1.2, 1.1, 1.4, 1.585, 3.265042, 1.2, 2.433, 1.6, 2, 4.76, 1.165, 1.372, 1.2, 1.65, 1.7, 1.3, 1.1, 1.1, 1.241012, 1.005, 3.282, 1.05, 57.410636, 1.088, 1.118, 2.67, 1.0749, 2.141, 5.85, 14.3, 1.971, 1.7, 6.167, 1.05, 1.156058, 3.58215, 13.5, 1.2015, 1.65, 1.3776, 3.8, 1.3255, 4.05, 6.7, 1.16, 1.5, 1.06, 1.491287, 1.981813, 1.5, 3.21436, 4.1, 1, 10.7, 19.4, 1.605603, 1.132, 2.255, 2.02, 1.231, 4.1, 7.23, 1.85, 1, 2.56, 1.553, 1.7, 1.045472, 1.054, 1, 8.71, 1.5, 1.5, 1.26106, 1.055, 1.282, 1.3, 1.3, 1.422078, 1, 1.2, 1.85, 1.18, 1.043, 1, 1.6, 5.6, 1.8, 2.5, 1.75, 1.45, 1.460945, 1.1571842, 1.495757, 5.2073288, 3.683703, 1.4464802, 1.0386577, 1.2536162, 1.0607522, 1.3982642, 1.3982642, 2.4108004, 1.4418515, 1.6393443, 1.0506268, 1.7550627, 0.9643202, 4.4840887, 0.9643202, 1.6779171, 1.0607522, 1, 3.0829315, 1.2777242, 1.2073288, 1.9286403, 1.002893, 1.0896818, 1.7581292, 1.4464802, 1.5911283, 1.1089682, 1.0231099, 2.0009643, 1.3143105, 0.9726905, 2.0684667, 3.0858245, 6.7984571, 1.6393443, 1.6393443, 1.2295082, 1.7357763, 2.8234166, 2.5072324, 1.8667396, 4.4358727, 1.9286403, 1.0607522, 1.7414658, 3.0858245, 12.0540019, 1.1571842, 2.4108004, 1.5583414, 0.9643202, 1.3500482, 3.1822565, 1.9006635, 2.3143684, 3.707811, 3.2063645, 1.0607522, 0.9643202, 1.4464802, 1.1571842, 5.2073288, 3.6644166, 1.6592285, 2.5072324, 0.9903568, 3.1918997, 16.4416586, 1.0829315, 2.4108004, 3.6692478, 1.1812922, 29.0260366, 4.9180328, 1.1485053, 1.5429122, 1.5670203, 1.2536162, 1.5429122, 1.8322083, 1.6634523, 1.2777242, 2.4435892, 2.8929605, 3.1340405, 2.6036644, 3.7897782, 1.9026037, 3.7704388, 1.1668274, 1.1890067, 0.9643202, 1.3211186, 1.7357763, 12.536162, 1.3211186, 1.1571842, 5.7859209, 1.8322083, 1.3889797, 1.2054002, 1.1089682, 1.7293578, 0.313404, 1.6393443, 1.087648, 1.5429122, 1.4320154, 2.1697203, 5.4001929, 0.9739634, 5.7859209, 1.3500482, 6.075217, 0.9643202, 18.3220829, 1.1571842, 0.9643202, 1.5911283, 1.9286403, 1.4464802, 1.6779171, 1.1571842, 1.0109981, 2.8447445, 1.7357763, 1.1504339, 2.5072324, 2.8929605, 2.0973963, 2.0864995, 0.9884282, 1.4464802, 0.9643202, 2.1502893, 1.1220926, 1.6586307, 1.6972035, 1.5911283, 5.7859209, 1.0559306, 1.4464802, 2.8929605, 1.1571842, 1.12054, 1.1571842, 1.2033751, 5.5930569, 1.4329797, 1.2643202, 1.3992285, 0.9643202, 1.147704, 1.2382343, 1.7598843, 1.5429122, 2.1215043, 1.5429122, 1.2536162, 1.9286403, 1.3307618, 0.9990357, 1.9286403, 1.1089682, 2.0250723, 8.6788814, 0.9836066, 2.2179364, 1.3018322, 1.1238968, 1.7275796, 1.3741562, 1.0069576, 8.1002893, 1.002893, 1.171649, 0.9643202, 10.2700096, 1.2713954, 2.8929605, 3.3452324, 1.0607522, 2.8929605, 1.1215043, 1.6972035, 1.7164899, 1.1024108, 17.0684667, 2.6036644, 1.2536162, 3.5679846, 1.4946962, 1.6393443, 1.7222758, 2.3510125, 1.6875603, 1.4705882, 2.3143684, 1.2536162, 1.1444291, 1.2054002, 2.6027001, 2.9417936, 2.1812922, 1.4464802, 4.8216008, 3.8379942, 1.3500482, 1.5429122, 1.1571842, 1.9286403, 2.2420444, 1.2632594, 1.0125362, 1.9286403, 0.9643202, 1.1378978, 1.0376085, 1.2536162, 2.1875603, 4.7672951, 1.5429122, 1.0607522, 2.7521697, 3.1822565, 1.4464802, 1.9286403, 1.5911283, 3.0858245, 4.0983607, 1.8804243, 2.4108004, 1.0125362, 1.9286403, 1.0607522, 0.9643202, 1.6393443, 1.1282546, 1.4464802, 1.4464802, 2.8929605, 1.388621, 1.6393443, 2.0221794, 1.7051591, 1.051109, 17.7434908, 1.1571842, 3.8572806, 1.7051591, 1.3500482, 5.4966249, 1.0231911, 1.3042672, 1.0667904, 1.8089054, 3.2467532, 1.4174397, 0.974026, 2.4907236, 1.0111317, 2.971243, 0.9276438, 3.0046382, 0.9461967, 0.9276438, 1.4202226, 2.2337662, 1.3979592, 2.3191095, 2.8525046, 1.9944341, 1.742115, 1.6465677, 2.9730983, 1.1131725, 1.4842301, 1.1131725, 1.1493506, 3.1846011, 2.2263451, 3.8961039, 1.4378479, 2.3682746, 1.0213358, 1.0204082, 2.7365492, 23.283859, 1.3914657, 1.3914657, 2.0408163, 1.0204082, 2.1530612, 0.9628942, 1.0667904, 1.3914657, 1.4591837, 4.9907236, 1.0575139, 4.1280148, 0.9833024, 1.0769944, 1.5027829, 1.0213358, 4.5, 3.1076067, 2.2541744, 1.757885, 1.3988868, 0.9461967, 1.2523191, 4.4981447, 2.4118738, 2.1057514, 3.1883117, 3.6846011, 1.5769944, 1.6512059, 2.5231911, 1.6697588, 1.9044527, 1.8552876, 1.6233766, 0.9434137, 1.8552876, 2.3191095, 1.4378479, 0.9443414, 3.0380334, 1.2569573, 1.244898, 3.8961039, 1.1131725, 1.2801484, 6.5862709, 0.9276438, 1.0853432, 1.606679, 1.2987013, 1.7625232, 1.1131725, 1.2504638, 1.2356215, 1.1131725, 0.932282, 0.9944341, 4.8237477, 2.4257885, 3.1474954, 1.6187384, 1.5213358, 1.8552876, 7.1428571, 0.9276438, 1.2170686, 1.1131725, 0.974026, 1.5769944, 1.6233766, 1.7625232, 1.3914657, 1.1595547, 0.974026, 11.1317254, 1.1131725, 1.8552876, 1.6697588, 12.5231911, 2.0408163, 0.974026, 5.7513915, 0.9276438, 5.5658627, 5.7513915, 1.1131725, 4.174397, 8.812616, 3.7801484, 32.4675325, 0.974026, 2.0871985, 3.2931354, 3.3395176, 1.390538, 1.6233766, 4.4526902, 1.0538033, 1.3914657, 0.9276438, 1.3914657, 1.6697588, 1.690167, 0.9573284, 1.3172542, 0.9276438, 4.406308, 1.3914657, 2.1335807, 0.9424861, 1.2059369, 1.3636364, 2.3979592, 3.2467532, 1.0695733, 0.9564007, 2.8756957, 1.0204082, 1.1131725, 0.9406308, 0.974026, 1.8163265, 1.3562152, 1.4842301, 2.7829314, 1.6141002, 0.932282, 29.0371058, 18.5528757, 2.5046382, 3.0612245, 1.1641929, 1.1131725, 1.3636364, 0.9703154, 1.0760668, 1.5120594, 1.8478664, 16.8831169, 1.3914657, 0.9619666, 1.9016698, 1.4489796, 1.7680891, 1.0204082, 1.5797774, 0.9758813, 0.9276438, 1.2059369, 0.9833024, 0.974026, 1.5166976, 1.0204082, 0.9276438, 1.8552876, 1.2059369, 1.0204082, 0.9350649, 1.2244898, 1.0046382, 7.7922078, 1.3497217, 0.9925789, 27.8293135, 4.174397, 5.8998145, 1.0064935, 1.5074212, 1.2059369, 1.1131725, 12.0593692, 2.3191095, 3.3395176, 1.1595547, 2.3729128, 1.096475, 1.1048237, 1.2523191, 3.6502783, 1.3914657, 1.2987013, 6.3079777, 9.4619666, 2.8756957, 1.6836735, 3.4814471, 7.606679, 0.9276438, 1.3914657, 0.9276438, 3.8961039, 1.1252319, 11.5955473, 3.0769944, 2.1150278, 1.8552876, 1.7569573, 1.4842301, 3.0612245, 1.5769944, 0.9276438, 0.974026, 1.7346939, 0.9879406, 1.7625232, 1.2894249, 1.4684601, 5.1948052, 1.9480519, 4.1187384, 4.9628942, 5.1020408, 0.9276438, 1.3450835, 1.0751391, 7.1011132, 2.0705009, 0.9276438, 2.4118738, 1.2374768, 2.0408163, 1.2987013, 2.8942486, 1.0667904, 0.9285714, 1.3914657, 1.5306122, 1.0482375, 1.1781076, 0.974026, 1.3450835, 2.0408163, 0.9276438, 1.6697588, 1.6184561, 1.0275067, 0.931677, 16.4152618, 1.5084295, 0.8873114, 0.9760426, 1.6858917, 1.3309672, 2.3070098, 1.920142, 3.7710736, 0.8873114, 1.1535049, 5.094055, 0.9387755, 2.9565217, 1.7985803, 1.552795, 1.3309672, 1.8873114, 1.7746229, 1.3309672, 6.0159716, 3.2617569, 0.9405501, 1.1668146, 2.5208518, 0.9405501, 1.2937001, 18.4241349, 0.6876664, 1.0647737, 1.9556344, 2.0408163, 7.985803, 3.4968944, 0.971606, 6.5110914, 1.2599823, 1.8535936, 1.552795, 0.9591837, 1.2670807, 2.1295475, 2.7062999, 1.552795, 1.3309672, 1.4676131, 2.3070098, 0.931677, 1.9077196, 0.9689441, 1.242236, 0.9103815, 0.8961846, 1.2111801, 1.9964508, 38.1543922, 2.1295475, 2.484472, 1.6903283, 1.7657498, 1.538598, 1.6858917, 1.242236, 0.8873114, 0.8873114, 1.3309672, 1.9822538, 1.863354, 0.8873114, 1.8855368, 5.2102928, 1.1535049, 1.7888199, 0.9671695, 0.8961846, 5.7675244, 1.3309672, 0.8873114, 6.8322981, 1.3620231, 0.945874, 0.9760426, 3.5492458, 1.3753327, 2.3070098, 0.931677, 0.8873114, 2.6619343, 0.931677, 7.5421473, 5.6814552, 9.228039, 0.931677, 1.0807453, 1.6122449, 1.242236, 1.3566992, 1.5084295, 2.3070098, 1.3753327, 0.9263531, 1.552795, 0.9724933, 27.3380657, 1.2377995, 0.8873114, 1.1925466, 0.9840284, 1.2777285, 0.8873114, 1.3309672, 7.5421473, 2.2236025, 1.1535049, 0.9405501, 1.7879326, 1.4374445, 6.1401952, 1.6166815, 2.094055, 11.8012422, 0.9405501, 2.9724933, 1.9520852, 2.4880213, 3.9929015, 2.2227152, 25.2883762, 2.4401065, 3.7267081, 3.7524401, 0.8873114, 1.6415262, 1.242236, 0.8873114, 0.8873114, 1.242236, 4.4365572, 0.9432121, 0.9041704, 1.0647737, 1.1978705, 2.3957409, 10.2040816, 0.931677, 0.9760426, 1.7746229, 2.3203194, 2.3070098, 1.0878438, 1.1428571, 1.1535049, 1.8669033, 2.484472, 0.9157054, 0.905945, 2.5732032, 0.8873114, 1.1215617, 5.9893523, 2.5093168, 0.9973381, 1.3283052, 1.0452529, 1.3877551, 0.9148181, 1.1535049, 1.2866016, 1.0470275, 4.6140195, 20.4525288, 2.2182786, 5.3238687, 0.9405501, 1.216504, 7.0984916, 0.931677, 1.3309672, 1.7746229, 0.8873114, 3.0124224, 0.9645075, 0.9813665, 47.0195209, 1.1002662, 2.3096717, 1.1455191, 1.3762201, 1.1428571, 2.8961846, 1.7746229, 0.8873114, 1.3540373, 24.5785271, 2.2617569, 4.4365572, 1.3487134, 0.9822538, 15.8828749, 1.0204082, 0.9405501, 1.2626442, 2.6619343, 0.9760426, 1.0514641, 1.9520852, 0.9050577, 1.3575865, 0.9538598, 1.6415262, 7.5421473, 2.2182786, 5.501331, 2.2111801, 1.4773736, 0.9574091, 1.6415262, 1.0204082, 0.9503106, 3.2830524, 0.9139308, 25.9538598, 1.0647737, 0.9148181, 0.9937888, 4.0816327, 2.2883762, 0.931677, 0.9503106, 0.9449867, 1.1002662, 2.8385093, 3.1943212, 0.931677, 1.5971606, 0.891748, 0.7054126, 1.7746229, 0.9840284, 1.7213842, 0.9094942, 2.3336291, 4.4942325, 8.8731145, 2.6761313, 0.8873114, 1.1472937, 1.3309672, 1.5084295, 1.242236, 1.1091393, 0.9094942, 6.2111801, 1.7302573, 1.1535049, 0.9370009, 1.0559006, 1.8793256, 1.4019521, 0.7542147, 0.8873114, 0.9760426, 1.4196983, 2.715173, 4.0816327, 1.7524401, 0.931677, 1.0887311, 3.5492458, 1.2830524, 2.173913, 2.8393966, 3.3717835, 1.3309672, 0.4436557, 4.6140195, 10.8251996, 5.7675244, 1.1091393, 31.0559006, 0.891748, 3.1055901, 1.3309672, 0.9849157, 1.6858917, 3.9929015, 0.9937888, 0.8970719, 1.8408129, 1.2828112, 5.3767993, 0.8839966, 1.361558, 1.0584251, 1.003387, 2.9635902, 1.2709568, 1.9051651, 4.2337003, 1.9475021, 2.9110923, 0.8890771, 24.5554615, 1.2277731, 1.2193057, 3.2684166, 4.8264183, 1.6596105, 0.8467401, 1.2142252, 0.8704488, 1.0160881, 1.5232854, 2.684166, 0.9314141, 1.5622354, 0.9390347, 1.1210838, 0.9424217, 1.0143946, 42.0914479, 1.6934801, 1.6401355, 1.9475021, 4.6570703, 1.0584251, 0.9339543, 1.1160034, 1.5241321, 1.3920406, 1.2277731, 0.8467401, 0.9314141, 14.3945809, 1.130398, 1.7442845, 1.9475021, 0.9017782, 1.1854361, 0.9822185, 2.5656224, 1.1481795, 0.9822185, 2.1761219, 1.3310754, 20.8636749, 1.8941575, 2.1168501, 1.6511431, 1.0584251, 9.2294666, 0.8679086, 1.1430991, 0.9102456, 5.9271804, 1.1981372, 1.7747671, 1.8755292, 5.6646909, 1.1007621, 0.9923793, 4.1490262, 0.9314141, 1.2836579, 1.0584251, 2.2015241, 1.2895851, 1.3547841, 4.4165961, 0.8467401, 1.2701101, 14.3945809, 2.6867062, 1.6934801, 1.6240474, 3.3869602, 4.0643522, 1.3014395, 1.2701101, 1.553768, 1.4767146, 1.1896698, 0.9906859, 1.0160881, 10.1371719, 2.6629975, 1.045724, 0.8890771, 3.8103302, 1.2701101, 1.6934801, 1.4817951, 0.8975445, 1.5241321, 2.9635902, 1.1812024, 1.5656224, 3.0482642, 3.3378493, 1.4572396, 1.0160881, 4.3014395, 0.8890771, 0.381033, 0.876376, 0.9314141, 2.0321761, 4.0220152, 1.1219306, 0.9889924, 1.8797629, 0.9060119, 2.2015241, 0.8721423, 1.2701101, 0.8806097, 1.7341236, 0.938188, 1.1685013, 6.7739204, 1.1769687, 4.5004234, 2.2133785, 1.0160881, 1.8628281, 2.2015241, 0.918713, 0.8628281, 0.9356478, 1.2193057, 5.7154953, 6.4352244, 5.5038103, 2.5402202, 5.0804403, 5.0804403, 0.8467401, 0.9906859, 0.8975445, 2.0321761, 4.0914479, 0.9390347, 1.9017782, 0.8950042, 4.8264183, 2.1320914, 1.5698561, 0.9026249, 1.2531753, 0.8890771, 0.8467401, 0.8806097, 1.2701101, 3.0990686, 1.9102456, 0.9339543, 1.2955123, 2.5402202, 2.4877223, 2.2861981, 1.4055885, 1.1024555, 1.0160881, 0.9314141, 3.8526672, 12.8018628, 1.6088061, 1.5241321, 1.9729043, 1.2701101, 1.784928, 16.088061, 1.4394581, 152.4132091, 1.4394581, 3.130398, 6.2870449, 2.7773074, 1.0330229, 1.0160881, 14.0135478, 0.8467401, 1.2701101, 0.9060119, 1.215072, 0.9847587, 8.3674852, 1.0584251, 1.1176969, 3.8103302, 1.1007621, 0.9652837, 1.5207451, 0.869602, 0.9263336, 1.4877223, 3.3869602, 4.6570703, 0.8467401, 2.2777307, 1.0414903, 1.1769687, 1.5241321, 1.2887384, 1.2701101, 3.7739204, 0.9314141, 1.1981372, 2.3522439, 1.0668925, 1.0668925, 9.3988146, 1.2701101, 0.8467401, 5.7705334, 1.0499577, 1.5368332, 0.8467401, 0.9695174, 1.0838273, 0.9314141, 1.8797629, 1.2785775, 1.3547841, 3.9796782, 5.2497883, 1.5656224, 12.7011008, 0.9314141, 4.5723963, 2.9212532, 1.7781541, 1.5241321, 11.6850127, 2.1168501, 0.9906859, 1.7332769, 2.5402202, 1.1761219, 0.8467401, 6.0118544, 32.3878069, 10.5842506, 1.6426757, 3.3869602, 0.895851, 1.0160881, 4.8687553, 1.5283658, 1.1007621, 0.8467401, 1.0795936, 0.9314141, 1.6934801, 18.6282811, 1.7315834, 3.8103302, 1.1007621, 1.8374259, 1.0160881, 0.9822185, 4.6570703, 1.3149873, 1.5241321, 2.2861981, 0.8467401, 1.0160881, 1.8856901, 1.3116003, 1.2277731, 1.1007621, 3.3869602, 0.9017782, 1.6342083, 1.0135478, 1.726503, 3.8103302, 2.4563929, 2.6867062, 0.8467401, 1.003387, 1.0152413, 0.8679086, 1.8628281, 1.0838273, 2.1168501, 4.1490262, 1.0160881, 0.9314141, 1.0160881, 1.1769687, 0.9686469, 0.9447195, 1.8770627, 0.8539604, 0.9158416, 1.2681518, 1.3564356, 7.4257426, 1.1344884, 1.3292079, 0.990099, 1.2871287, 1.5651815, 0.8457096, 1.0726073, 2.310231, 1.0940594, 2.6171617, 1.990099, 1.9876238, 0.8316832, 0.9075908, 0.6023102, 1.1559406, 0.8745875, 3.3787129, 1.2169967, 1.9513201, 4.1254125, 1.4026403, 1.0264026, 0.8465347, 1.7079208, 1.2376238, 3.30033, 0.9067657, 0.8250825, 0.9240924, 1.2788779, 2.9810231, 4.0759076, 3.7128713, 0.8712871, 1.2376238, 0.8374587, 1.0313531, 1.4546205, 0.8622112, 0.879538, 0.9653465, 0.990099, 1.689769, 2.3679868, 3.4653465, 1.2376238, 1.0643564, 1.4232673, 1.4851485, 2.4752475, 1.7367987, 0.990099, 0.8250825, 10.9983498, 1.0849835, 0.9942244, 0.8547855, 1.1551155, 1.2582508, 1.8976898, 1.0066007, 1.1089109, 0.9727723, 1.0313531, 1.320132, 1.9026403, 8.2508251, 1.0948845, 0.9282178, 0.9075908, 2.8877888, 2.3028053, 0.8663366, 1.7359736, 0.8927393, 3.2178218, 0.9570957, 0.8250825, 1.0849835, 0.8910891, 0.8844884, 0.9447195, 0.8910891, 1.4851485, 2.4991749, 4.8679868, 0.8622112, 1.1056106, 12.3762376, 1.7466997, 0.8663366, 0.9405941, 0.9356436, 3.5891089, 0.9117162, 1.0214521, 3.4653465, 4.5379538, 5.1980198, 2.6757426, 0.8919142, 0.8250825, 1.2755776, 1.650165, 3.30033, 1.320132, 0.990099, 0.8844884, 0.8333333, 1.4851485, 2.5330033, 3.8556106, 0.8415842, 0.8910891, 1.2087459, 0.8374587, 1.290429, 2.8052805, 1.2656766, 5.6122112, 1.4438944, 2.1039604, 0.8745875, 0.919967, 0.8787129, 2.4752475, 0.8663366, 1.8151815, 1.4950495, 2.0429043, 1.0709571, 1.2376238, 0.8333333, 0.9653465, 2.0627063, 1.0173267, 1.650165, 15.2846535, 2.2937294, 1.0726073, 4.5379538, 0.8250825, 1.2376238, 0.8580858, 0.8250825, 10.1848185, 0.9727723, 1.6641914, 0.8993399, 2.310231, 6.3729373, 0.870462, 0.849835, 1.4108911, 1.1146865, 1.870462, 0.8250825, 2.0627063, 1.0684818, 1.6707921, 0.8663366, 1.3184818, 0.9282178, 1.1155116, 2.0627063, 1.0726073, 4.290429, 0.8457096, 2.9826733, 1.0214521, 8.0858086, 3.1765677, 1.6542904, 1.2656766, 1.0816832, 1.0841584, 2.8052805, 2.1633663, 1.2788779, 0.9075908, 1.3209571, 1.3391089, 1.4834984, 1.8226073, 6.200495, 0.990099, 13.2013201, 4.3143564, 2.4075908, 1.3646865, 0.8663366, 0.8250825, 1.0057756, 0.8663366, 2.1452145, 1.9018152, 1.4612211, 20.8267327, 5.9405941, 2.7227723, 2.7623762, 0.9612211, 1.0272277, 0.9950495, 1.1419142, 1.6460396, 1.7706271, 0.8663366, 4.1254125, 1.980198, 1.320132, 1.0066007, 8.2508251, 0.8910891, 1.1138614, 0.990099, 1.650165, 0.9158416, 1.2665016, 1.5536304, 4.0841584, 1.4488449, 0.849835, 14.8514851, 0.8250825, 0.8919142, 1.5965347, 0.8910891, 3.8778878, 0.8605611, 2.0214521, 1.650165, 0.8250825, 0.9653465, 0.9653465, 1.0107261, 1.4851485, 0.8712871, 1.2788779, 0.990099, 1.0231023, 4.7029703, 3.1353135, 1.8646865, 2.0379538, 2.1452145, 1.1551155, 1.0561056, 144.6575908, 0.880363, 0.919967, 0.9282178, 28.630363, 19.2656766, 5.5280528, 1.5429043, 4.620462, 1.0726073, 3.7128713, 1.0140264, 0.8250825, 0.9579208, 1.1138614, 0.8828383, 0.8663366, 0.9191419, 0.9983498, 2.339934, 1.9389439, 0.990099, 1.2376238, 3.0528053, 1.4092409, 2.5536304, 0.8250825, 0.990099, 5.7755776, 1.1344884, 3.4075908, 1.0726073, 1.1674917, 0.8745875, 0.990099, 1.0726073, 1.2706271, 0.9661716, 1.4727723, 1.0363036, 1.650165, 1.6782178, 2.640264, 1.6014851, 17.7392739, 0.8663366, 4.3729373, 1.3613861, 1.1839934, 0.9282178, 2.970297, 1.0231023, 0.9075908, 1.130363, 3.0115512, 1.4026403, 0.9075908, 0.9752475, 0.8745875, 2.3226073, 1.1155116, 1.6914191, 1.2376238, 1.1146865, 0.9735974, 1.4026403, 4.8679868, 1.0726073, 4.1254125], + "N": 2492 +} diff --git a/benchmark/stan/bugs_examples/vol3/fire/fire.stan b/benchmark/stan/bugs_examples/vol3/fire/fire.stan new file mode 100644 index 000000000..5ce22615c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/fire/fire.stan @@ -0,0 +1,52 @@ +/** + * Fire: Fire insurance claims: data distribution incrementing log prob + * directly because the composite lognormal-pareto distribution + * is not built in. + * + * http://www.openbugs.net/Examples/Fire.html + * + * see D. P. M. Scollnik (2007) + * http://www.tandfonline.com/doi/pdf/10.1080/03461230601110447 + * + * the mixture used here is Equation (3.1) in the paper + * with smooth density function so r in (3.1) is given + * in Equation (3.4) + */ +data { + int N; + array[N] real x; +} +parameters { + real alpha; + real sigma; + real theta; +} +transformed parameters { + real mu = log(theta) - alpha * sigma * sigma; +} +model { + array[N] real lpa; + real tmp; + real log_tmp; + real neg_log1p_temp; + real log_Phi_alpha_times_sigma; + + theta ~ gamma(.001, .001); + alpha ~ gamma(.001, .001); + sigma ~ gamma(.001, .001); + + tmp = sqrt(2 * pi()) * alpha * sigma * Phi(alpha * sigma) + * exp(0.5 * pow(alpha * sigma, 2)); + log_tmp = log(tmp); + neg_log1p_temp = -log1p(tmp); + log_Phi_alpha_times_sigma = log(Phi(alpha * sigma)); + for (i in 1 : N) { + if (theta > x[i]) { + lpa[i] = log_tmp + neg_log1p_temp - log_Phi_alpha_times_sigma + + lognormal_lpdf(x[i] | mu, sigma); + } else { + lpa[i] = neg_log1p_temp + pareto_lpdf(x[i] | theta, alpha); + } + } + target += sum(lpa); +} diff --git a/benchmark/stan/bugs_examples/vol3/fire/makefile b/benchmark/stan/bugs_examples/vol3/fire/makefile new file mode 100644 index 000000000..f4ba917af --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/fire/makefile @@ -0,0 +1,15 @@ +STAN_HOME = ../../../../.. +PGM = fire# +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) --data=$(PGM).data.R + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol3/fire/post.R b/benchmark/stan/bugs_examples/vol3/fire/post.R new file mode 100644 index 000000000..e41108a2b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/fire/post.R @@ -0,0 +1,14 @@ + +# read the simulated student t samples +library(coda) +poinames <- c("alpha", "sigma", "theta", "mu") +post <- read.csv(file = "samples.csv", header = TRUE, comment.char = '#')[, poinames] + +summary(as.mcmc(post)) + + +## from http://www.openbugs.net/Examples/Fire.html +# mean sd MC_error val2.5pc median val97.5pc start sample +# alpha 1.328 0.03179 7.257E-4 1.267 1.328 1.392 1001 10000 +# sigma 0.1971 0.01209 5.755E-4 0.1745 0.1966 0.2219 1001 10000 +# theta 1.209 0.03123 0.001505 1.153 1.207 1.273 1001 10000 diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/circle.stan b/benchmark/stan/bugs_examples/vol3/funshapes/circle.stan new file mode 100644 index 000000000..553442ea9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/circle.stan @@ -0,0 +1,11 @@ +/* + * BUGS volume 3, fun shapes, circle + * http://www.openbugs.net/Examples/Funshapes.html + */ +parameters { + real x; + real y; +} +model { + /* uniform within constraints */ +} diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/hsquare.stan b/benchmark/stan/bugs_examples/vol3/funshapes/hsquare.stan new file mode 100644 index 000000000..e85f1591f --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/hsquare.stan @@ -0,0 +1,49 @@ +/* + * Hollow Square + * http://www.openbugs.net/Examples/Funshapes.html + * + * Transform a uniform rectangle + * 1234 + * 5678 + * 90AB + * to a uniform hollow square + * 1234 + * 5 6 + * 7 8 + * 90AB + */ +parameters { + real x_raw; + real y_raw; +} +model { + /* no-op; uniformity implied by parameter constraints */ +} +generated quantities { + real x; + real y; + if (y_raw > 1) { + // cases 1, 2, 3, 4 + x = x_raw - 1; + y = y_raw - 0.5; + } else if (y_raw < 0.5) { + // cases 9, 0, A, B + x = x_raw - 1; + y = y_raw - 1; + } else if (x_raw < 0.5) { + // case 5 + x = x_raw - 1; + y = y_raw - 0.5; + } else if (x_raw < 1.0) { + // case 6 + x = x_raw - 1.5; + y = y_raw - 1; + } else if (x_raw < 1.5) { + // case 7 + x = x_raw - 0.5; + y = y_raw - 0.5; + } else { + x = x_raw - 1.0; + y = y_raw - 1.0; + } +} diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/makefile b/benchmark/stan/bugs_examples/vol3/funshapes/makefile new file mode 100644 index 000000000..c6a3bc89b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/makefile @@ -0,0 +1,48 @@ +STAN_HOME = ../../../../.. +PGM = circle# +PGM2 = squaremc# +PGM3 = ring# +PGM4 = hsquare# +PGM5 = parallelogram# + +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +all : $(PGM) $(PGM2) $(PGM3) $(PGM4) $(PGM5) + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -Wall -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) sample + +$(PGM2) : + $(STAN_HOME)/bin/stanc --name=$(PGM2) $(PGM2).stan + $(CXX) -Wall -O3 -DNDEBUG $(CPPFLAGS) $(PGM2).cpp -o $(PGM2) $(LIBFLAGS) + ./$(PGM2) sample + +$(PGM3) : + $(STAN_HOME)/bin/stanc --name=$(PGM3) $(PGM3).stan + $(CXX) -Wall -O3 -DNDEBUG $(CPPFLAGS) $(PGM3).cpp -o $(PGM3) $(LIBFLAGS) + ./$(PGM3) sample + +$(PGM4) : + $(STAN_HOME)/bin/stanc --name=$(PGM4) $(PGM4).stan + $(CXX) -Wall -O3 -DNDEBUG $(CPPFLAGS) $(PGM4).cpp -o $(PGM4) $(LIBFLAGS) + ./$(PGM4) sample + +$(PGM5) : + $(STAN_HOME)/bin/stanc --name=$(PGM5) $(PGM5).stan + $(CXX) -Wall -O3 -DNDEBUG $(CPPFLAGS) $(PGM5).cpp -o $(PGM5) $(LIBFLAGS) + ./$(PGM5) sample + + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) + rm -f $(PGM2).cpp samples.csv $(PGM2) + rm -f $(PGM3).cpp samples.csv $(PGM3) + rm -f $(PGM4).cpp samples.csv $(PGM4) + rm -f $(PGM5).cpp samples.csv $(PGM5) diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/parallelogram.stan b/benchmark/stan/bugs_examples/vol3/funshapes/parallelogram.stan new file mode 100644 index 000000000..9c14db521 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/parallelogram.stan @@ -0,0 +1,15 @@ +/* + * BUGS Volume 3, funshapes, parallelogram + * http://www.openbugs.net/Examples/Funshapes.html + */ +parameters { + real x; + real y_raw; +} +transformed parameters { + real y; + y = y_raw - x; +} +model { + /* uniform within constraints */ +} diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/post.R b/benchmark/stan/bugs_examples/vol3/funshapes/post.R new file mode 100644 index 000000000..9aaf5932b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/post.R @@ -0,0 +1,5 @@ + +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#')[, c('x', 'y')] +plot(post) + + diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/ring.stan b/benchmark/stan/bugs_examples/vol3/funshapes/ring.stan new file mode 100644 index 000000000..8a7190499 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/ring.stan @@ -0,0 +1,15 @@ +// the original version not using transformation is in ring.stan.0 +parameters { + real z; + real phi; +} +model { + // p(z,phi) prop-to z + target += log(z); +} +generated quantities { + real x; + real y; + x = z * cos(phi); + y = z * sin(phi); +} diff --git a/benchmark/stan/bugs_examples/vol3/funshapes/squaremc.stan b/benchmark/stan/bugs_examples/vol3/funshapes/squaremc.stan new file mode 100644 index 000000000..c09acf7f7 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/funshapes/squaremc.stan @@ -0,0 +1,24 @@ +/* + * BUGS Volume 3, funshapes, square minus circle + * http://www.openbugs.net/Examples/Funshapes.html + * + * first draw raw samples from diamond-like shape reflected per + * quadrant, then reflect in transformed parameters + * + * unfortunate redundancy in 1-sqrt() term because we can't + * get local variables into parameter declarations + */ +parameters { + real x_raw; + real y_raw; +} +transformed parameters { + real x; + real y; + x = ((x_raw > 0) ? 1 : -1) - x_raw; + y = ((y_raw > 0) ? 1 : -1) - y_raw; +} +model { + target += log1m(sqrt(1 - square(1 - abs(x_raw)))); +} diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/data_reorg.R b/benchmark/stan/bugs_examples/vol3/hepatitis/data_reorg.R new file mode 100644 index 000000000..560022644 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/data_reorg.R @@ -0,0 +1,18 @@ +source('hepatitis.data.R') +# Yvec <- c(Y[, 1], Y[, 2], Y[, 3]) +Yvec <- as.vector(Y) +# tvec <- c(t[, 1], t[, 2], t[, 3]) +tvec <- as.vector(t) +idxn <- rep(1:N, T); + + +naidx <- which(is.na(Yvec)) + +Yvec1 <- Yvec[-naidx]; +idxn1 <- idxn[-naidx]; +tvec1 <- tvec[-naidx]; + +N1 <- length(Yvec1) + + +dump(c("N", "Yvec1", "idxn1", "tvec1", "N1", "y0"), file = 'hepatitis2.data.R'); diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.data.R b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.data.R new file mode 100644 index 000000000..734ee339d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.data.R @@ -0,0 +1,201 @@ +N <- +106 +Yvec1 <- +c(4.997, 6.83, 3.95124371858143, 6.79794041297493, 4.71849887129509, +5.78996017089725, 6.13122648948314, 6.76272950693188, 6.14846829591765, +10.7579879834538, 5.63121178182137, 3.46573590279973, 7.92479591395644, +9.16115012778541, 8.74257423767064, 5.91079664404053, 6.54678541076052, +2.94443897916644, 7.05272104923232, 0, 9.13905916997122, 8.48260174664662, +7.11963563801764, 7.64300363556072, 9.42294862137501, 8.2553088117856, +4.82028156560504, 6.54678541076052, 8.67470962929122, 7.86326672400957, +4.67282883446191, 7.41878088275079, 6.84587987526405, 5.46383180502561, +3.43398720448515, 7.7553388128465, 9.04239498112674, 8.45212119467252, +7.91425227874244, 7.72885582385254, 9.31433996199467, 6.35957386867238, +2.30258509299405, 8.29354951506035, 8.90082160491523, 8.87905466204227, +11.5129154649202, 8.79618763547045, 8.40155784781731, 8.89370997756851, +7.1800698743028, 4.82028156560504, 5.77765232322266, 6.4707995037826, +4.40671924726425, 8.17413934342947, 2.30258509299405, 9.77104128523582, +6.95081476844258, 5.97635090929793, 5.8805329864007, 5.73979291217923, +5.75574221358691, 5.15329159449778, 8.11761074646623, 8.54636356871602, +7.58171964012531, 6.9037472575846, 4.66343909411207, 7.47986413116503, +3.61091791264422, 4.64439089914137, 4.39444915467244, 8.23509549725836, +6.12905021006055, 8.4424696452203, 6.88755257166462, 7.29233717617388, +6.38856140554563, 8.75998249497728, 6.08677472691231, 4.02535169073515, +4.38202663467388, 6.85540879860993, 8.17919979842309, 4.24849524204936, +8.98343977178426, 8.4721958254855, 9.480214825778, 6.1463292576689, +9.93542217106647, 4.27666611901606, 5.36597601502185, 4.60517018598809, +3.2188758248682, 6.81783057145415, 6.58479139238572, 5.91889385427315, +8.67641669696422, 2.484906649788, 6.73933662735717, 3.91202300542815, +4.56434819146784, 9.15925758174687, 7.07326971745971, 9.08636319215647, +8.028, 4.905, 4.35670882668959, 5.27299955856375, 3.49650756146648, +3.68887945411394, 3.85014760171006, 3.29583686600433, 5.25749537202778, +10.4925789214972, 4.20469261939097, 1.79175946922805, 7.54750168281497, +8.34236350038058, 7.07580886397839, 5.11198778835654, 4.93447393313069, +3.17805383034795, 6.25382881157547, 7.19067603433221, 7.82724090175281, +7.51697722460432, 5.8348107370626, 6.35610766069589, 8.57073395834427, +7.16394668434255, 3.40119738166216, 5.95583736946483, 7.32383056620232, +7.63385355968177, 3.36729582998647, 6.76157276880406, 8.38845031552351, +9.9219166880045, 1.6094379124341, 7.44366368311559, 6.64768837356333, +6.85118492749374, 6.16961073249146, 9.75214127004149, 8.26359043261732, +5.84643877505772, 0, 7.60589000105312, 6.25958146406492, 8.88391747120797, +8.54286093816481, 7.86095636487639, 6.91075078796194, 7.59588991771854, +7.03174125876313, 2.99573227355399, 3.91202300542815, 5.4510384535657, +5.12989871492307, 7.88419993367604, 2.30258509299405, 9.32892308780313, +10.5472081164337, 5.71042701737487, 6.50128967054039, 5.53338948872752, +4.99043258677874, 3.61091791264422, 7.34729970074316, 8.03138533062553, +6.92264389147589, 6.7202201551353, 3.43398720448515, 6.19236248947487, +3.78418963391826, 4.51085950651685, 3.55534806148941, 7.81116338502528, +6.19847871649231, 3.55534806148941, 5.07517381523383, 7.25417784645652, +6.21460809842219, 7.19593722647557, 4.66343909411207, 3.78418963391826, +2.484906649788, 6.08221891037645, 6.04500531403601, 3.52636052461616, +9.69990150043745, 7.76004068088038, 7.78113850984502, 6.289715570909, +9.39806397805913, 5.34710753071747, 5.88887795833288, 5.29831736654804, +4.27666611901606, 3.46573590279973, 7.2152399787301, 5.68357976733868, +7.72179177681754, 1.38629436111989, 6.73221070646721, 5.4971682252932, +2.83321334405622, 8.58073121222023, 7.12608727329912, 7.9359451033537, +6.295, 4.31748811353631, 4.29045944114839, 3.43398720448515, +5.37527840768417, 3.49650756146648, 2.77258872223978, 6.40687998606931, +7.9483852851119, 6.3919171133926, 5.37989735354046, 5.86929691313377, +5.34233425196481, 4.45434729625351, 6.5424719605068, 6.89365635460264, +8.79026911147866, 7.46278915741245, 3.66356164612965, 4.99721227376411, +8.03040956213048, 7.16006920759613, 3.17805383034795, 6.31535800152233, +2.77258872223978, 7.82803803212583, 7.11151211649616, 7.01481435127554, +6.00881318544259, 9.59703032475801, 2.30258509299405, 10.1017644761202, +7.06561336359772, 8.97575663051942, 7.08757370555797, 7.22256601882217, +2.07944154167984, 2.70805020110221, 3.61091791264422, 3.85014760171006, +7.22766249872866, 0, 9.61767040669386, 8.66905554072548, 5.24174701505964, +5.48479693349065, 4.04305126783455, 6.55250788703459, 7.35115822643069, +6.52502965784346, 5.74939298590825, 3.09104245335832, 2.99573227355399, +3.29583686600433, 7.54855597916987, 4.81218435537242, 2.94443897916644, +5.03043792139244, 2.39789527279837, 2.94443897916644, 5.45958551414416, +3.58351893845611, 8.74097653801779, 5.87493073085203, 9.17294998275762, +3.46573590279973, 3.36729582998647, 3.58351893845611, 7.63867982387611, +5.90808293816893, 5.8171111599632, 6.19031540585315, 2.56494935746154, +4.51085950651685, 4.39444915467244, 5.01063529409626) +idxn1 <- +c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, +15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, +28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, +41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, +54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, +80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, +93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, +105, 106, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, +13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, +26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, +39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, +52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, +65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, +78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, +91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, +103, 104, 105, 106, 2, 4, 5, 6, 9, 11, 12, 13, 14, +15, 16, 17, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, +31, 33, 35, 36, 37, 38, 39, 40, 43, 44, 45, 47, 48, +49, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 65, +66, 67, 68, 69, 72, 73, 74, 75, 76, 79, 81, 82, 84, +86, 87, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, +101, 102, 105) +tvec1 <- +c(6.541, 5.8406416573734, 6.60123011872888, 5.8636311755981, +5.91350300563827, 5.91889385427315, 5.87493073085203, 5.82008293035236, +5.91350300563827, 5.98896141688986, 5.95064255258773, 5.75574221358691, +5.92157841964382, 5.93489419561959, 5.91350300563827, 5.97126183979046, +5.97126183979046, 6.59987049921284, 5.92157841964382, 6.71780469502369, +5.92958914338989, 5.92157841964382, 5.92157841964382, 5.92157841964382, +5.92157841964382, 5.8406416573734, 5.89440283426485, 5.93489419561959, +5.93224518744801, 5.96870755998537, 5.8805329864007, 6.62671774924902, +5.87773578177964, 6.59030104819669, 5.92958914338989, 5.92958914338989, +5.86078622346587, 5.89440283426485, 5.95064255258773, 5.93224518744801, +5.97126183979046, 6.57088296233958, 5.93753620508243, 5.87493073085203, +5.89164421182577, 6.74170069465205, 5.89440283426485, 5.94803498918065, +5.77455154554441, 5.97126183979046, 5.96870755998537, 5.8805329864007, +5.89440283426485, 6.62936325343745, 5.93224518744801, 5.99146454710798, +5.88887795833288, 5.93489419561959, 5.94017125272043, 5.95583736946483, +5.93489419561959, 5.92692602597041, 6.64639051484773, 5.93224518744801, +5.96870755998537, 5.93224518744801, 5.93224518744801, 5.93224518744801, +5.94542060860658, 5.86929691313377, 6.65801104587075, 5.89715386763674, +6.00881318544259, 5.97126183979046, 5.97126183979046, 5.97126183979046, +6.00881318544259, 6.64639051484773, 5.88610403145016, 5.75257263882563, +5.68017260901707, 5.77144112313002, 5.96100533962327, 5.75257263882563, +5.81413053182507, 5.63478960316925, 5.77455154554441, 5.77765232322266, +5.63121178182137, 5.70711026474888, 5.89164421182577, 5.77455154554441, +6.0591231955818, 5.8171111599632, 5.65248918026865, 5.60947179518496, +5.83773044716594, 5.91350300563827, 5.77455154554441, 5.83773044716594, +5.98645200528444, 5.8171111599632, 6.49526555593701, 5.68697535633982, +5.8171111599632, 5.85793315448346, 6.963, 6.52941883826223, 7.02553831463852, +6.51767127291227, 6.5694814204143, 6.5694814204143, 6.97447891102505, +6.56244409369372, 6.5510803350434, 7.0335064842877, 6.59987049921284, +6.65544035036765, 6.70686233660275, 6.63987583382654, 6.63987583382654, +6.55961523749324, 6.60123011872888, 7.00215595440362, 6.68959926917897, +6.98286275146894, 6.56807791141198, 6.71780469502369, 6.54821910276237, +6.54821910276237, 6.54821910276237, 6.54821910276237, 6.49072353450251, +6.70686233660275, 6.56103066589657, 6.52795791762255, 6.56244409369372, +6.94889722231331, 6.54965074223381, 7.00669522683704, 6.56807791141198, +6.56807791141198, 6.55819780281227, 6.59030104819669, 6.51767127291227, +6.70196036600254, 6.60934924316738, 7.01571242048723, 6.5206211275587, +6.56103066589657, 6.59030104819669, 6.98933526597456, 6.5410299991899, +6.5510803350434, 6.49828214947643, 6.54965074223381, 6.58892647753352, +6.59030104819669, 6.5410299991899, 6.98471632011826, 6.62007320653036, +6.63856778916652, 6.59441345974978, 6.61873898351722, 6.62140565176413, +6.62936325343745, 6.61873898351722, 6.61204103483309, 7.04403289727469, +6.62007320653036, 6.64639051484773, 6.64768837356333, 6.62007320653036, +6.62671774924902, 6.62140565176413, 6.5875500148248, 7.05875815251866, +6.59714570188665, 6.62936325343745, 6.66568371778241, 6.66440902035041, +6.66440902035041, 7.05185562295589, 7.04403289727469, 6.59167373200866, +6.96129604591017, 6.50876913697168, 6.56244409369372, 6.66695679242921, +6.49828214947643, 7.02108396428914, 6.46769872610435, 6.48768401848461, +6.52209279817015, 6.55535689181067, 6.45833828334479, 6.48920493132532, +6.48920493132532, 6.62671774924902, 6.49223983502047, 6.42162226780652, +6.44413125670044, 6.48616078894409, 6.52649485957079, 6.45047042214418, +6.48463523563525, 6.51025834052315, 6.48463523563525, 6.94215670569947, +6.47850964220857, 6.51174532964473, 6.92264389147589, 6.98193467715639, +6.96790920180188, 7.00850518208228, 7.00760061395185, 7.00306545878646, +7.00940893270864, 6.9555926083963, 6.98286275146894, 6.9782137426307, +6.9782137426307, 7.00124562206948, 7.00033446027523, 6.96224346426621, +6.98286275146894, 6.98193467715639, 6.98193467715639, 6.98100574072173, +6.98100574072173, 6.95654544315157, 7.00306545878646, 7.0335064842877, +6.94215670569947, 6.97728134163075, 6.98841318199959, 6.98193467715639, +6.98193467715639, 6.97447891102505, 6.98378996525813, 6.97447891102505, +6.97447891102505, 6.97073007814353, 6.97447891102505, 6.98378996525813, +6.98286275146894, 6.99668148817654, 6.95844839329766, 7.01481435127554, +6.98378996525813, 6.98286275146894, 7.03174125876313, 7.04053639021596, +7.02908756414966, 7.04577657687951, 7.05272104923232, 7.05272104923232, +7.04490511712937, 7.04141166379481, 7.03174125876313, 7.028201432058, +7.03174125876313, 7.02731451403978, 7.05272104923232, 7.03174125876313, +7.03966034986208, 7.03878354138854, 7.04403289727469, 7.04403289727469, +7.028201432058, 6.97541392745595, 6.99759598298193, 6.99025650049388, +6.95081476844258, 6.92067150424868, 6.91473089271856, 6.92165818415113, +6.92165818415113, 7.01391547481053, 6.94119005506837, 6.86380339145295, +6.92165818415113, 6.97447891102505, 6.92755790627832, 6.91869521902047, +6.96413561241824, 6.94793706861497, 6.93634273583405) +N1 <- +288 +y0 <- +c(8.613, 7.105, 6.896, 5.63835466933375, 6.35088571671474, 5.03043792139244, +5.8664680569333, 5.73979291217923, 7.07834157955767, 8.56655462095396, +6.86171134048073, 6.97354301952014, 7.34213173058472, 8.82629423124132, +6.48768401848461, 6.66440902035041, 7.0343879299155, 4.49980967033027, +6.85118492749374, 3.04452243772342, 8.63905677917308, 1.79175946922805, +7.01660968389422, 7.09090982207998, 7.42356844425917, 8.09620827165004, +5.70711026474888, 7.01031186730723, 7.18311170174328, 8.15219801586179, +5.99645208861902, 7.0825485693553, 5.06890420222023, 7.04228617193974, +4.0943445622221, 7.32052696227274, 7.12689080889881, 7.24136628332232, +6.62007320653036, 7.36897040219479, 8.47720418319987, 7.20340552108309, +2.89037175789616, 7.39141523467536, 6.25190388316589, 8.38160253710989, +11.5129154649202, 6.60258789218934, 7.61283103040736, 7.42476176182321, +6.71174039505618, 5.56068163101553, 6.0282785202307, 7.10085190894405, +7.52671756135271, 7.92948652331429, 1.6094379124341, 6.85856503479136, +8.05006542291597, 5.83188247728352, 7.15851399732932, 7.01481435127554, +7.70120018085745, 7.16239749735572, 5.99893656194668, 5.41610040220442, +8.40782465436087, 7.18462915271731, 3.25809653802148, 8.14380797677148, +5.24702407216049, 5.73979291217923, 4.55387689160054, 7.72444664563354, +7.91425227874244, 7.11476944836646, 8.24064886337491, 8.56044423341055, +6.78558764500793, 10.8861838116069, 2.07944154167984, 5.82894561761021, +4.0943445622221, 7.53208814354172, 5.66988092298052, 3.46573590279973, +10.7229148990064, 8.02910705461974, 9.23092700558457, 6.42971947803914, +11.5129154649202, 7.25700270709207, 6.62007320653036, 9.41995278900604, +5.28826703069454, 8.04654935728308, 7.58984151218266, 6.39024066706535, +6.04025471127741, 2.77258872223978, 7.62948991639399, 7.85476918349913, +7.09007683577609, 5.50125821054473, 6.98100574072173, 5.50533153593236 +) diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.data.json b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.data.json new file mode 100644 index 000000000..10d00bf04 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.data.json @@ -0,0 +1,8 @@ +{ + "Yvec1": [4.997, 6.83, 3.95124371858143, 6.79794041297493, 4.71849887129509, 5.78996017089725, 6.13122648948314, 6.76272950693188, 6.14846829591765, 10.7579879834538, 5.63121178182137, 3.46573590279973, 7.92479591395644, 9.16115012778541, 8.74257423767064, 5.91079664404053, 6.54678541076052, 2.94443897916644, 7.05272104923232, 0, 9.13905916997122, 8.48260174664662, 7.11963563801764, 7.64300363556072, 9.42294862137501, 8.2553088117856, 4.82028156560504, 6.54678541076052, 8.67470962929122, 7.86326672400957, 4.67282883446191, 7.41878088275079, 6.84587987526405, 5.46383180502561, 3.43398720448515, 7.7553388128465, 9.04239498112674, 8.45212119467252, 7.91425227874244, 7.72885582385254, 9.31433996199467, 6.35957386867238, 2.30258509299405, 8.29354951506035, 8.90082160491523, 8.87905466204227, 11.5129154649202, 8.79618763547045, 8.40155784781731, 8.89370997756851, 7.1800698743028, 4.82028156560504, 5.77765232322266, 6.4707995037826, 4.40671924726425, 8.17413934342947, 2.30258509299405, 9.77104128523582, 6.95081476844258, 5.97635090929793, 5.8805329864007, 5.73979291217923, 5.75574221358691, 5.15329159449778, 8.11761074646623, 8.54636356871602, 7.58171964012531, 6.9037472575846, 4.66343909411207, 7.47986413116503, 3.61091791264422, 4.64439089914137, 4.39444915467244, 8.23509549725836, 6.12905021006055, 8.4424696452203, 6.88755257166462, 7.29233717617388, 6.38856140554563, 8.75998249497728, 6.08677472691231, 4.02535169073515, 4.38202663467388, 6.85540879860993, 8.17919979842309, 4.24849524204936, 8.98343977178426, 8.4721958254855, 9.480214825778, 6.1463292576689, 9.93542217106647, 4.27666611901606, 5.36597601502185, 4.60517018598809, 3.2188758248682, 6.81783057145415, 6.58479139238572, 5.91889385427315, 8.67641669696422, 2.484906649788, 6.73933662735717, 3.91202300542815, 4.56434819146784, 9.15925758174687, 7.07326971745971, 9.08636319215647, 8.028, 4.905, 4.35670882668959, 5.27299955856375, 3.49650756146648, 3.68887945411394, 3.85014760171006, 3.29583686600433, 5.25749537202778, 10.4925789214972, 4.20469261939097, 1.79175946922805, 7.54750168281497, 8.34236350038058, 7.07580886397839, 5.11198778835654, 4.93447393313069, 3.17805383034795, 6.25382881157547, 7.19067603433221, 7.82724090175281, 7.51697722460432, 5.8348107370626, 6.35610766069589, 8.57073395834427, 7.16394668434255, 3.40119738166216, 5.95583736946483, 7.32383056620232, 7.63385355968177, 3.36729582998647, 6.76157276880406, 8.38845031552351, 9.9219166880045, 1.6094379124341, 7.44366368311559, 6.64768837356333, 6.85118492749374, 6.16961073249146, 9.75214127004149, 8.26359043261732, 5.84643877505772, 0, 7.60589000105312, 6.25958146406492, 8.88391747120797, 8.54286093816481, 7.86095636487639, 6.91075078796194, 7.59588991771854, 7.03174125876313, 2.99573227355399, 3.91202300542815, 5.4510384535657, 5.12989871492307, 7.88419993367604, 2.30258509299405, 9.32892308780313, 10.5472081164337, 5.71042701737487, 6.50128967054039, 5.53338948872752, 4.99043258677874, 3.61091791264422, 7.34729970074316, 8.03138533062553, 6.92264389147589, 6.7202201551353, 3.43398720448515, 6.19236248947487, 3.78418963391826, 4.51085950651685, 3.55534806148941, 7.81116338502528, 6.19847871649231, 3.55534806148941, 5.07517381523383, 7.25417784645652, 6.21460809842219, 7.19593722647557, 4.66343909411207, 3.78418963391826, 2.484906649788, 6.08221891037645, 6.04500531403601, 3.52636052461616, 9.69990150043745, 7.76004068088038, 7.78113850984502, 6.289715570909, 9.39806397805913, 5.34710753071747, 5.88887795833288, 5.29831736654804, 4.27666611901606, 3.46573590279973, 7.2152399787301, 5.68357976733868, 7.72179177681754, 1.38629436111989, 6.73221070646721, 5.4971682252932, 2.83321334405622, 8.58073121222023, 7.12608727329912, 7.9359451033537, 6.295, 4.31748811353631, 4.29045944114839, 3.43398720448515, 5.37527840768417, 3.49650756146648, 2.77258872223978, 6.40687998606931, 7.9483852851119, 6.3919171133926, 5.37989735354046, 5.86929691313377, 5.34233425196481, 4.45434729625351, 6.5424719605068, 6.89365635460264, 8.79026911147866, 7.46278915741245, 3.66356164612965, 4.99721227376411, 8.03040956213048, 7.16006920759613, 3.17805383034795, 6.31535800152233, 2.77258872223978, 7.82803803212583, 7.11151211649616, 7.01481435127554, 6.00881318544259, 9.59703032475801, 2.30258509299405, 10.1017644761202, 7.06561336359772, 8.97575663051942, 7.08757370555797, 7.22256601882217, 2.07944154167984, 2.70805020110221, 3.61091791264422, 3.85014760171006, 7.22766249872866, 0, 9.61767040669386, 8.66905554072548, 5.24174701505964, 5.48479693349065, 4.04305126783455, 6.55250788703459, 7.35115822643069, 6.52502965784346, 5.74939298590825, 3.09104245335832, 2.99573227355399, 3.29583686600433, 7.54855597916987, 4.81218435537242, 2.94443897916644, 5.03043792139244, 2.39789527279837, 2.94443897916644, 5.45958551414416, 3.58351893845611, 8.74097653801779, 5.87493073085203, 9.17294998275762, 3.46573590279973, 3.36729582998647, 3.58351893845611, 7.63867982387611, 5.90808293816893, 5.8171111599632, 6.19031540585315, 2.56494935746154, 4.51085950651685, 4.39444915467244, 5.01063529409626], + "idxn1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 2, 4, 5, 6, 9, 11, 12, 13, 14, 15, 16, 17, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 37, 38, 39, 40, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 79, 81, 82, 84, 86, 87, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 105], + "tvec1": [6.541, 5.8406416573734, 6.60123011872888, 5.8636311755981, 5.91350300563827, 5.91889385427315, 5.87493073085203, 5.82008293035236, 5.91350300563827, 5.98896141688986, 5.95064255258773, 5.75574221358691, 5.92157841964382, 5.93489419561959, 5.91350300563827, 5.97126183979046, 5.97126183979046, 6.59987049921284, 5.92157841964382, 6.71780469502369, 5.92958914338989, 5.92157841964382, 5.92157841964382, 5.92157841964382, 5.92157841964382, 5.8406416573734, 5.89440283426485, 5.93489419561959, 5.93224518744801, 5.96870755998537, 5.8805329864007, 6.62671774924902, 5.87773578177964, 6.59030104819669, 5.92958914338989, 5.92958914338989, 5.86078622346587, 5.89440283426485, 5.95064255258773, 5.93224518744801, 5.97126183979046, 6.57088296233958, 5.93753620508243, 5.87493073085203, 5.89164421182577, 6.74170069465205, 5.89440283426485, 5.94803498918065, 5.77455154554441, 5.97126183979046, 5.96870755998537, 5.8805329864007, 5.89440283426485, 6.62936325343745, 5.93224518744801, 5.99146454710798, 5.88887795833288, 5.93489419561959, 5.94017125272043, 5.95583736946483, 5.93489419561959, 5.92692602597041, 6.64639051484773, 5.93224518744801, 5.96870755998537, 5.93224518744801, 5.93224518744801, 5.93224518744801, 5.94542060860658, 5.86929691313377, 6.65801104587075, 5.89715386763674, 6.00881318544259, 5.97126183979046, 5.97126183979046, 5.97126183979046, 6.00881318544259, 6.64639051484773, 5.88610403145016, 5.75257263882563, 5.68017260901707, 5.77144112313002, 5.96100533962327, 5.75257263882563, 5.81413053182507, 5.63478960316925, 5.77455154554441, 5.77765232322266, 5.63121178182137, 5.70711026474888, 5.89164421182577, 5.77455154554441, 6.0591231955818, 5.8171111599632, 5.65248918026865, 5.60947179518496, 5.83773044716594, 5.91350300563827, 5.77455154554441, 5.83773044716594, 5.98645200528444, 5.8171111599632, 6.49526555593701, 5.68697535633982, 5.8171111599632, 5.85793315448346, 6.963, 6.52941883826223, 7.02553831463852, 6.51767127291227, 6.5694814204143, 6.5694814204143, 6.97447891102505, 6.56244409369372, 6.5510803350434, 7.0335064842877, 6.59987049921284, 6.65544035036765, 6.70686233660275, 6.63987583382654, 6.63987583382654, 6.55961523749324, 6.60123011872888, 7.00215595440362, 6.68959926917897, 6.98286275146894, 6.56807791141198, 6.71780469502369, 6.54821910276237, 6.54821910276237, 6.54821910276237, 6.54821910276237, 6.49072353450251, 6.70686233660275, 6.56103066589657, 6.52795791762255, 6.56244409369372, 6.94889722231331, 6.54965074223381, 7.00669522683704, 6.56807791141198, 6.56807791141198, 6.55819780281227, 6.59030104819669, 6.51767127291227, 6.70196036600254, 6.60934924316738, 7.01571242048723, 6.5206211275587, 6.56103066589657, 6.59030104819669, 6.98933526597456, 6.5410299991899, 6.5510803350434, 6.49828214947643, 6.54965074223381, 6.58892647753352, 6.59030104819669, 6.5410299991899, 6.98471632011826, 6.62007320653036, 6.63856778916652, 6.59441345974978, 6.61873898351722, 6.62140565176413, 6.62936325343745, 6.61873898351722, 6.61204103483309, 7.04403289727469, 6.62007320653036, 6.64639051484773, 6.64768837356333, 6.62007320653036, 6.62671774924902, 6.62140565176413, 6.5875500148248, 7.05875815251866, 6.59714570188665, 6.62936325343745, 6.66568371778241, 6.66440902035041, 6.66440902035041, 7.05185562295589, 7.04403289727469, 6.59167373200866, 6.96129604591017, 6.50876913697168, 6.56244409369372, 6.66695679242921, 6.49828214947643, 7.02108396428914, 6.46769872610435, 6.48768401848461, 6.52209279817015, 6.55535689181067, 6.45833828334479, 6.48920493132532, 6.48920493132532, 6.62671774924902, 6.49223983502047, 6.42162226780652, 6.44413125670044, 6.48616078894409, 6.52649485957079, 6.45047042214418, 6.48463523563525, 6.51025834052315, 6.48463523563525, 6.94215670569947, 6.47850964220857, 6.51174532964473, 6.92264389147589, 6.98193467715639, 6.96790920180188, 7.00850518208228, 7.00760061395185, 7.00306545878646, 7.00940893270864, 6.9555926083963, 6.98286275146894, 6.9782137426307, 6.9782137426307, 7.00124562206948, 7.00033446027523, 6.96224346426621, 6.98286275146894, 6.98193467715639, 6.98193467715639, 6.98100574072173, 6.98100574072173, 6.95654544315157, 7.00306545878646, 7.0335064842877, 6.94215670569947, 6.97728134163075, 6.98841318199959, 6.98193467715639, 6.98193467715639, 6.97447891102505, 6.98378996525813, 6.97447891102505, 6.97447891102505, 6.97073007814353, 6.97447891102505, 6.98378996525813, 6.98286275146894, 6.99668148817654, 6.95844839329766, 7.01481435127554, 6.98378996525813, 6.98286275146894, 7.03174125876313, 7.04053639021596, 7.02908756414966, 7.04577657687951, 7.05272104923232, 7.05272104923232, 7.04490511712937, 7.04141166379481, 7.03174125876313, 7.028201432058, 7.03174125876313, 7.02731451403978, 7.05272104923232, 7.03174125876313, 7.03966034986208, 7.03878354138854, 7.04403289727469, 7.04403289727469, 7.028201432058, 6.97541392745595, 6.99759598298193, 6.99025650049388, 6.95081476844258, 6.92067150424868, 6.91473089271856, 6.92165818415113, 6.92165818415113, 7.01391547481053, 6.94119005506837, 6.86380339145295, 6.92165818415113, 6.97447891102505, 6.92755790627832, 6.91869521902047, 6.96413561241824, 6.94793706861497, 6.93634273583405], + "y0": [8.613, 7.105, 6.896, 5.63835466933375, 6.35088571671474, 5.03043792139244, 5.8664680569333, 5.73979291217923, 7.07834157955767, 8.56655462095396, 6.86171134048073, 6.97354301952014, 7.34213173058472, 8.82629423124132, 6.48768401848461, 6.66440902035041, 7.0343879299155, 4.49980967033027, 6.85118492749374, 3.04452243772342, 8.63905677917308, 1.79175946922805, 7.01660968389422, 7.09090982207998, 7.42356844425917, 8.09620827165004, 5.70711026474888, 7.01031186730723, 7.18311170174328, 8.15219801586179, 5.99645208861902, 7.0825485693553, 5.06890420222023, 7.04228617193974, 4.0943445622221, 7.32052696227274, 7.12689080889881, 7.24136628332232, 6.62007320653036, 7.36897040219479, 8.47720418319987, 7.20340552108309, 2.89037175789616, 7.39141523467536, 6.25190388316589, 8.38160253710989, 11.5129154649202, 6.60258789218934, 7.61283103040736, 7.42476176182321, 6.71174039505618, 5.56068163101553, 6.0282785202307, 7.10085190894405, 7.52671756135271, 7.92948652331429, 1.6094379124341, 6.85856503479136, 8.05006542291597, 5.83188247728352, 7.15851399732932, 7.01481435127554, 7.70120018085745, 7.16239749735572, 5.99893656194668, 5.41610040220442, 8.40782465436087, 7.18462915271731, 3.25809653802148, 8.14380797677148, 5.24702407216049, 5.73979291217923, 4.55387689160054, 7.72444664563354, 7.91425227874244, 7.11476944836646, 8.24064886337491, 8.56044423341055, 6.78558764500793, 10.8861838116069, 2.07944154167984, 5.82894561761021, 4.0943445622221, 7.53208814354172, 5.66988092298052, 3.46573590279973, 10.7229148990064, 8.02910705461974, 9.23092700558457, 6.42971947803914, 11.5129154649202, 7.25700270709207, 6.62007320653036, 9.41995278900604, 5.28826703069454, 8.04654935728308, 7.58984151218266, 6.39024066706535, 6.04025471127741, 2.77258872223978, 7.62948991639399, 7.85476918349913, 7.09007683577609, 5.50125821054473, 6.98100574072173, 5.50533153593236], + "N": 106, + "N1": 288 +} diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.old.data.R b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.old.data.R new file mode 100644 index 000000000..a78da928c --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.old.data.R @@ -0,0 +1,184 @@ +N <- +106 +T <- +3 +Y <- +structure(c(4.997, 6.83, 3.95124371858143, 6.79794041297493, +4.71849887129509, 5.78996017089725, 6.13122648948314, 6.76272950693188, +6.14846829591765, 10.7579879834538, 5.63121178182137, 3.46573590279973, +7.92479591395644, 9.16115012778541, 8.74257423767064, 5.91079664404053, +6.54678541076052, 2.94443897916644, 7.05272104923232, 0, 9.13905916997122, +8.48260174664662, 7.11963563801764, 7.64300363556072, 9.42294862137501, +8.2553088117856, 4.82028156560504, 6.54678541076052, 8.67470962929122, +7.86326672400957, 4.67282883446191, 7.41878088275079, 6.84587987526405, +5.46383180502561, 3.43398720448515, 7.7553388128465, 9.04239498112674, +8.45212119467252, 7.91425227874244, 7.72885582385254, 9.31433996199467, +6.35957386867238, 2.30258509299405, 8.29354951506035, 8.90082160491523, +8.87905466204227, 11.5129154649202, 8.79618763547045, 8.40155784781731, +8.89370997756851, 7.1800698743028, 4.82028156560504, 5.77765232322266, +6.4707995037826, 4.40671924726425, 8.17413934342947, 2.30258509299405, +9.77104128523582, 6.95081476844258, 5.97635090929793, 5.8805329864007, +5.73979291217923, 5.75574221358691, 5.15329159449778, 8.11761074646623, +8.54636356871602, 7.58171964012531, 6.9037472575846, 4.66343909411207, +7.47986413116503, 3.61091791264422, 4.64439089914137, 4.39444915467244, +8.23509549725836, 6.12905021006055, 8.4424696452203, 6.88755257166462, +7.29233717617388, 6.38856140554563, 8.75998249497728, 6.08677472691231, +4.02535169073515, 4.38202663467388, 6.85540879860993, 8.17919979842309, +4.24849524204936, 8.98343977178426, 8.4721958254855, 9.480214825778, +6.1463292576689, 9.93542217106647, 4.27666611901606, 5.36597601502185, +4.60517018598809, 3.2188758248682, 6.81783057145415, 6.58479139238572, +5.91889385427315, 8.67641669696422, 2.484906649788, 6.73933662735717, +3.91202300542815, 4.56434819146784, 9.15925758174687, 7.07326971745971, +9.08636319215647, 8.028, 4.905, 4.35670882668959, 5.27299955856375, +3.49650756146648, 3.68887945411394, 3.85014760171006, 3.29583686600433, +5.25749537202778, 10.4925789214972, 4.20469261939097, 1.79175946922805, +7.54750168281497, 8.34236350038058, 7.07580886397839, 5.11198778835654, +4.93447393313069, 3.17805383034795, 6.25382881157547, 7.19067603433221, +7.82724090175281, 7.51697722460432, 5.8348107370626, 6.35610766069589, +8.57073395834427, 7.16394668434255, 3.40119738166216, 5.95583736946483, +7.32383056620232, 7.63385355968177, 3.36729582998647, 6.76157276880406, +8.38845031552351, 9.9219166880045, 1.6094379124341, 7.44366368311559, +6.64768837356333, 6.85118492749374, 6.16961073249146, 9.75214127004149, +8.26359043261732, 5.84643877505772, 0, 7.60589000105312, 6.25958146406492, +8.88391747120797, 8.54286093816481, 7.86095636487639, 6.91075078796194, +7.59588991771854, 7.03174125876313, 2.99573227355399, 3.91202300542815, +5.4510384535657, 5.12989871492307, 7.88419993367604, 2.30258509299405, +9.32892308780313, 10.5472081164337, 5.71042701737487, 6.50128967054039, +5.53338948872752, 4.99043258677874, 3.61091791264422, 7.34729970074316, +8.03138533062553, 6.92264389147589, 6.7202201551353, 3.43398720448515, +6.19236248947487, 3.78418963391826, 4.51085950651685, 3.55534806148941, +7.81116338502528, 6.19847871649231, 3.55534806148941, 5.07517381523383, +7.25417784645652, 6.21460809842219, 7.19593722647557, 4.66343909411207, +3.78418963391826, 2.484906649788, 6.08221891037645, 6.04500531403601, +3.52636052461616, 9.69990150043745, 7.76004068088038, 7.78113850984502, +6.289715570909, 9.39806397805913, 5.34710753071747, 5.88887795833288, +5.29831736654804, 4.27666611901606, 3.46573590279973, 7.2152399787301, +5.68357976733868, 7.72179177681754, 1.38629436111989, 6.73221070646721, +5.4971682252932, 2.83321334405622, 8.58073121222023, 7.12608727329912, +7.9359451033537, NA, 6.295, NA, 4.31748811353631, 4.29045944114839, +3.43398720448515, NA, NA, 5.37527840768417, NA, 3.49650756146648, +2.77258872223978, 6.40687998606931, 7.9483852851119, 6.3919171133926, +5.37989735354046, 5.86929691313377, NA, 5.34233425196481, NA, +NA, 4.45434729625351, 6.5424719605068, 6.89365635460264, 8.79026911147866, +7.46278915741245, 3.66356164612965, 4.99721227376411, 8.03040956213048, +7.16006920759613, 3.17805383034795, NA, 6.31535800152233, NA, +2.77258872223978, 7.82803803212583, 7.11151211649616, 7.01481435127554, +6.00881318544259, 9.59703032475801, NA, NA, 2.30258509299405, +10.1017644761202, 7.06561336359772, NA, 8.97575663051942, 7.08757370555797, +7.22256601882217, NA, 2.07944154167984, 2.70805020110221, 3.61091791264422, +NA, 3.85014760171006, 7.22766249872866, 0, 9.61767040669386, +8.66905554072548, 5.24174701505964, 5.48479693349065, 4.04305126783455, +NA, NA, 6.55250788703459, 7.35115822643069, 6.52502965784346, +5.74939298590825, 3.09104245335832, NA, NA, 2.99573227355399, +3.29583686600433, 7.54855597916987, 4.81218435537242, 2.94443897916644, +NA, NA, 5.03043792139244, NA, 2.39789527279837, 2.94443897916644, +NA, 5.45958551414416, NA, 3.58351893845611, 8.74097653801779, +NA, NA, 5.87493073085203, 9.17294998275762, 3.46573590279973, +3.36729582998647, 3.58351893845611, 7.63867982387611, NA, 5.90808293816893, +5.8171111599632, 6.19031540585315, 2.56494935746154, 4.51085950651685, +4.39444915467244, NA, NA, 5.01063529409626, NA), .Dim = c(106L, +3L)) +t <- +structure(c(6.541, 5.8406416573734, 6.60123011872888, 5.8636311755981, +5.91350300563827, 5.91889385427315, 5.87493073085203, 5.82008293035236, +5.91350300563827, 5.98896141688986, 5.95064255258773, 5.75574221358691, +5.92157841964382, 5.93489419561959, 5.91350300563827, 5.97126183979046, +5.97126183979046, 6.59987049921284, 5.92157841964382, 6.71780469502369, +5.92958914338989, 5.92157841964382, 5.92157841964382, 5.92157841964382, +5.92157841964382, 5.8406416573734, 5.89440283426485, 5.93489419561959, +5.93224518744801, 5.96870755998537, 5.8805329864007, 6.62671774924902, +5.87773578177964, 6.59030104819669, 5.92958914338989, 5.92958914338989, +5.86078622346587, 5.89440283426485, 5.95064255258773, 5.93224518744801, +5.97126183979046, 6.57088296233958, 5.93753620508243, 5.87493073085203, +5.89164421182577, 6.74170069465205, 5.89440283426485, 5.94803498918065, +5.77455154554441, 5.97126183979046, 5.96870755998537, 5.8805329864007, +5.89440283426485, 6.62936325343745, 5.93224518744801, 5.99146454710798, +5.88887795833288, 5.93489419561959, 5.94017125272043, 5.95583736946483, +5.93489419561959, 5.92692602597041, 6.64639051484773, 5.93224518744801, +5.96870755998537, 5.93224518744801, 5.93224518744801, 5.93224518744801, +5.94542060860658, 5.86929691313377, 6.65801104587075, 5.89715386763674, +6.00881318544259, 5.97126183979046, 5.97126183979046, 5.97126183979046, +6.00881318544259, 6.64639051484773, 5.88610403145016, 5.75257263882563, +5.68017260901707, 5.77144112313002, 5.96100533962327, 5.75257263882563, +5.81413053182507, 5.63478960316925, 5.77455154554441, 5.77765232322266, +5.63121178182137, 5.70711026474888, 5.89164421182577, 5.77455154554441, +6.0591231955818, 5.8171111599632, 5.65248918026865, 5.60947179518496, +5.83773044716594, 5.91350300563827, 5.77455154554441, 5.83773044716594, +5.98645200528444, 5.8171111599632, 6.49526555593701, 5.68697535633982, +5.8171111599632, 5.85793315448346, 6.963, 6.52941883826223, 7.02553831463852, +6.51767127291227, 6.5694814204143, 6.5694814204143, 6.97447891102505, +6.56244409369372, 6.5510803350434, 7.0335064842877, 6.59987049921284, +6.65544035036765, 6.70686233660275, 6.63987583382654, 6.63987583382654, +6.55961523749324, 6.60123011872888, 7.00215595440362, 6.68959926917897, +6.98286275146894, 6.56807791141198, 6.71780469502369, 6.54821910276237, +6.54821910276237, 6.54821910276237, 6.54821910276237, 6.49072353450251, +6.70686233660275, 6.56103066589657, 6.52795791762255, 6.56244409369372, +6.94889722231331, 6.54965074223381, 7.00669522683704, 6.56807791141198, +6.56807791141198, 6.55819780281227, 6.59030104819669, 6.51767127291227, +6.70196036600254, 6.60934924316738, 7.01571242048723, 6.5206211275587, +6.56103066589657, 6.59030104819669, 6.98933526597456, 6.5410299991899, +6.5510803350434, 6.49828214947643, 6.54965074223381, 6.58892647753352, +6.59030104819669, 6.5410299991899, 6.98471632011826, 6.62007320653036, +6.63856778916652, 6.59441345974978, 6.61873898351722, 6.62140565176413, +6.62936325343745, 6.61873898351722, 6.61204103483309, 7.04403289727469, +6.62007320653036, 6.64639051484773, 6.64768837356333, 6.62007320653036, +6.62671774924902, 6.62140565176413, 6.5875500148248, 7.05875815251866, +6.59714570188665, 6.62936325343745, 6.66568371778241, 6.66440902035041, +6.66440902035041, 7.05185562295589, 7.04403289727469, 6.59167373200866, +6.96129604591017, 6.50876913697168, 6.56244409369372, 6.66695679242921, +6.49828214947643, 7.02108396428914, 6.46769872610435, 6.48768401848461, +6.52209279817015, 6.55535689181067, 6.45833828334479, 6.48920493132532, +6.48920493132532, 6.62671774924902, 6.49223983502047, 6.42162226780652, +6.44413125670044, 6.48616078894409, 6.52649485957079, 6.45047042214418, +6.48463523563525, 6.51025834052315, 6.48463523563525, 6.94215670569947, +6.47850964220857, 6.51174532964473, 6.92264389147589, 10, 6.98193467715639, +10, 6.96790920180188, 7.00850518208228, 7.00760061395185, 10, +10, 7.00306545878646, 10, 7.00940893270864, 6.9555926083963, +6.98286275146894, 6.9782137426307, 6.9782137426307, 7.00124562206948, +7.00033446027523, 10, 6.96224346426621, 10, 10, 6.98286275146894, +6.98193467715639, 6.98193467715639, 6.98100574072173, 6.98100574072173, +6.95654544315157, 7.00306545878646, 7.0335064842877, 6.94215670569947, +6.97728134163075, 10, 6.98841318199959, 10, 6.98193467715639, +6.98193467715639, 6.97447891102505, 6.98378996525813, 6.97447891102505, +6.97447891102505, 10, 10, 6.97073007814353, 6.97447891102505, +6.98378996525813, 10, 6.98286275146894, 6.99668148817654, 6.95844839329766, +10, 7.01481435127554, 6.98378996525813, 6.98286275146894, 10, +7.03174125876313, 7.04053639021596, 7.02908756414966, 7.04577657687951, +7.05272104923232, 7.05272104923232, 7.04490511712937, 7.04141166379481, +10, 10, 7.03174125876313, 7.028201432058, 7.03174125876313, 7.02731451403978, +7.05272104923232, 10, 10, 7.03174125876313, 7.03966034986208, +7.03878354138854, 7.04403289727469, 7.04403289727469, 10, 10, +7.028201432058, 10, 6.97541392745595, 6.99759598298193, 10, 6.99025650049388, +10, 6.95081476844258, 6.92067150424868, 10, 10, 6.91473089271856, +6.92165818415113, 6.92165818415113, 7.01391547481053, 6.94119005506837, +6.86380339145295, 10, 6.92165818415113, 6.97447891102505, 6.92755790627832, +6.91869521902047, 6.96413561241824, 6.94793706861497, 10, 10, +6.93634273583405, 10), .Dim = c(106L, 3L)) +y0 <- +c(8.613, 7.105, 6.896, 5.63835466933375, 6.35088571671474, 5.03043792139244, +5.8664680569333, 5.73979291217923, 7.07834157955767, 8.56655462095396, +6.86171134048073, 6.97354301952014, 7.34213173058472, 8.82629423124132, +6.48768401848461, 6.66440902035041, 7.0343879299155, 4.49980967033027, +6.85118492749374, 3.04452243772342, 8.63905677917308, 1.79175946922805, +7.01660968389422, 7.09090982207998, 7.42356844425917, 8.09620827165004, +5.70711026474888, 7.01031186730723, 7.18311170174328, 8.15219801586179, +5.99645208861902, 7.0825485693553, 5.06890420222023, 7.04228617193974, +4.0943445622221, 7.32052696227274, 7.12689080889881, 7.24136628332232, +6.62007320653036, 7.36897040219479, 8.47720418319987, 7.20340552108309, +2.89037175789616, 7.39141523467536, 6.25190388316589, 8.38160253710989, +11.5129154649202, 6.60258789218934, 7.61283103040736, 7.42476176182321, +6.71174039505618, 5.56068163101553, 6.0282785202307, 7.10085190894405, +7.52671756135271, 7.92948652331429, 1.6094379124341, 6.85856503479136, +8.05006542291597, 5.83188247728352, 7.15851399732932, 7.01481435127554, +7.70120018085745, 7.16239749735572, 5.99893656194668, 5.41610040220442, +8.40782465436087, 7.18462915271731, 3.25809653802148, 8.14380797677148, +5.24702407216049, 5.73979291217923, 4.55387689160054, 7.72444664563354, +7.91425227874244, 7.11476944836646, 8.24064886337491, 8.56044423341055, +6.78558764500793, 10.8861838116069, 2.07944154167984, 5.82894561761021, +4.0943445622221, 7.53208814354172, 5.66988092298052, 3.46573590279973, +10.7229148990064, 8.02910705461974, 9.23092700558457, 6.42971947803914, +11.5129154649202, 7.25700270709207, 6.62007320653036, 9.41995278900604, +5.28826703069454, 8.04654935728308, 7.58984151218266, 6.39024066706535, +6.04025471127741, 2.77258872223978, 7.62948991639399, 7.85476918349913, +7.09007683577609, 5.50125821054473, 6.98100574072173, 5.50533153593236 +) diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.stan b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.stan new file mode 100644 index 000000000..d22fdf020 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitis.stan @@ -0,0 +1,61 @@ +// Hepatitis: a normal hierarchical model with measurement +// error +// http://openbugs.net/Examples/Hepatitis.html + +// In this version the measurement errors are not modeled. +// See hepatisisME for the version with measurement errors. + +//# note that we have missing data in the orignal data Y[N, T]; +//# here, we turn Y[N, T] into Yvec with the missing +//# data removed. + +data { + int N1; //# N1 is the length of the vector, Yvec1, that is + int N; //# created from concatenate columns of matrix Y[N, T] + array[N1] real Yvec1; //# with NA's removed. + array[N1] real tvec1; //# N is the nrow of original matrix Y[N, T] + array[N1] int idxn1; //# idxn1 maps Yvec to its orignal n index + array[N] real y0; +} +transformed data { + real y0_mean; + y0_mean = mean(y0); +} +parameters { + real sigmasq_y; + real sigmasq_alpha; + real sigmasq_beta; + array[N] real alpha; + array[N] real beta; + real gamma; + real alpha0; + real beta0; +} +transformed parameters { + real sigma_y; + real sigma_alpha; + real sigma_beta; + sigma_y = sqrt(sigmasq_y); + sigma_alpha = sqrt(sigmasq_alpha); + sigma_beta = sqrt(sigmasq_beta); +} +model { + int oldn; + array[N1] real m; + for (n in 1 : N1) { + oldn = idxn1[n]; + m[n] = alpha[oldn] + beta[oldn] * (tvec1[n] - 6.5) + + gamma * (y0[oldn] - y0_mean); + } + Yvec1 ~ normal(m, sigma_y); + + alpha ~ normal(alpha0, sigma_alpha); + beta ~ normal(beta0, sigma_beta); + + sigmasq_y ~ inv_gamma(.001, .001); + sigmasq_alpha ~ inv_gamma(.001, .001); + sigmasq_beta ~ inv_gamma(.001, .001); + alpha0 ~ normal(0, 1000); + beta0 ~ normal(0, 1000); + gamma ~ normal(0, 1000); +} diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.data.R b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.data.R new file mode 100644 index 000000000..734ee339d --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.data.R @@ -0,0 +1,201 @@ +N <- +106 +Yvec1 <- +c(4.997, 6.83, 3.95124371858143, 6.79794041297493, 4.71849887129509, +5.78996017089725, 6.13122648948314, 6.76272950693188, 6.14846829591765, +10.7579879834538, 5.63121178182137, 3.46573590279973, 7.92479591395644, +9.16115012778541, 8.74257423767064, 5.91079664404053, 6.54678541076052, +2.94443897916644, 7.05272104923232, 0, 9.13905916997122, 8.48260174664662, +7.11963563801764, 7.64300363556072, 9.42294862137501, 8.2553088117856, +4.82028156560504, 6.54678541076052, 8.67470962929122, 7.86326672400957, +4.67282883446191, 7.41878088275079, 6.84587987526405, 5.46383180502561, +3.43398720448515, 7.7553388128465, 9.04239498112674, 8.45212119467252, +7.91425227874244, 7.72885582385254, 9.31433996199467, 6.35957386867238, +2.30258509299405, 8.29354951506035, 8.90082160491523, 8.87905466204227, +11.5129154649202, 8.79618763547045, 8.40155784781731, 8.89370997756851, +7.1800698743028, 4.82028156560504, 5.77765232322266, 6.4707995037826, +4.40671924726425, 8.17413934342947, 2.30258509299405, 9.77104128523582, +6.95081476844258, 5.97635090929793, 5.8805329864007, 5.73979291217923, +5.75574221358691, 5.15329159449778, 8.11761074646623, 8.54636356871602, +7.58171964012531, 6.9037472575846, 4.66343909411207, 7.47986413116503, +3.61091791264422, 4.64439089914137, 4.39444915467244, 8.23509549725836, +6.12905021006055, 8.4424696452203, 6.88755257166462, 7.29233717617388, +6.38856140554563, 8.75998249497728, 6.08677472691231, 4.02535169073515, +4.38202663467388, 6.85540879860993, 8.17919979842309, 4.24849524204936, +8.98343977178426, 8.4721958254855, 9.480214825778, 6.1463292576689, +9.93542217106647, 4.27666611901606, 5.36597601502185, 4.60517018598809, +3.2188758248682, 6.81783057145415, 6.58479139238572, 5.91889385427315, +8.67641669696422, 2.484906649788, 6.73933662735717, 3.91202300542815, +4.56434819146784, 9.15925758174687, 7.07326971745971, 9.08636319215647, +8.028, 4.905, 4.35670882668959, 5.27299955856375, 3.49650756146648, +3.68887945411394, 3.85014760171006, 3.29583686600433, 5.25749537202778, +10.4925789214972, 4.20469261939097, 1.79175946922805, 7.54750168281497, +8.34236350038058, 7.07580886397839, 5.11198778835654, 4.93447393313069, +3.17805383034795, 6.25382881157547, 7.19067603433221, 7.82724090175281, +7.51697722460432, 5.8348107370626, 6.35610766069589, 8.57073395834427, +7.16394668434255, 3.40119738166216, 5.95583736946483, 7.32383056620232, +7.63385355968177, 3.36729582998647, 6.76157276880406, 8.38845031552351, +9.9219166880045, 1.6094379124341, 7.44366368311559, 6.64768837356333, +6.85118492749374, 6.16961073249146, 9.75214127004149, 8.26359043261732, +5.84643877505772, 0, 7.60589000105312, 6.25958146406492, 8.88391747120797, +8.54286093816481, 7.86095636487639, 6.91075078796194, 7.59588991771854, +7.03174125876313, 2.99573227355399, 3.91202300542815, 5.4510384535657, +5.12989871492307, 7.88419993367604, 2.30258509299405, 9.32892308780313, +10.5472081164337, 5.71042701737487, 6.50128967054039, 5.53338948872752, +4.99043258677874, 3.61091791264422, 7.34729970074316, 8.03138533062553, +6.92264389147589, 6.7202201551353, 3.43398720448515, 6.19236248947487, +3.78418963391826, 4.51085950651685, 3.55534806148941, 7.81116338502528, +6.19847871649231, 3.55534806148941, 5.07517381523383, 7.25417784645652, +6.21460809842219, 7.19593722647557, 4.66343909411207, 3.78418963391826, +2.484906649788, 6.08221891037645, 6.04500531403601, 3.52636052461616, +9.69990150043745, 7.76004068088038, 7.78113850984502, 6.289715570909, +9.39806397805913, 5.34710753071747, 5.88887795833288, 5.29831736654804, +4.27666611901606, 3.46573590279973, 7.2152399787301, 5.68357976733868, +7.72179177681754, 1.38629436111989, 6.73221070646721, 5.4971682252932, +2.83321334405622, 8.58073121222023, 7.12608727329912, 7.9359451033537, +6.295, 4.31748811353631, 4.29045944114839, 3.43398720448515, +5.37527840768417, 3.49650756146648, 2.77258872223978, 6.40687998606931, +7.9483852851119, 6.3919171133926, 5.37989735354046, 5.86929691313377, +5.34233425196481, 4.45434729625351, 6.5424719605068, 6.89365635460264, +8.79026911147866, 7.46278915741245, 3.66356164612965, 4.99721227376411, +8.03040956213048, 7.16006920759613, 3.17805383034795, 6.31535800152233, +2.77258872223978, 7.82803803212583, 7.11151211649616, 7.01481435127554, +6.00881318544259, 9.59703032475801, 2.30258509299405, 10.1017644761202, +7.06561336359772, 8.97575663051942, 7.08757370555797, 7.22256601882217, +2.07944154167984, 2.70805020110221, 3.61091791264422, 3.85014760171006, +7.22766249872866, 0, 9.61767040669386, 8.66905554072548, 5.24174701505964, +5.48479693349065, 4.04305126783455, 6.55250788703459, 7.35115822643069, +6.52502965784346, 5.74939298590825, 3.09104245335832, 2.99573227355399, +3.29583686600433, 7.54855597916987, 4.81218435537242, 2.94443897916644, +5.03043792139244, 2.39789527279837, 2.94443897916644, 5.45958551414416, +3.58351893845611, 8.74097653801779, 5.87493073085203, 9.17294998275762, +3.46573590279973, 3.36729582998647, 3.58351893845611, 7.63867982387611, +5.90808293816893, 5.8171111599632, 6.19031540585315, 2.56494935746154, +4.51085950651685, 4.39444915467244, 5.01063529409626) +idxn1 <- +c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, +15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, +28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, +41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, +54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, +67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, +80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, +93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, +105, 106, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, +13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, +26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, +39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, +52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, +65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, +78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, +91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, +103, 104, 105, 106, 2, 4, 5, 6, 9, 11, 12, 13, 14, +15, 16, 17, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, +31, 33, 35, 36, 37, 38, 39, 40, 43, 44, 45, 47, 48, +49, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 65, +66, 67, 68, 69, 72, 73, 74, 75, 76, 79, 81, 82, 84, +86, 87, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, +101, 102, 105) +tvec1 <- +c(6.541, 5.8406416573734, 6.60123011872888, 5.8636311755981, +5.91350300563827, 5.91889385427315, 5.87493073085203, 5.82008293035236, +5.91350300563827, 5.98896141688986, 5.95064255258773, 5.75574221358691, +5.92157841964382, 5.93489419561959, 5.91350300563827, 5.97126183979046, +5.97126183979046, 6.59987049921284, 5.92157841964382, 6.71780469502369, +5.92958914338989, 5.92157841964382, 5.92157841964382, 5.92157841964382, +5.92157841964382, 5.8406416573734, 5.89440283426485, 5.93489419561959, +5.93224518744801, 5.96870755998537, 5.8805329864007, 6.62671774924902, +5.87773578177964, 6.59030104819669, 5.92958914338989, 5.92958914338989, +5.86078622346587, 5.89440283426485, 5.95064255258773, 5.93224518744801, +5.97126183979046, 6.57088296233958, 5.93753620508243, 5.87493073085203, +5.89164421182577, 6.74170069465205, 5.89440283426485, 5.94803498918065, +5.77455154554441, 5.97126183979046, 5.96870755998537, 5.8805329864007, +5.89440283426485, 6.62936325343745, 5.93224518744801, 5.99146454710798, +5.88887795833288, 5.93489419561959, 5.94017125272043, 5.95583736946483, +5.93489419561959, 5.92692602597041, 6.64639051484773, 5.93224518744801, +5.96870755998537, 5.93224518744801, 5.93224518744801, 5.93224518744801, +5.94542060860658, 5.86929691313377, 6.65801104587075, 5.89715386763674, +6.00881318544259, 5.97126183979046, 5.97126183979046, 5.97126183979046, +6.00881318544259, 6.64639051484773, 5.88610403145016, 5.75257263882563, +5.68017260901707, 5.77144112313002, 5.96100533962327, 5.75257263882563, +5.81413053182507, 5.63478960316925, 5.77455154554441, 5.77765232322266, +5.63121178182137, 5.70711026474888, 5.89164421182577, 5.77455154554441, +6.0591231955818, 5.8171111599632, 5.65248918026865, 5.60947179518496, +5.83773044716594, 5.91350300563827, 5.77455154554441, 5.83773044716594, +5.98645200528444, 5.8171111599632, 6.49526555593701, 5.68697535633982, +5.8171111599632, 5.85793315448346, 6.963, 6.52941883826223, 7.02553831463852, +6.51767127291227, 6.5694814204143, 6.5694814204143, 6.97447891102505, +6.56244409369372, 6.5510803350434, 7.0335064842877, 6.59987049921284, +6.65544035036765, 6.70686233660275, 6.63987583382654, 6.63987583382654, +6.55961523749324, 6.60123011872888, 7.00215595440362, 6.68959926917897, +6.98286275146894, 6.56807791141198, 6.71780469502369, 6.54821910276237, +6.54821910276237, 6.54821910276237, 6.54821910276237, 6.49072353450251, +6.70686233660275, 6.56103066589657, 6.52795791762255, 6.56244409369372, +6.94889722231331, 6.54965074223381, 7.00669522683704, 6.56807791141198, +6.56807791141198, 6.55819780281227, 6.59030104819669, 6.51767127291227, +6.70196036600254, 6.60934924316738, 7.01571242048723, 6.5206211275587, +6.56103066589657, 6.59030104819669, 6.98933526597456, 6.5410299991899, +6.5510803350434, 6.49828214947643, 6.54965074223381, 6.58892647753352, +6.59030104819669, 6.5410299991899, 6.98471632011826, 6.62007320653036, +6.63856778916652, 6.59441345974978, 6.61873898351722, 6.62140565176413, +6.62936325343745, 6.61873898351722, 6.61204103483309, 7.04403289727469, +6.62007320653036, 6.64639051484773, 6.64768837356333, 6.62007320653036, +6.62671774924902, 6.62140565176413, 6.5875500148248, 7.05875815251866, +6.59714570188665, 6.62936325343745, 6.66568371778241, 6.66440902035041, +6.66440902035041, 7.05185562295589, 7.04403289727469, 6.59167373200866, +6.96129604591017, 6.50876913697168, 6.56244409369372, 6.66695679242921, +6.49828214947643, 7.02108396428914, 6.46769872610435, 6.48768401848461, +6.52209279817015, 6.55535689181067, 6.45833828334479, 6.48920493132532, +6.48920493132532, 6.62671774924902, 6.49223983502047, 6.42162226780652, +6.44413125670044, 6.48616078894409, 6.52649485957079, 6.45047042214418, +6.48463523563525, 6.51025834052315, 6.48463523563525, 6.94215670569947, +6.47850964220857, 6.51174532964473, 6.92264389147589, 6.98193467715639, +6.96790920180188, 7.00850518208228, 7.00760061395185, 7.00306545878646, +7.00940893270864, 6.9555926083963, 6.98286275146894, 6.9782137426307, +6.9782137426307, 7.00124562206948, 7.00033446027523, 6.96224346426621, +6.98286275146894, 6.98193467715639, 6.98193467715639, 6.98100574072173, +6.98100574072173, 6.95654544315157, 7.00306545878646, 7.0335064842877, +6.94215670569947, 6.97728134163075, 6.98841318199959, 6.98193467715639, +6.98193467715639, 6.97447891102505, 6.98378996525813, 6.97447891102505, +6.97447891102505, 6.97073007814353, 6.97447891102505, 6.98378996525813, +6.98286275146894, 6.99668148817654, 6.95844839329766, 7.01481435127554, +6.98378996525813, 6.98286275146894, 7.03174125876313, 7.04053639021596, +7.02908756414966, 7.04577657687951, 7.05272104923232, 7.05272104923232, +7.04490511712937, 7.04141166379481, 7.03174125876313, 7.028201432058, +7.03174125876313, 7.02731451403978, 7.05272104923232, 7.03174125876313, +7.03966034986208, 7.03878354138854, 7.04403289727469, 7.04403289727469, +7.028201432058, 6.97541392745595, 6.99759598298193, 6.99025650049388, +6.95081476844258, 6.92067150424868, 6.91473089271856, 6.92165818415113, +6.92165818415113, 7.01391547481053, 6.94119005506837, 6.86380339145295, +6.92165818415113, 6.97447891102505, 6.92755790627832, 6.91869521902047, +6.96413561241824, 6.94793706861497, 6.93634273583405) +N1 <- +288 +y0 <- +c(8.613, 7.105, 6.896, 5.63835466933375, 6.35088571671474, 5.03043792139244, +5.8664680569333, 5.73979291217923, 7.07834157955767, 8.56655462095396, +6.86171134048073, 6.97354301952014, 7.34213173058472, 8.82629423124132, +6.48768401848461, 6.66440902035041, 7.0343879299155, 4.49980967033027, +6.85118492749374, 3.04452243772342, 8.63905677917308, 1.79175946922805, +7.01660968389422, 7.09090982207998, 7.42356844425917, 8.09620827165004, +5.70711026474888, 7.01031186730723, 7.18311170174328, 8.15219801586179, +5.99645208861902, 7.0825485693553, 5.06890420222023, 7.04228617193974, +4.0943445622221, 7.32052696227274, 7.12689080889881, 7.24136628332232, +6.62007320653036, 7.36897040219479, 8.47720418319987, 7.20340552108309, +2.89037175789616, 7.39141523467536, 6.25190388316589, 8.38160253710989, +11.5129154649202, 6.60258789218934, 7.61283103040736, 7.42476176182321, +6.71174039505618, 5.56068163101553, 6.0282785202307, 7.10085190894405, +7.52671756135271, 7.92948652331429, 1.6094379124341, 6.85856503479136, +8.05006542291597, 5.83188247728352, 7.15851399732932, 7.01481435127554, +7.70120018085745, 7.16239749735572, 5.99893656194668, 5.41610040220442, +8.40782465436087, 7.18462915271731, 3.25809653802148, 8.14380797677148, +5.24702407216049, 5.73979291217923, 4.55387689160054, 7.72444664563354, +7.91425227874244, 7.11476944836646, 8.24064886337491, 8.56044423341055, +6.78558764500793, 10.8861838116069, 2.07944154167984, 5.82894561761021, +4.0943445622221, 7.53208814354172, 5.66988092298052, 3.46573590279973, +10.7229148990064, 8.02910705461974, 9.23092700558457, 6.42971947803914, +11.5129154649202, 7.25700270709207, 6.62007320653036, 9.41995278900604, +5.28826703069454, 8.04654935728308, 7.58984151218266, 6.39024066706535, +6.04025471127741, 2.77258872223978, 7.62948991639399, 7.85476918349913, +7.09007683577609, 5.50125821054473, 6.98100574072173, 5.50533153593236 +) diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.data.json b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.data.json new file mode 100644 index 000000000..10d00bf04 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.data.json @@ -0,0 +1,8 @@ +{ + "Yvec1": [4.997, 6.83, 3.95124371858143, 6.79794041297493, 4.71849887129509, 5.78996017089725, 6.13122648948314, 6.76272950693188, 6.14846829591765, 10.7579879834538, 5.63121178182137, 3.46573590279973, 7.92479591395644, 9.16115012778541, 8.74257423767064, 5.91079664404053, 6.54678541076052, 2.94443897916644, 7.05272104923232, 0, 9.13905916997122, 8.48260174664662, 7.11963563801764, 7.64300363556072, 9.42294862137501, 8.2553088117856, 4.82028156560504, 6.54678541076052, 8.67470962929122, 7.86326672400957, 4.67282883446191, 7.41878088275079, 6.84587987526405, 5.46383180502561, 3.43398720448515, 7.7553388128465, 9.04239498112674, 8.45212119467252, 7.91425227874244, 7.72885582385254, 9.31433996199467, 6.35957386867238, 2.30258509299405, 8.29354951506035, 8.90082160491523, 8.87905466204227, 11.5129154649202, 8.79618763547045, 8.40155784781731, 8.89370997756851, 7.1800698743028, 4.82028156560504, 5.77765232322266, 6.4707995037826, 4.40671924726425, 8.17413934342947, 2.30258509299405, 9.77104128523582, 6.95081476844258, 5.97635090929793, 5.8805329864007, 5.73979291217923, 5.75574221358691, 5.15329159449778, 8.11761074646623, 8.54636356871602, 7.58171964012531, 6.9037472575846, 4.66343909411207, 7.47986413116503, 3.61091791264422, 4.64439089914137, 4.39444915467244, 8.23509549725836, 6.12905021006055, 8.4424696452203, 6.88755257166462, 7.29233717617388, 6.38856140554563, 8.75998249497728, 6.08677472691231, 4.02535169073515, 4.38202663467388, 6.85540879860993, 8.17919979842309, 4.24849524204936, 8.98343977178426, 8.4721958254855, 9.480214825778, 6.1463292576689, 9.93542217106647, 4.27666611901606, 5.36597601502185, 4.60517018598809, 3.2188758248682, 6.81783057145415, 6.58479139238572, 5.91889385427315, 8.67641669696422, 2.484906649788, 6.73933662735717, 3.91202300542815, 4.56434819146784, 9.15925758174687, 7.07326971745971, 9.08636319215647, 8.028, 4.905, 4.35670882668959, 5.27299955856375, 3.49650756146648, 3.68887945411394, 3.85014760171006, 3.29583686600433, 5.25749537202778, 10.4925789214972, 4.20469261939097, 1.79175946922805, 7.54750168281497, 8.34236350038058, 7.07580886397839, 5.11198778835654, 4.93447393313069, 3.17805383034795, 6.25382881157547, 7.19067603433221, 7.82724090175281, 7.51697722460432, 5.8348107370626, 6.35610766069589, 8.57073395834427, 7.16394668434255, 3.40119738166216, 5.95583736946483, 7.32383056620232, 7.63385355968177, 3.36729582998647, 6.76157276880406, 8.38845031552351, 9.9219166880045, 1.6094379124341, 7.44366368311559, 6.64768837356333, 6.85118492749374, 6.16961073249146, 9.75214127004149, 8.26359043261732, 5.84643877505772, 0, 7.60589000105312, 6.25958146406492, 8.88391747120797, 8.54286093816481, 7.86095636487639, 6.91075078796194, 7.59588991771854, 7.03174125876313, 2.99573227355399, 3.91202300542815, 5.4510384535657, 5.12989871492307, 7.88419993367604, 2.30258509299405, 9.32892308780313, 10.5472081164337, 5.71042701737487, 6.50128967054039, 5.53338948872752, 4.99043258677874, 3.61091791264422, 7.34729970074316, 8.03138533062553, 6.92264389147589, 6.7202201551353, 3.43398720448515, 6.19236248947487, 3.78418963391826, 4.51085950651685, 3.55534806148941, 7.81116338502528, 6.19847871649231, 3.55534806148941, 5.07517381523383, 7.25417784645652, 6.21460809842219, 7.19593722647557, 4.66343909411207, 3.78418963391826, 2.484906649788, 6.08221891037645, 6.04500531403601, 3.52636052461616, 9.69990150043745, 7.76004068088038, 7.78113850984502, 6.289715570909, 9.39806397805913, 5.34710753071747, 5.88887795833288, 5.29831736654804, 4.27666611901606, 3.46573590279973, 7.2152399787301, 5.68357976733868, 7.72179177681754, 1.38629436111989, 6.73221070646721, 5.4971682252932, 2.83321334405622, 8.58073121222023, 7.12608727329912, 7.9359451033537, 6.295, 4.31748811353631, 4.29045944114839, 3.43398720448515, 5.37527840768417, 3.49650756146648, 2.77258872223978, 6.40687998606931, 7.9483852851119, 6.3919171133926, 5.37989735354046, 5.86929691313377, 5.34233425196481, 4.45434729625351, 6.5424719605068, 6.89365635460264, 8.79026911147866, 7.46278915741245, 3.66356164612965, 4.99721227376411, 8.03040956213048, 7.16006920759613, 3.17805383034795, 6.31535800152233, 2.77258872223978, 7.82803803212583, 7.11151211649616, 7.01481435127554, 6.00881318544259, 9.59703032475801, 2.30258509299405, 10.1017644761202, 7.06561336359772, 8.97575663051942, 7.08757370555797, 7.22256601882217, 2.07944154167984, 2.70805020110221, 3.61091791264422, 3.85014760171006, 7.22766249872866, 0, 9.61767040669386, 8.66905554072548, 5.24174701505964, 5.48479693349065, 4.04305126783455, 6.55250788703459, 7.35115822643069, 6.52502965784346, 5.74939298590825, 3.09104245335832, 2.99573227355399, 3.29583686600433, 7.54855597916987, 4.81218435537242, 2.94443897916644, 5.03043792139244, 2.39789527279837, 2.94443897916644, 5.45958551414416, 3.58351893845611, 8.74097653801779, 5.87493073085203, 9.17294998275762, 3.46573590279973, 3.36729582998647, 3.58351893845611, 7.63867982387611, 5.90808293816893, 5.8171111599632, 6.19031540585315, 2.56494935746154, 4.51085950651685, 4.39444915467244, 5.01063529409626], + "idxn1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 2, 4, 5, 6, 9, 11, 12, 13, 14, 15, 16, 17, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 37, 38, 39, 40, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 79, 81, 82, 84, 86, 87, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 105], + "tvec1": [6.541, 5.8406416573734, 6.60123011872888, 5.8636311755981, 5.91350300563827, 5.91889385427315, 5.87493073085203, 5.82008293035236, 5.91350300563827, 5.98896141688986, 5.95064255258773, 5.75574221358691, 5.92157841964382, 5.93489419561959, 5.91350300563827, 5.97126183979046, 5.97126183979046, 6.59987049921284, 5.92157841964382, 6.71780469502369, 5.92958914338989, 5.92157841964382, 5.92157841964382, 5.92157841964382, 5.92157841964382, 5.8406416573734, 5.89440283426485, 5.93489419561959, 5.93224518744801, 5.96870755998537, 5.8805329864007, 6.62671774924902, 5.87773578177964, 6.59030104819669, 5.92958914338989, 5.92958914338989, 5.86078622346587, 5.89440283426485, 5.95064255258773, 5.93224518744801, 5.97126183979046, 6.57088296233958, 5.93753620508243, 5.87493073085203, 5.89164421182577, 6.74170069465205, 5.89440283426485, 5.94803498918065, 5.77455154554441, 5.97126183979046, 5.96870755998537, 5.8805329864007, 5.89440283426485, 6.62936325343745, 5.93224518744801, 5.99146454710798, 5.88887795833288, 5.93489419561959, 5.94017125272043, 5.95583736946483, 5.93489419561959, 5.92692602597041, 6.64639051484773, 5.93224518744801, 5.96870755998537, 5.93224518744801, 5.93224518744801, 5.93224518744801, 5.94542060860658, 5.86929691313377, 6.65801104587075, 5.89715386763674, 6.00881318544259, 5.97126183979046, 5.97126183979046, 5.97126183979046, 6.00881318544259, 6.64639051484773, 5.88610403145016, 5.75257263882563, 5.68017260901707, 5.77144112313002, 5.96100533962327, 5.75257263882563, 5.81413053182507, 5.63478960316925, 5.77455154554441, 5.77765232322266, 5.63121178182137, 5.70711026474888, 5.89164421182577, 5.77455154554441, 6.0591231955818, 5.8171111599632, 5.65248918026865, 5.60947179518496, 5.83773044716594, 5.91350300563827, 5.77455154554441, 5.83773044716594, 5.98645200528444, 5.8171111599632, 6.49526555593701, 5.68697535633982, 5.8171111599632, 5.85793315448346, 6.963, 6.52941883826223, 7.02553831463852, 6.51767127291227, 6.5694814204143, 6.5694814204143, 6.97447891102505, 6.56244409369372, 6.5510803350434, 7.0335064842877, 6.59987049921284, 6.65544035036765, 6.70686233660275, 6.63987583382654, 6.63987583382654, 6.55961523749324, 6.60123011872888, 7.00215595440362, 6.68959926917897, 6.98286275146894, 6.56807791141198, 6.71780469502369, 6.54821910276237, 6.54821910276237, 6.54821910276237, 6.54821910276237, 6.49072353450251, 6.70686233660275, 6.56103066589657, 6.52795791762255, 6.56244409369372, 6.94889722231331, 6.54965074223381, 7.00669522683704, 6.56807791141198, 6.56807791141198, 6.55819780281227, 6.59030104819669, 6.51767127291227, 6.70196036600254, 6.60934924316738, 7.01571242048723, 6.5206211275587, 6.56103066589657, 6.59030104819669, 6.98933526597456, 6.5410299991899, 6.5510803350434, 6.49828214947643, 6.54965074223381, 6.58892647753352, 6.59030104819669, 6.5410299991899, 6.98471632011826, 6.62007320653036, 6.63856778916652, 6.59441345974978, 6.61873898351722, 6.62140565176413, 6.62936325343745, 6.61873898351722, 6.61204103483309, 7.04403289727469, 6.62007320653036, 6.64639051484773, 6.64768837356333, 6.62007320653036, 6.62671774924902, 6.62140565176413, 6.5875500148248, 7.05875815251866, 6.59714570188665, 6.62936325343745, 6.66568371778241, 6.66440902035041, 6.66440902035041, 7.05185562295589, 7.04403289727469, 6.59167373200866, 6.96129604591017, 6.50876913697168, 6.56244409369372, 6.66695679242921, 6.49828214947643, 7.02108396428914, 6.46769872610435, 6.48768401848461, 6.52209279817015, 6.55535689181067, 6.45833828334479, 6.48920493132532, 6.48920493132532, 6.62671774924902, 6.49223983502047, 6.42162226780652, 6.44413125670044, 6.48616078894409, 6.52649485957079, 6.45047042214418, 6.48463523563525, 6.51025834052315, 6.48463523563525, 6.94215670569947, 6.47850964220857, 6.51174532964473, 6.92264389147589, 6.98193467715639, 6.96790920180188, 7.00850518208228, 7.00760061395185, 7.00306545878646, 7.00940893270864, 6.9555926083963, 6.98286275146894, 6.9782137426307, 6.9782137426307, 7.00124562206948, 7.00033446027523, 6.96224346426621, 6.98286275146894, 6.98193467715639, 6.98193467715639, 6.98100574072173, 6.98100574072173, 6.95654544315157, 7.00306545878646, 7.0335064842877, 6.94215670569947, 6.97728134163075, 6.98841318199959, 6.98193467715639, 6.98193467715639, 6.97447891102505, 6.98378996525813, 6.97447891102505, 6.97447891102505, 6.97073007814353, 6.97447891102505, 6.98378996525813, 6.98286275146894, 6.99668148817654, 6.95844839329766, 7.01481435127554, 6.98378996525813, 6.98286275146894, 7.03174125876313, 7.04053639021596, 7.02908756414966, 7.04577657687951, 7.05272104923232, 7.05272104923232, 7.04490511712937, 7.04141166379481, 7.03174125876313, 7.028201432058, 7.03174125876313, 7.02731451403978, 7.05272104923232, 7.03174125876313, 7.03966034986208, 7.03878354138854, 7.04403289727469, 7.04403289727469, 7.028201432058, 6.97541392745595, 6.99759598298193, 6.99025650049388, 6.95081476844258, 6.92067150424868, 6.91473089271856, 6.92165818415113, 6.92165818415113, 7.01391547481053, 6.94119005506837, 6.86380339145295, 6.92165818415113, 6.97447891102505, 6.92755790627832, 6.91869521902047, 6.96413561241824, 6.94793706861497, 6.93634273583405], + "y0": [8.613, 7.105, 6.896, 5.63835466933375, 6.35088571671474, 5.03043792139244, 5.8664680569333, 5.73979291217923, 7.07834157955767, 8.56655462095396, 6.86171134048073, 6.97354301952014, 7.34213173058472, 8.82629423124132, 6.48768401848461, 6.66440902035041, 7.0343879299155, 4.49980967033027, 6.85118492749374, 3.04452243772342, 8.63905677917308, 1.79175946922805, 7.01660968389422, 7.09090982207998, 7.42356844425917, 8.09620827165004, 5.70711026474888, 7.01031186730723, 7.18311170174328, 8.15219801586179, 5.99645208861902, 7.0825485693553, 5.06890420222023, 7.04228617193974, 4.0943445622221, 7.32052696227274, 7.12689080889881, 7.24136628332232, 6.62007320653036, 7.36897040219479, 8.47720418319987, 7.20340552108309, 2.89037175789616, 7.39141523467536, 6.25190388316589, 8.38160253710989, 11.5129154649202, 6.60258789218934, 7.61283103040736, 7.42476176182321, 6.71174039505618, 5.56068163101553, 6.0282785202307, 7.10085190894405, 7.52671756135271, 7.92948652331429, 1.6094379124341, 6.85856503479136, 8.05006542291597, 5.83188247728352, 7.15851399732932, 7.01481435127554, 7.70120018085745, 7.16239749735572, 5.99893656194668, 5.41610040220442, 8.40782465436087, 7.18462915271731, 3.25809653802148, 8.14380797677148, 5.24702407216049, 5.73979291217923, 4.55387689160054, 7.72444664563354, 7.91425227874244, 7.11476944836646, 8.24064886337491, 8.56044423341055, 6.78558764500793, 10.8861838116069, 2.07944154167984, 5.82894561761021, 4.0943445622221, 7.53208814354172, 5.66988092298052, 3.46573590279973, 10.7229148990064, 8.02910705461974, 9.23092700558457, 6.42971947803914, 11.5129154649202, 7.25700270709207, 6.62007320653036, 9.41995278900604, 5.28826703069454, 8.04654935728308, 7.58984151218266, 6.39024066706535, 6.04025471127741, 2.77258872223978, 7.62948991639399, 7.85476918349913, 7.09007683577609, 5.50125821054473, 6.98100574072173, 5.50533153593236], + "N": 106, + "N1": 288 +} diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.stan b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.stan new file mode 100644 index 000000000..be86e120b --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/hepatitisME.stan @@ -0,0 +1,74 @@ +// Hepatitis: a normal hierarchical model with measurement +// error +// http://openbugs.net/Examples/Hepatitis.html + +// model the measurement eror here (compared with hepatitis.stan) + +//# note that we have missing data in the orignal data Y[N, T]; +//# here, we turn Y[N, T] into Yvec with the missing +//# data removed. + +data { + int N1; //# N1 is the length of the vector, Yvec1, that is + int N; //# created from concatenate columns of matrix Y[N, T] + array[N1] real Yvec1; //# with NA's removed. + array[N1] real tvec1; //# N is the nrow of original matrix Y[N, T] + array[N1] int idxn1; //# idxn1 maps Yvec to its orignal n index + array[N] real y0; +} +transformed data { + real y0_mean; + y0_mean = mean(y0); +} +parameters { + real sigmasq_y; + real sigmasq_alpha; + real sigmasq_beta; + real sigma_mu0; + real gamma; + real alpha0; + real beta0; + real theta; + array[N] real mu0; + array[N] real alpha; + array[N] real beta; +} +transformed parameters { + real sigma_y; + real sigma_alpha; + real sigma_beta; + sigma_y = sqrt(sigmasq_y); + sigma_alpha = sqrt(sigmasq_alpha); + sigma_beta = sqrt(sigmasq_beta); +} +model { + int oldn; + array[N1] real m; + for (n in 1 : N1) { + oldn = idxn1[n]; + m[n] = alpha[oldn] + beta[oldn] * (tvec1[n] - 6.5) + + gamma * (mu0[oldn] - y0_mean); + } + Yvec1 ~ normal(m, sigma_y); + + mu0 ~ normal(theta, sigma_mu0); + //# It is a bit weird that to specify gamma prior on sigma_mu0 instead on gamma_mu0^2 + //# in the bugs example. + + for (n in 1 : N) { + y0[n] ~ normal(mu0[n], sigma_y); + } + + alpha ~ normal(alpha0, sigma_alpha); + beta ~ normal(beta0, sigma_beta); + + sigmasq_y ~ inv_gamma(.001, .001); + sigmasq_alpha ~ inv_gamma(.001, .001); + sigmasq_beta ~ inv_gamma(.001, .001); + sigma_mu0 ~ inv_gamma(.001, .001); + + alpha0 ~ normal(0, 1000); + beta0 ~ normal(0, 1000); + gamma ~ normal(0, 1000); + theta ~ normal(0, 1000); +} diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/makefile b/benchmark/stan/bugs_examples/vol3/hepatitis/makefile new file mode 100644 index 000000000..024373d08 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/makefile @@ -0,0 +1,17 @@ +STAN_HOME = ../../../../.. +PGM = hepatitis# +PGM = hepatitisME# +CXX = g++ +CXX = clang++ +BOOSTPATH = $(shell find $(STAN_HOME)/lib -path '*lib/boost_*' -regex '.*lib\/boost_[^/]*') +EIGENPATH = $(shell find $(STAN_HOME)/lib -path '*lib/eigen_*' -regex '.*lib\/eigen_[^/]*') +CPPFLAGS = -I $(BOOSTPATH) -I$(EIGENPATH) -I $(STAN_HOME)/src +LIBFLAGS = -L$(STAN_HOME)/bin -lstan + +$(PGM) : + $(STAN_HOME)/bin/stanc --name=$(PGM) $(PGM).stan + $(CXX) -O3 -DNDEBUG $(CPPFLAGS) $(PGM).cpp -o $(PGM) $(LIBFLAGS) + ./$(PGM) data=$(PGM).data.R sample + +clean : + rm -f $(PGM).cpp samples.csv $(PGM) diff --git a/benchmark/stan/bugs_examples/vol3/hepatitis/post.R b/benchmark/stan/bugs_examples/vol3/hepatitis/post.R new file mode 100644 index 000000000..214a6e9b2 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/hepatitis/post.R @@ -0,0 +1,19 @@ +library(coda) +post <- read.csv(file = 'samples.csv', header = TRUE, comment.char = '#') + + +pars <- c("gamma", "alpha0", "beta0", "sigma_y", "sigma_alpha", "sigma_beta"); +poi <- post[, pars] +summary(as.mcmc(poi)) + + +## for some reason, it does not work here to use JAGS +## run this example. +# library(BUGSExamples); +# pars <- c("gamma", "alpha0", "beta0", "sigma"); +# ex <- list(name = "HepatitisME", parameters = pars, +# nSample = 10000, nBurnin = 1000, nThin = 1, +# nChain = 3) +# +# jagspost <- runExample(ex, engine = "JAGS") +# summary(jagspost) diff --git a/benchmark/stan/bugs_examples/vol3/jama/jama.stan.0 b/benchmark/stan/bugs_examples/vol3/jama/jama.stan.0 new file mode 100644 index 000000000..efac540b9 --- /dev/null +++ b/benchmark/stan/bugs_examples/vol3/jama/jama.stan.0 @@ -0,0 +1,79 @@ +# http://www.openbugs.net/Examples/Jama.html +# Jama River Valley Ecuador - Radiocarbon calibration with phase information + +# It turns out that the model specified in OpenBUGS +# has *cycles*, which is not support by Stan (and JAGS). +# In section `Directed cycles` of JAGS manual, it writes +# +# Directed cycles are forbidden in JAGS. There are two important instances +# where directed +# cycles are used in BUGS. +# * Defining autoregressive priors +# * Defining ordered priors + +data { + int K; + int I; + int J; + ordered(K) calBP; + ordered(K) C14BP; + int N; + real theta_min; + real theta_max; + real X[N]; + real sigma[N]; + int phase[N]; +} +parameters { + real alpha_desc[7]; + int beta_desc[7]; + for (m in 1:7) { + // round to nearest 10 + alpha_desc[m] <- 10 * round(alpha[m] / 10.0); + beta_desc[m] <- 10 * round(beta[m] / 10.0); + } +}