When I try to compile the model below, the parser issue a “variable ‘vector’ does not exist” error. I looked in the forum and that kind of error seems to occur when the local parameter is not declared at the top of the block. However, it’s not the case here, so I don’t understand where’s the problem.
data {
int<lower=0> N;
vector<lower=0>[N] X;
vector<lower=0>[N] Y;
}
parameters {
real<lower=12, upper=20> alpha;
real<lower=0> mu;
real<lower=0> sigma;
}
model {
vector[N] epsilon;
mu ~ normal(0, 30);
sigma ~ normal(0, 30);
for (n in 1:N) epsilon[n] = Y[n] - alpha - (X[n] * 30);
epsilon ~ normal(mu, sigma);
}
Yes, please. It should go in the PyStan repo since it works in RStan. It may just be a problem with PyStan not being up to date enough with Stan itself, so if you could include the note I made that it works in RStan 2.17.3, that’d be helpful. Thanks!
The Stan-to-C++ transpiler should be whitespace neutral.
Does anyone have an example of corrupted output from Notepad? I can send it to the forensics lab for text analysis (@mitzimorris literally wrote a book on the subject).
next time I find a textfile that behaves badly I can report it.
Btw, PyStan actually reads the file in python and sends a string to C++. So reading problems could be due to python.
It used to be a problem to read textfiles in python 2 + Windows. One needed to read the file in byteformat and do the encoding manually. Something to do with utf-8 and Windows. I have not seen that problem lately.
Also notepad needs \n\r for newline and some programs can fail with this. Usually python handles transformation, but python 2 has potential for surprises.
So that is one reason I was thinking there could be some with notepad.