Skip to content

Instantly share code, notes, and snippets.

View coatless's full-sized avatar
☠️
I may be slow to respond.

James J Balamuta coatless

☠️
I may be slow to respond.
View GitHub Profile
@coatless
coatless / rstan-example2-r-macos-rtools.md
Created March 25, 2018 02:00
rstan compiled using the installer from r-macos-rtools
install.packages("rstan", type = "source")
library("rstan")
#> Loading required package: ggplot2
#> Loading required package: StanHeaders
#> rstan (Version 2.17.3, GitRev: 2e1f913d3ca3)
#> For execution on a local, multicore CPU with excess RAM we recommend calling
#> options(mc.cores = parallel::detectCores()).
#> To avoid recompilation of unchanged Stan programs, we recommend calling
#> rstan_options(auto_write = TRUE)

Keybase proof

I hereby claim:

  • I am coatless on github.
  • I am coatless (https://keybase.io/coatless) on keybase.
  • I have a public key ASDlyT2FEqrzkSMu-ve8yuN89B0OHez19KBDtLvKpBu4zgo

To claim this, I am signing this object:

Output:
20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
16,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
14,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
12,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
8,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
6,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
#include <RcppArmadillo.h>
#include <omp.h>
using namespace Rcpp;
using namespace arma;
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::plugins(openmp)]]
// [[Rcpp::export]]
void updateImplicitX_p(arma::mat & X, const arma::mat & Y, const arma::mat & P, const arma::mat & C, double lambda, int cores = 1) {