Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define empty array for Stan #170

Open
athowes opened this issue Nov 13, 2024 · 1 comment
Open

How to define empty array for Stan #170

athowes opened this issue Nov 13, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@athowes
Copy link
Contributor

athowes commented Nov 13, 2024

I'm unsure about this but in the documentation it suggests using this for empty array for primary_params:

* array[0] real primary_params = {};

When I try compling something like that with Stan I get:

Compiling Stan program...
Syntax error in '/var/folders/4r/hkp4v9fn3wx044_hk8qnsjxw0000gn/T/RtmpD3IIlw/model-fe643c985a5a.stan', line 12, column 34 to column 35, parsing error:
   -------------------------------------------------
    10:    real D = positive_infinity();
    11:    int primary_id = 1; // Uniform
    12:    array[0] real primary_params = {};
                                           ^
    13:    return primarycensored_lpmf(d | dist_id, params, pwindow, d_upper, D, primary_id, primary_params);
    14:  }
   -------------------------------------------------

Expression expected after "{" in array expression.

make: *** [/var/folders/4r/hkp4v9fn3wx044_hk8qnsjxw0000gn/T/RtmpD3IIlw/model-fe643c985a5a.hpp] Error 1

Error: An error occured during compilation! See the message above for more information.

If it's not valid syntax suggest change to documentation.

@seabbs
Copy link
Contributor

seabbs commented Nov 13, 2024

@seabbs seabbs added the documentation Improvements or additions to documentation label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants