stan-dev / stan-dev/stanc3

Can't mix offset/multiplier with upper/lower bounds

Open
#659 24 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #971 by @WardBrian — closed without merging
feature
Dominant language
OCaml
Stars
160
Forks
59
Avg merge
21h 45m
Merged PRs (30d)
26

Description

The following code:

data { 
  int<lower=0> N; 
  int<lower=0,upper=1> y[N];
} 
parameters {
  real<multiplier=1,lower=0,upper=1> theta;
} 
model {
  theta ~ beta(1,1);  // uniform prior on interval 0,1
  y ~ bernoulli(theta);
}

Gives the error:

   -------------------------------------------------
     4:  } 
     5:  parameters {
     6:    real<multiplier=1,offset=0,lower=0,upper=1> theta;
                                     ^
     7:  } 
     8:  model {
   -------------------------------------------------

Expected '>' after multiplier expression.

Should this be legal syntax?

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 by reproducing the Stan declaration in the issue and inspect the parser entry point for constrained parameter declarations. Review the discussion and closed pull request #971 before proceeding; done means the shown combination of multiplier, offset, lower, and upper bounds is accepted with appropriate parser coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.