I had errors in installing Cmdstan, now I guess I am okay with it. Thank you @rok_cesnovar for helping me. I thought to post a new topic in order to have some help further coding. This is what I have got after installing Cmdstan 2.24.1.
set_cmdstan_path(“C:/Users/nanayaer/Documents/.cmdstanr/cmdstan-2.24.1/cmdstan-2.24.1”)
Then I could run the commands library(cmdstanr) cmdstan_path()
[1] “C:/Users/nanayaer/Documents/.cmdstanr/cmdstan-2.24.1/cmdstan-2.24.1” cmdstan_version()
[1] “2.24.1”
file <- file.path(cmdstan_path(), “examples”, “bernoulli”, “bernoulli.stan”)
mod <- cmdstan_model(file)
But, It gave an error,
Compiling Stan program…
INFO: Could not find files for the given pattern(s).
Error: An error occurred during compilation! See the message above for more information
Am I wrong here?
Please kindly help me to solve my errors
- default address-model : 64-bit
- default architecture : x86
Building the Boost C++ Libraries.
Component configuration:
- atomic : not building
- chrono : not building
- container : not building
- context : not building
- contract : not building
- coroutine : not building
- date_time : not building
- exception : not building
- fiber : not building
- filesystem : not building
- graph : not building
- graph_parallel : not building
- headers : not building
- iostreams : not building
- locale : not building
- log : not building
- math : not building
- mpi : not building
- program_options : building
- python : not building
- random : not building
- regex : not building
- serialization : not building
- stacktrace : not building
- system : not building
- test : not building
- thread : not building
- timer : not building
- type_erasure : not building
- wave : not building
type "C:\Users\nanayaer\AppData\Local\Temp\jam28705367.000" > "bin.v2\libs\program_options\build\gcc-8.3.0\release\cxxstd-11-iso\link-static\threading-multi\visibility-hidden\libboost_program_options-variant-mgw83-mt-x64-1_72-static.cmake"
task.o: duplicate section .rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]' has different size arena.o: duplicate section .rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]’ has different size
scheduler.o: duplicate section `.rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]’ has different size
/
In file included from stan/src/stan/model/model_header.hpp:16:
stan/src/stan/services/util/create_rng.hpp:35:1: fatal error: can’t write PCH file: No space left on device
} // namespace stan
^
We build a precompiled header when building cmdstan. This makes compilation 50% faster but does require ~500MB of space… You seem to not have enough space left on your disk.
Can you clear some space on your disk? Otherwise there is a way to turn this compilation speedup off. But I imagine you can get that space cleaned up.
task.o: duplicate section .rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]' has different size arena.o: duplicate section .rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]’ has different size
scheduler.o: duplicate section `.rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]’ has different size
Then, I run
mod$print()
and got
data {
int<lower=0> N;
int<lower=0,upper=1> y[N];
}
parameters {
real<lower=0,upper=1> theta;
}
model {
theta ~ beta(1,1); // uniform prior on interval 0,1
y ~ bernoulli(theta);
}
Thank you for this great support :)
I recompiled it. Then appeared,
Model executable is up to date!
Could you please explain what differences between stan and cmdstan? How does it work for user defined complex functions written in rstan (with blocks)?
Any references are highly appreciated.
There’s Stan the language and algorithms and then there are interfaces to Stan like RStan, CmdStan, PyStan, etc. CmdStanR is an alternative to RStan that uses the CmdStan interface under the hood instead of using the Rcpp package to call Stan’s C++ code from R (CmdStanPy vs PyStan is similar). All the interfaces support the same Stan code (with minor exceptions because RStan is using a slightly older version of Stan than CmdStan currently but that will be updated soon). But any Stan program that works with RStan should work with CmdStanR.
Thank you very much for getting back to me. I could find several explanations with very few examples in this regard. Then I am trying to run my stan() code with CmdStanR.
If you have the time please look at my question below and give me some ideas.
I think this error is related to the integral you’re solving in your Stan program and not the CmdStanR interface itself, so can you start a new post about this? I think you’ll get a better answer that way because this looks like it’s related to the use of integrate_1d in your Stan program, and there are people on the forum who are more familiar with that than I am.
At first glance it looks like you may need to change the relative tolerance, but it might actually have more to do with the specification of the model. People like @bbbales2 know the integrate functions better than I do and can help out if you start a new topic about this.