stan-dev / stan-dev/docs

normal_id_glm signature missing

Open
#340 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
43
Forks
133
Avg merge
11h 32m
Merged PRs (30d)
4

Description

According to the documentation one of the signatures for normal_id_glm is:

real normal_id_glm_lpdf(vector y | row_vector x, real alpha, vector beta, real sigma)

But this signature is not available in 2.26:

library(cmdstanr)
#> This is cmdstanr version 0.1.3
#> - Online documentation and vignettes at mc-stan.org/cmdstanr
#> - CmdStan path set to: /home/andrew/.cmdstanr/cmdstan-2.26.0
#> - Use set_cmdstan_path() to change the path

mod = "data {
  int<lower=0> N;
  vector<lower=0, upper=200>[N] kid_score;
  row_vector<lower=0, upper=1>[N] mom_hs;
}
parameters {
  real alpha;
  vector[1] beta;
  real<lower=0> sigma;
}
model {
  sigma ~ cauchy(0, 2.5);
  target += normal_id_glm_lpdf(kid_score | mom_hs, alpha, beta, sigma);
}
"
mod = cmdstan_model(write_stan_file(mod))
#> Compiling Stan program...
#> 
#> Semantic error in '/tmp/RtmpmtAWHQ/model-1ec5266a7c73.stan', line 13, column 12 to column 70:
#>    -------------------------------------------------
#>     11:  model {
#>     12:    sigma ~ cauchy(0, 2.5);
#>     13:    target += normal_id_glm_lpdf(kid_score | mom_hs, alpha, beta, sigma);
#>                      ^
#>     14:  }
#>     15:
#>    -------------------------------------------------
#> 
#> Ill-typed arguments supplied to function 'normal_id_glm_lpdf'. Available signatures:
#> (real, matrix, real, vector, vector) => real
#> (real, matrix, vector, vector, vector) => real
#> (vector, row_vector, real, vector, vector) => real
#> (vector, row_vector, vector, vector, vector) => real
#> (vector, matrix, real, vector, real) => real
#> (vector, matrix, vector, vector, real) => real
#> Instead supplied arguments of incompatible type: vector, row_vector, real, vector, real.
#> 
#> make: *** [make/program:53: /tmp/RtmpmtAWHQ/model-1ec5266a7c73.hpp] Error 1
#> Error: An error occured during compilation! See the message above for more information.

Created on 2021-02-01 by the reprex package (v0.3.0)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the normal_id_glm documentation linked in the issue and compare its listed signatures with the CmdStan 2.26 behavior shown in the R/cmdstanr reproduction. Confirm whether the signature is missing from the documented API or unavailable in the implementation, then update the relevant documentation or record the discrepancy so the documented signatures match the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.