Skip to content

Pakillo/Miscellaneous-R-Code

 
 

Repository files navigation

Miscellaneous (mostly) R Code

This is a place for miscellaneous R and other code I've put together for clients, co-workers or myself for learning and demonstration purposes. The attempt is made to put together some well-commented and/or conceptually clear code from scratch, though most functionality is readily available in any number of well-developed R packages. Typically, examples are provided using such packages for comparison of results. I would say most of these are geared toward intermediate to advanced folks that want to dig a little deeper into the models and underlying algorithms.

More recently, if it gets more involved, I usually just create a document of some kind rather than a standard *.R file, so you might check out the docs repo as well.

Model Fitting

Code related to fitting of various models.

standard regression, penalized regression, lasso regression, ridge regression, newton and IRLS, nelder-mead (Python) (R), gradient descent regression (online), one factor random effects (R) (Julia) (Matlab), two factor random effects (R) (Julia) (Matlab), mixed model via ML, bivariate probit, heckman selection, tobit, naive bayes, multinomial regression, ordinal regression, quantile regression, cubic spline, hurdle poisson, hurdle negbin, zero-inflated poisson, zero-inflated negbin, Cox survival, confirmatory factor analysis, Markov model, hidden Markov model (R) (Python), EM mixture univariate, EM mixture multivariate, EM probit, EM pca, EM probabilistic pca, EM state space model, Gaussian Process noisy, Gaussian Process noise-free, reproducing kernel hilbert space regression, stochastic volatility, extreme learning machine, Chinese restaurant process, Indian buffet process, One-line models (an exercise), ...

Bayesian (mostly with Stan/rstan)

BEST t-test, linear regression (Compare with BUGS version, JAGS), mixed model, mixed model with correlated random effects, beta regression, mixed model with beta response (Stan) (JAGS), mixture model, topic model, multinomial models, multilevel mediation, variational bayes regression, gaussian process, horseshoe prior, item response theory, ...

SC and TR

This part of the repository is deprecated, but used to be a section of 'short courses' and 'technical reports'. See the Workshops or docs repositories instead, or go to the workshops and documents sections of the website where you can see finished products ...

Other

Random shenanigans.

FizzBuzz test (R) (julia) (Python), Reverse a string recursively (R) (Python), Recursive Word Wrap (R) (Python), calculate compound interest recursively, get US Congress roll call data, Scrape xkcd (R) (Python), Shakespearean Insulter, ggplot2 theme, spurious correlation with ratios, R matrix speedups, ...

About

Miscellaneous code that might be useful to others for learning/demonstration purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 78.5%
  • Stan 15.3%
  • Python 3.4%
  • Julia 1.3%
  • MATLAB 1.1%
  • CSS 0.2%
  • Rebol 0.2%