Problem fitting inverse gaussian model

Hello, I’m getting some strange Stan parsing error messages when trying to run inverse Gaussian models. For demonstration purposes, running the following code:

m <- brm(
  Sepal.Length ~ 0 + Species, 
  data = iris,
  family = inverse.gaussian(),
)

Gives me the following error message:

SYNTAX ERROR, MESSAGE(S) FROM PARSER:
No matches for: 

  inv_gaussianvector_lpdf(vector, vector, real)

Function inv_gaussianvector_lpdf not found.
 error in 'model54045ff8707d_62752e90fdb22353c042a649b491058d' at line 78, column 52
  -------------------------------------------------
    76:       mu[n] = inv_sqrt(mu[n]);
    77:     }
    78:     target += inv_gaussianvector_lpdf(Y | mu, shape);
                                                           ^
    79:   }
  -------------------------------------------------

Error in stanc(file = file, model_code = model_code, model_name = model_name,  : 
  failed to parse Stan model '62752e90fdb22353c042a649b491058d' due to the above error.

The model runs fine with other families e.g. lognormal.

I’m running Windows 10, R 4.0.3, brms_2.14.4, rstan_2.21.2.

Thanks! This was a typo in brms that I just fixed in the latest github version.

1 Like