This is my error code
Error in compileCode(f, code, language = language, verbose = verbose) :
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: file1fcfc21cd39c9.o:file1fcfc21cd39c9.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D0Ev[_ZN3tbb8internal26task_scheduler_observer_v3D0Ev]+0x1c): undefined reference totbb::internal::task_scheduler_observer_v3::observe(bool)'C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: file1fcfc21cd39c9.o:file1fcfc21cd39c9.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD1Ev[_ZN3tbb10interface623task_scheduler_observerD1Ev]+0x1c): undefined reference to
tbb::internal::task_scheduler_observer_v3::observe(bool)'C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: file1fcfc21cd39c9.o:file1fcfc21cd39c9.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD1Ev[_ZN3tbb10interface623task_scheduler_observerD1Ev]+0x37): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: file1fcfc21cd39c9.o:file1fcfc21cd39c9.cpp:(.text$_ZN3tbb10i
Error in sink(type = “output”) : invalid connection
The Rstudio code part that making error is
#run MCMC called from STAN code
eivModel.fit = stan(file = "/Users/jeongsiklim/R code/mcmc_poly2_dark_ratio.stan",
data = eivModel.data,
control = list(adapt_delta=0.985, max_treedepth=12),
#warmup = 1000000,
iter = 5000000,
chains=4, cores = 4, thin = 15)
print(eivModel.fit, digits=5)
And stan code is
data {
int n ; // number of measruement result
vector<lower=0>[n] x ; // horizontal (reference)
vector<lower=0>[n] ux ; // Std. unc. for horizontal
vector<lower=0>[n] y ; // vertical (response)
vector<lower=0>[n] uy ; // Std. unc. for vertical
vector[3] betaM ; // Prior means for betas
vector<lower=0>[3] betaS ; // Prior SDs for betas
vector<lower=0>[n] rhoM ; // Prior means for rhos (vertical)
vector<lower=0>[n] rhoS ; // Prior mSDs for rhos
real<lower=0> gammay ; // Prior median for dark uncertainty along horizontal
}
parameters {
vector[3] beta ; // Regression coefficients
vector<lower=0>[n] rho ; // unobservable true values of vertical
real<lower=0> tauy ; // Dark uncertainty in vertical
}
transformed parameters {
vector<lower=0>[n] rhoi ; // Mean values of amount fractions
for (j in 1:n) {rhoi[j] = beta[1] + beta[2]*x[j] + beta[3]*x[j]^2;} //
}
model {
beta ~ normal(betaM, betaS) ; // Prior for betas
tauy ~ cauchy(0, gammay) ; // Prior for dark uncertainty of response
rho ~ normal(rhoM, rhoS) ; // Prior for rhos
y ~ normal(rhoi, sqrt(square(uy) + square(tauy))) ; // Likelihood for vertical (response)
x ~ normal(x, ux) ; // Likelihood for horizontal (reference)
}
I installed R, Rstudio, Rtools, and ‘rstan’ packages all new version.
The file path is all correct.
I want to know how to make this work.
Thank you.
edited by @jsocolar to remove boilerplate