Open mitzimorris opened 2 years ago
apologies for blaming the wrong person - @WardBrian - why the name "cov"?
possible names: design_matrix, predictors, xs? xs seems best.
why this:
data {
int<lower=1> N;
vector[N] x;
vector[N] y;
}
transformed data {
matrix[N, 1] xs = [x']';
}
instead of:
matrix[N, 1] xs = to_matrix(x);
is to_matrix
less efficient? is it so inefficient that we don't want it in the example models?
I didn’t rename them, my name might show up in the blame because I ran the canonicalizer on the models a few months ago
As for why the coding was done that way, I don’t believe that will be more efficient than to_matrix. The implementation of to_matrix for vector types is just a forwarding constructor
@WardBrian apologies - I was right the first time - https://github.com/stan-dev/example-models/pull/200
I've spent the past 30 minutes trying to find announcements or guidance on when normal_id_glm
was introduced. it looks to me like a bunch of devs added stuff and assumed that what they added was just obvious. for our users, myself included, it's not. this is an ongoing problem - we get fabulous contributions to the code from sophisticated developers but the users need it explained to them like they're 7 - not that there's anything wrong with being 7.
As for why the coding was done that way, I don’t believe that will be more efficient than to_matrix. The implementation of to_matrix for vector types is just a forwarding constructor
I think I see why this was done - in a few models, you need to past together several inputs, and you end up writing things like this:
data {
int<lower=1> N;
int<lower=1> J; // number of counties
array[N] int<lower=1, upper=J> county;
vector[N] u;
vector[N] x;
vector[N] y;
}
transformed data {
matrix[N, 2] xs = [x', u']';
}
to_matrix
requires something like this:
matrix[N, 2] xs = to_matrix({x', u'})';
clear? does it blend? will test.
the names of the chapter 12 ARM models make no sense, and the description in the README is wrong. these were developed 9 years ago by a Columbia undergrad and no one had the time to check them.
"no-pooling" and "complete-pooling" should be non-hierarchical models.
any model with "chr" - which perhaps stands for "centered hierarchical regression" - just a guess - is a "partial pooling" model.
I doubt any of this is worth fixing, OTOH, keeping this around is an equally bad option. we should archive this altogether.
the ARM models which have been updated for normal_id_glm have introduced a transformed data variable named "cov" - not sure what this name is supposed to be, but it's definitely not a covariance matrix.
perhaps @andrjohns can explain?would it be OK to change to "x_mat" or something like that?