mathDR
June 19, 2021, 9:06pm
1
Trying to compile a model using skew_double_exponential
, which according to 16.10 Skew double exponential distribution | Stan Functions Reference is currently (2.27) a viable function.
Unfortunately, when I try to compile, I receive:
A returning function was expected but an undeclared identifier 'skew_double_exponential_lpdf' was supplied.make: ***
Halp?
1 Like
We’d need to see the full model to debug this
mathDR
June 20, 2021, 2:49am
3
Okay I’ll create a minimum viable example.
mathDR
June 20, 2021, 2:58pm
4
Minimum example showing error:
data {
int<lower=1> num_data;
vector[num_data] observed;
}
parameters {
real mu;
real<lower=0> sigma;
real tau;
}
model {
mu ~ std_normal();
sigma ~ cauchy(0,1);
tau ~ std_normal();
target += skew_double_exponential_lupdf(observed|mu, sigma, tau);
}
Trying to compile with cmdstanpy version 0.9.76 using CmdStan version 2.27.0. Yields following error:
INFO:cmdstanpy:compiling stan program, exe file: /dev/stan_models/skew_laplace
INFO:cmdstanpy:compiler options: stanc_options=None, cpp_options=None
ERROR:cmdstanpy:file /dev/stan_models/skew_laplace.stan, exception Command: ['make', '/dev/stan_models/skew_laplace']
failed, returncode: 2, error: No such file or directory, stderr: Semantic error in '/dev/stan_models/skew_laplace.stan', line 16, column 11 to column 65:
-------------------------------------------------
14: sigma ~ cauchy(0,1);
15: tau ~ std_normal();
16: target += skew_double_exponential_lupdf(observed|mu, sigma, tau);
^
17: }
-------------------------------------------------
A returning function was expected but an undeclared identifier 'skew_double_exponential_lupdf' was supplied.make: *** [/dev/stan_models/skew_laplace.hpp] Error 1
ERROR:cmdstanpy:model compilation failed
mathDR
June 20, 2021, 9:25pm
5
It looks like the signatures aren’t currently exposed in the transpiler, so Stan doesn’t know which c++ function to call. I’ve opened an issue in the repo here: skew_double_exponential distribution isn't exposed · Issue #918 · stan-dev/stanc3 · GitHub
This will be fixed for the next release
1 Like
Yeah, Math PR was merged end of 2020 as well as the docs PR. We however didnt add this to stanc3. So this time its the other way around (there are docs but its missing the implementation :)).