Skip to content

Instantly share code, notes, and snippets.

@piroyoung
Last active January 4, 2016 12:29
Show Gist options
  • Save piroyoung/8621896 to your computer and use it in GitHub Desktop.
Save piroyoung/8621896 to your computer and use it in GitHub Desktop.
Sampling on rStan
library(rstan)
library(coda)
setwd("~/R/stan_pois")
dat <- read.csv("data3a.csv",header = TRUE)
dat$f <- as.numeric(dat$f) -1 #カテゴリカルを01に変換
listed.dat <- list(x = dat$x , y = dat$y, f = dat$f, N=100)
fit<-stan(file="model.stan",data=conflict.dat,iter=5000,chains=3)
traceplot(fit)
plot(fit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment