Skip to content

Commit

Permalink
remove options(mc.cores = parallel::detectCores())
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Oct 20, 2019
1 parent cda486e commit 9697810
Show file tree
Hide file tree
Showing 101 changed files with 315 additions and 2,441 deletions.
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_apc.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis

Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_apc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis
```
Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_building.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis

Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_building.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis
```
Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_building_optimizing.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis

Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_building_optimizing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis
```
Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis

Expand Down
1 change: 0 additions & 1 deletion Arsenic/arsenic_logistic_residuals.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("loo")
invlogit <- plogis
```
Expand Down
1 change: 0 additions & 1 deletion Beauty/beauty.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion Beauty/beauty.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion Congress/congress.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())

#' **Load and pre-process data**
congress <- vector("list", 49)
Expand Down
1 change: 0 additions & 1 deletion Congress/congress.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
```

**Load and pre-process data**
Expand Down
1 change: 0 additions & 1 deletion DifferentSoftware/linear.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
#' **Load packages**
library("arm")
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("brms")

#' **Create fake data**
Expand Down
1 change: 0 additions & 1 deletion DifferentSoftware/linear.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
```{r }
library("arm")
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("brms")
```

Expand Down
5 changes: 2 additions & 3 deletions Earnings/earnings_compound.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand All @@ -38,15 +37,15 @@ height_jitter_add <- runif(n, -.2, .2)
#+ results='hide'
fit_2a <- stan_glm(positive ~ height + male,
family = binomial(link = "logit"),
data = earnings_all)
data = earnings_all, refresh = 0)
sims_2a <- as.matrix(fit_2a)
#+
print(fit_2a, digits=2)

#' **Linear regression on log scale**
earnings$log_earn <- log(earnings$earn)
#+ results='hide'
fit_2b <- stan_glm(log_earn ~ height + male, data = earnings)
fit_2b <- stan_glm(log_earn ~ height + male, data = earnings, refresh = 0)
sims_2b <- as.matrix(fit_2b)
#+
print(fit_2b, digits=2)
Expand Down
5 changes: 2 additions & 3 deletions Earnings/earnings_compound.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand All @@ -44,7 +43,7 @@ height_jitter_add <- runif(n, -.2, .2)
```{r results='hide'}
fit_2a <- stan_glm(positive ~ height + male,
family = binomial(link = "logit"),
data = earnings_all)
data = earnings_all, refresh = 0)
sims_2a <- as.matrix(fit_2a)
```
```{r }
Expand All @@ -57,7 +56,7 @@ print(fit_2a, digits=2)
earnings$log_earn <- log(earnings$earn)
```
```{r results='hide'}
fit_2b <- stan_glm(log_earn ~ height + male, data = earnings)
fit_2b <- stan_glm(log_earn ~ height + male, data = earnings, refresh = 0)
sims_2b <- as.matrix(fit_2b)
```
```{r }
Expand Down
72 changes: 0 additions & 72 deletions Earnings/earnings_loo.R

This file was deleted.

1 change: 0 additions & 1 deletion Earnings/earnings_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion Earnings/earnings_regression.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion ElectionsEconomy/hibbs.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion ElectionsEconomy/hibbs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("ggplot2")
library("bayesplot")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion ElectionsEconomy/hibbs_coverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())

#' **Load data**
hibbs <- read.table(root("ElectionsEconomy/data","hibbs.dat"), header=TRUE)
Expand Down
1 change: 0 additions & 1 deletion ElectionsEconomy/hibbs_coverage.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
```

**Load data**
Expand Down
1 change: 0 additions & 1 deletion ElectionsEconomy/hills.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("arm")
library("rstanarm")
options(mc.cores = parallel::detectCores())

#' **Load data**
hibbs <- read.table(root("ElectionsEconomy/data","hibbs.dat"), header=TRUE)
Expand Down
1 change: 0 additions & 1 deletion ElectionsEconomy/hills.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("arm")
library("rstanarm")
options(mc.cores = parallel::detectCores())
```

**Load data**
Expand Down
1 change: 0 additions & 1 deletion ElectricCompany/electric.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
invlogit <- plogis

#' **Load data**
Expand Down
1 change: 0 additions & 1 deletion ElectricCompany/electric.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
invlogit <- plogis
```

Expand Down
1 change: 0 additions & 1 deletion FakeKCV/fake_kcv.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("MASS") # needed for mvrnorm()
library("rstanarm")
library("loo")
options(mc.cores = parallel::detectCores())
#' Set random seed for reproducability
SEED <- 1754

Expand Down
1 change: 0 additions & 1 deletion FakeKCV/fake_kcv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(message=FALSE, error=FALSE, warning=FALSE, comment=NA)
library("MASS") # needed for mvrnorm()
library("rstanarm")
library("loo")
options(mc.cores = parallel::detectCores())
```

Set random seed for reproducability
Expand Down
1 change: 0 additions & 1 deletion FakeMidtermFinal/FakeMidtermFinal.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ savefigs <- FALSE

#' **Load packages**
library("rstanarm")
options(mc.cores = parallel::detectCores())

#' **Simulate fake data**
N <- 1000
Expand Down
1 change: 0 additions & 1 deletion FakeMidtermFinal/FakeMidtermFinal.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE

```{r }
library("rstanarm")
options(mc.cores = parallel::detectCores())
```

**Simulate fake data**
Expand Down
1 change: 0 additions & 1 deletion Golf/golf.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstan")
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
library("rstanarm")
invlogit <- plogis

Expand Down
1 change: 0 additions & 1 deletion Golf/golf.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstan")
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
library("rstanarm")
invlogit <- plogis
```
Expand Down
1 change: 0 additions & 1 deletion Imputation/imputation.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())

#' **Load data**
source(root("Imputation/data","imputation_setup.R"))
Expand Down
1 change: 0 additions & 1 deletion Imputation/imputation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
```

**Load data**
Expand Down
1 change: 0 additions & 1 deletion Imputation/imputation_gg.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("dplyr")
library("ggplot2")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
1 change: 0 additions & 1 deletion Imputation/imputation_gg.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ savefigs <- FALSE
library("rprojroot")
root<-has_dirname("ROS-Examples")$make_fix_file()
library("rstanarm")
options(mc.cores = parallel::detectCores())
library("dplyr")
library("ggplot2")
theme_set(bayesplot::theme_default(base_family = "sans"))
Expand Down
Loading

0 comments on commit 9697810

Please sign in to comment.