This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This model is based on the multinomial model in Bayesian Data Analysis 3, p426. | |
I used the multinomial regression example from the Stan website | |
https://mc-stan.org/docs/2_27/stan-users-guide/multi-logit-section.html and | |
then modified it to match our model. | |
For this model to work, you need an up to date version of `rstan`, at least | |
2.26.2. Follow the instructions here: https://mc-stan.org/r-packages/ to | |
upgrade your `rstan` if you have an old version. You can check which version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt install -y build-essential | |
sudo apt install -y git | |
sudo apt install -y zlib1g-dev | |
sudo apt install -y libxml2-dev | |
sudo apt install -y gfortran | |
sudo apt install -y libclang-dev | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> library(devtools) | |
> test() | |
Loading blma | |
Error in processx::run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), : | |
System command error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matrix_str = """\\sigma^2_{\\text{intercept}} & & & & & | |
\\rho_{\\text{intercept} x} & \\sigma^2_x & \\ldots | |
\\rho_{\\text{intercept} x^2} & \\rho_{x x^2} & \\sigma^2_{x^2} & \\ldots | |
\\rho_{\\text{intercept} x^3} & \\rho_{x x^3} & \\rho_{x^2 x^3} & \\sigma^2_{x^3} & \\ldots | |
0 & \\rho_{x (x - \\kappa_1)^3_+} & \\rho_{x^2 (x-\\kappa_1)_+^3} & \\rho_{x^3 (x - \\kappa_1)_+^3} & \\sigma^2_{(x - \\kappa_1)_+^3} & \\ldots | |
0 & 0 & \\rho_{x^2 (x-\\kappa_2)_+^3} & \\rho_{x^3 (x-\\kappa_2)_+^3} & \\rho_{(x-\\kappa_1)_+^3 (x-\\kappa_2)_+^3} & \\sigma^2_{(x - \\kappa_2)_+^3} | |
0 & 0 & 0 & \\rho_{x^3 (x - \\kappa_3)_+^3} & \\rho_{(x - \\kappa_1)_+^3 (x - \\kappa_3)_+^3} & \\rho_{(x - \\kappa_2)_+^3 (x - \\kappa_3)_+^3} & \\sigma^2_{(x - \\kappa_3)_+^3} """ | |
lines = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters_tbl <- parameters_tbl %>% | |
mutate(sampler_mGamma=map(sampler_result, "mGamma"), | |
sampler_vip=map(sampler_mGamma, ~apply(.x, 2, mean)), | |
blma_vip=map(blma_result, "vinclusion_prob"), | |
error=map2_dbl(sampler_vip, blma_vip, ~sum((.x - .y)^2))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
travis_fold:start:worker_info | |
[0K[33;1mWorker information[0m | |
hostname: 6dc47c14-8e9d-4f9f-81c7-9b5fdf8db233@1.production-5-worker-org-a-1-gce | |
version: v3.6.0 https://github.com/travis-ci/worker/tree/170b2a0bb43234479fd1911ba9e4dbcc36dadfad | |
instance: travis-job-1af23089-3d0d-47c3-ac95-49d98f31b7d4 travis-ci-amethyst-trusty-1512508224-986baf0 (via amqp) | |
startup: 27.327058835s | |
travis_fold:end:worker_info | |
[0Ktravis_fold:start:system_info | |
[0K[33;1mBuild system information[0m | |
Build language: r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(purrr) | |
vp <- c(10, 20, 50, 100, 500, 1000) | |
vn <- c(1.1, 1.25, 1.5, 2, 5, 10) | |
vR2 <- seq(from=0.00, to=1.00, by = 1e-2) | |
df <- map(vp, function(p) { | |
map(vn, function(n) { | |
map(vR2, function(R2) {c(p*n, p, R2)}) | |
}) | |
}) %>% as.data.frame %>% t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN"> | |
<html><head> | |
<title>HardInfo (0.5.1) System Report</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<style> | |
body { background: #fff } | |
.title { font: bold 130% serif; color: #0066FF; padding: 30px 0 10px 0 } | |
.stitle { font: bold 100% sans-serif; color: #0044DD; padding: 30px 0 10px 0 } | |
.sstitle{ font: bold 80% serif; color: #000000; background: #efefef } | |
.field { font: 80% sans-serif; color: #000000; padding: 2px; padding-left: 50px } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <iostream> | |
#include <climits> | |
#include <vector> | |
#include <algorithm> | |
#include <string> | |
// #include <boost/dynamic_bitset.hpp> | |
using namespace std; | |
// using namespace boost; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
greycode <- function(p) | |
{ | |
A <- matrix(c(0,1),2,1) | |
if (p!=1) { | |
for (i in 2:p) { | |
P <- nrow(A) | |
inds <- rev(1:P) | |
A1 <- matrix(c(rep(0,P),rep(1,P)),2*P,1) | |
A2 <- rbind(A,matrix(A[inds,],nrow(A),ncol(A))) | |
A <- cbind(A1,A2) |
NewerOlder