Skip to content

Commit

Permalink
Version update and further vignette optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
demsarjure committed Dec 7, 2020
1 parent 013f682 commit 1475472
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Encoding: UTF-8
LazyData: true
ByteCompile: true
Depends:
methods (>= 4.0.3),
R (>= 4.0.3),
methods (>= 4.0.0),
R (>= 4.0.0),
Rcpp (>= 1.0.5)
Imports:
circular (>= 0.4.93),
Expand All @@ -28,8 +28,9 @@ Imports:
rstan (>= 2.21.2),
rstantools (>= 2.1.1),
mcmcse (>= 1.4.1),
stats (>= 4.0.3),
utils (>= 4.0.3)
scales (>= 1.1.1),
stats (>= 4.0.0),
utils (>= 4.0.0)
Suggests:
testthat (>= 3.0.0),
rmarkdown (>= 2.5.0),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/adaptation_level.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ group2_part2 <- data %>% filter(group == 2 & part == 2)
Once the data is prepared we can fit the Bayesian models, the input data comes in the form of three vectors, $x$ stores indexes of the measurements, $y$ subject's responses and $s$ indexes of subjects. Note here that, due to vignette limitations, all fits are built using only one chain, using more chains in parallel is usually more efficient. Also to increase the building speed of vignettes we greatly reduced the amount of iterations, use an appropriate amount of iterations when executing actual analyses!

```{r, message=FALSE, warning=FALSE, results = 'hide'}
# priors
# prior
beta_prior <- b_prior(family="normal", pars=c(0, 1))
# attach priors to relevant parameters
Expand Down
10 changes: 9 additions & 1 deletion vignettes/flanker.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,22 @@ control_rt$subject <- control_rt$subject - 21
Now we are ready to fit the Bayesian reaction time model for both groups. The model function requires two parameters -- a vector of reaction times $t$ and the vector of subject indexes $s$. Note here that, due to vignette limitations, all fits are built using only one chain, using more chains in parallel is usually more efficient. Also to increase the building speed of vignettes we greatly reduced the amount of iterations, use an appropriate amount of iterations when executing actual analyses!

```{r, message=FALSE, warning=FALSE, results = 'hide'}
# prior
uniform_prior <- b_prior(family="uniform", pars=c(0, 3))
# attach priors to relevant parameters
priors <- list(c("mu_m", uniform_prior))
# fit
rt_control_fit <- b_reaction_time(t=control_rt$rt,
s=control_rt$subject,
priors=priors,
chains=1, iter=200, warmup=100)
rt_test_fit <- b_reaction_time(t=test_rt$rt,
s=test_rt$subject,
chains=1, iter=200, warmup=100)
priors=priors,
chains=1, iter=200, warmup=100)
```

Before we interpret the results, we check MCMC diagnostics and model fit.
Expand Down

0 comments on commit 1475472

Please sign in to comment.