Operating System: Clear Linux (28100) and Antergos (Linux)
Interface Version: rstan (Version 2.18.2, GitRev: 2e1f913d3ca3)
Compiler/Toolkit: gcc 8.3.1 and gcc 8.2.1
Hi! Here is documentation for bernoulli_logit_glm, yet when I try it in a simple logistic regression model:
data {
int<lower=0> N;
int y[N];
matrix[N,4] X;
real mu0;
real mu1;
real sigma0;
real sigma1;
}
parameters {
real beta0;
vector[4] beta1;
}
model {
beta0 ~ normal(mu0, sigma0);
beta1 ~ normal(mu1, sigma1);
y ~ bernoulli_logit_glm(X, beta0, beta1);
// y ~ bernoulli_logit(beta0 + X * beta1);
}
I get the error:
Probability function must end in _lpdf or _lpmf. Found distribution family = bernoulli_logit_glm with no corresponding probability function bernoulli_logit_glm_lpdf, bernoulli_logit_glm_lpmf, or bernoulli_logit_glm_log
This comes up both in RStudio (preview) and when trying to compile the model.
I was intending to benchmark this model, and given Bob Carpenterās statements in this post from October 2017:
Matthijsās first major commit is a set of GLM functions for negative binomial with log link (2ā6 times speedup), normal linear regression with identity link (4ā5 times), Poisson with log link (factor of 7) and bernoulli with logit link (9 times). Wow! And he didnāt just implement the straight-line caseāthis is a fully vectorized implementation as a densityā¦
I could also try clang 7.0.1.
I also have a roughly 1-week old build of gcc-trunk (ie, the development branch).
Even my Ubuntu laptop has gcc 8.2.0 as the default compiler, but Iād (not knowing the Stan code base) be surprised if itās the compilerā¦
I can try on the laptop later.
Do you know if there is an easy way to build and install the develop branch?
If I were to install_github, with ref=ādevelopā, it would use the development branch of rstan, which still points at Stan 2.18.
The problem is that the development version of RStan (the interface) looks like it does not use the development version of Stan. FWIW, I did just run that, restarted R, and see the same behavior. stan_version() still returns 2.18.
@bgoodri, any suggestions, or time-frame until a release where these glm functions are supported?
Iād just like to pop in and mention I am also having these difficulties, or a related one at least. I was going to start a new thread but found this via the searchā¦
data {
int<lower=1> N; // total number of observations
int Y[N]; // response variable
int<lower=1> K; // number of population-level effects
matrix[N, K] X; // population-level design matrix
}
parameters {
real Intercept; // temporary intercept
vector[K] beta; // population-level effects
}
model {
target += normal_lpdf(Intercept | 0, 1);
target += normal_lpdf(beta | 0, 1);
for (i in 1:N){
target += bernoulli_logit_glm_lpmf(Y[i] | X, Intercept, beta);
}
}
Nor does this work
data {
int<lower=1> N; // total number of observations
int Y[N]; // response variable
int<lower=1> K; // number of population-level effects
matrix[N, K] X; // population-level design matrix
}
parameters {
real Intercept; // temporary intercept
vector[K] beta; // population-level effects
}
model {
target += normal_lpdf(Intercept | 0, 1);
target += normal_lpdf(beta | 0, 1);
target += bernoulli_logit_glm_lpmf(Y | X, Intercept, beta);
}
They wonāt compile since there is no function found. The latest version of rstan, etc are installed (and just reinstalled to be sure).