Skip to content

Instantly share code, notes, and snippets.

View jwdink's full-sized avatar

Jacob jwdink

  • Strong Analytics
  • Chicago, IL
View GitHub Profile
@jwdink
jwdink / xcory_sim.R
Last active September 22, 2020 02:30
regression where predictors are correlated with past values of y
library('dplyr')
library('tidyr')
library('pbapply')
#' simulate()
#'
#' @param num_groups Number of groups
#' @param num_per_group Number of observations per group
#' @param true_coef The true `beta_1` in `Y_t ~ beta_0 + beta_1*X_t`
#' @param phi A function that takes Y_t-1,...,Y_t and returns Xt