Ben, did you change something permanently? I restarted everything (I’m so pissed at this bug now so wanted to make sure), and now it didn’t work… I still get c++ exception (unknown reason) after running fix_Mac() :-(
And now it worked… Sorry. I’m going to bed now - too tired… I’ll check again tomorrow.
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file2df66e793e62.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang7/include/c++/v1/cstdlib:86:
/usr/lo
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file2df66e793e62.cpp 2> file2df66e793e62.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection
Thanks for getting back so quickly! I can’t even make a stan model:
stancode_eightschools ← "data {
int <lower=0> J; // number of schools
real y[J]; // estimated treatment effects
real <lower=0> sigma[J]; // standard error of effect estimates
}
parameters {
real mu; //population treatment effect
real <lower=0> tau; // standard deviation in treatment effects
vector[J] eta; // unscaled deviation from mu by school
}
transformed parameters {
vector[J] theta; // school treatment effects
theta = mu + tau * eta;
}
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file4acf6e15a0.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang7/include/c++/v1/cstdlib:86:
/usr/loca
mod ← stan_model(model_code = stancode_MR1)
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file4ac518c0d43.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang7/include/c++/v1/cstdlib:86:
/usr/loc
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file4ac518c0d43.cpp 2> file4ac518c0d43.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection
This RCPP works for me so I suspect my problem is not compiler paths. However, the sampling still does not work even when fix_MAC from post 53
n=1000
x=-log(runif(n))
library(rstan)
source('FixMAC.R')
fitted_model = stan_model(file='pareto_gfi.stan')
fix_Mac(fitted_model)
stan_data <- list(y=x, N = n, ymin = 0)
stan_fit = sampling(fitted_model, data = stan_data)
and getting:
SAMPLING FOR MODEL 'pareto_gfi' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.002659 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 26.59 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration: 1 / 2000 [ 0%] (Warmup)
[1] "Error in sampler$call_sampler(args_list[[i]]) : "
[2] " c++ exception (unknown reason)"
error occurred during calling the sampler; sampling not done