Last active
September 22, 2022 16:51
-
-
Save herbps10/219f08e93239a00c727482deb15cb1b1 to your computer and use it in GitHub Desktop.
Minimum Reproducible Example: Stan Include 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
Compiling Stan program... | |
Syntax error in '/var/folders/mw/nw_yn9hs0wd6flz32fwr81sh0000gn/T/RtmphVRHT8/model-9541147ec224.stan', line 2, column 0, include error: | |
------------------------------------------------- | |
1: functions { | |
2: #include multiply.stan | |
^ | |
3: } | |
4: data { | |
------------------------------------------------- | |
Could not find include file multiply.stan in specified include paths. | |
make: *** [/var/folders/mw/nw_yn9hs0wd6flz32fwr81sh0000gn/T/RtmphVRHT8/model-9541147ec224.hpp] Error 1 | |
Error: An error occured during compilation! See the message above for more information. |
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(cmdstanr) | |
cmdstan_model("./model.stan") | |
cmdstan_model("./model.stan", include_paths = ".") | |
cmdstan_model("./model.stan", include_paths = "~/stanmre") | |
cmdstan_model("./model.stan", include_paths = "~/stanmre/") | |
cmdstan_model("./model.stan", include_paths = "/Users/herb/stanmre") | |
cmdstanr::cmdstan_version() | |
sessionInfo() |
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 { | |
#include multiply.stan | |
} | |
data { | |
int<lower=0> N; | |
vector[N] y; | |
} | |
parameters { | |
real mu; | |
real<lower=0> sigma; | |
} | |
model { | |
y ~ normal(mu, sigma); | |
} |
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
real multiply(real x, real y) { | |
return x * y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment