This file contains hidden or 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
Mike’s Podcast picks | |
———— | |
Comedic (all should be started at S01E01) | |
———— | |
The adventure zone | |
Mission to Zyxx | |
Beef & Dairy Network Podcast | |
———— |
This file contains hidden or 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
functions{ | |
real partial_lpdf( | |
array[] real real_array_to_slice | |
, int start | |
, int end | |
, real sigma | |
, vector Zc | |
, matrix iZc_chol_mat | |
, matrix iZc | |
, array[] matrix iZc_ |
This file contains hidden or 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
Version: 1.0 | |
RestoreWorkspace: No | |
SaveWorkspace: No | |
AlwaysSaveHistory: No | |
QuitChildProcessesOnExit: Yes | |
EnableCodeIndexing: Yes | |
UseSpacesForTab: No | |
NumSpacesForTab: 4 |
This file contains hidden or 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
#' Installs any packages not already installed | |
#' @examples | |
#' \dontrun{ | |
#' install_if_missing(c('tidyverse','github.com/stan-dev/cmdstanr')) | |
#' } | |
install_if_missing = function(pkgs){ | |
missing_pkgs = NULL | |
for(this_pkg in pkgs){ |
This file contains hidden or 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
#' Installs any packages not already installed | |
#' @examples | |
#' \dontrun{ | |
#' install_if_missing(c('tidyverse','github.com/stan-dev/cmdstanr')) | |
#' } | |
install_if_missing = function(pkgs){ | |
missing_pkgs = NULL | |
for(this_pkg in pkgs){ |
This file contains hidden or 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
#preamble (installs/imports & custom functions) ---- | |
# specify the packages used: | |
required_packages = c( | |
'rethinking' #for rlkjcorr & rmvrnom2 | |
, 'crayon' #for coloring terminal output | |
, 'tidyverse' #for all that is good and holy | |
, 'progress' #for progress bar | |
, 'github.com/stan-dev/cmdstanr' #for Stan stuff | |
, 'github.com/mike-lawrence/ezStan' #for extra Stan stuff (here just get_contrast_matrix) |
This file contains hidden or 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
# load packages and define helper functions ---- | |
library(cmdstanr) #for bayes goodness | |
library(posterior) #for posterior::as_draws_df() | |
library(progress) # for progress bars | |
library(viridis) #for better color scales | |
library(tidyverse) #for all that is good and holy | |
# helper function to create a progess bar in the global env | |
create_global_pb = function(x){ | |
pb <<- progress::progress_bar$new( |
This file contains hidden or 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
# load packages used ---- | |
library(tidyverse) | |
library(broom) | |
options(dplyr.show_progress=TRUE) | |
# define a function to simulate an experiment ---- | |
simulate_experiment = function( | |
# simulation parameters ---- | |
within_subject_noise = 1 |
This file contains hidden or 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(tidyverse) | |
library(broom) | |
library(lme4) | |
#set default contrasts to halfsum (this matters!) | |
halfsum_contrasts = function (...) contr.sum(...) * 0.5 | |
options(contrasts = c('halfsum_contrasts','contr.poly')) | |
run_sim = function(N,K,seed,do_checks=F){ |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
structure(list(toj_condition = structure(c(1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, | |
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, |
NewerOlder