Or, to put it differently, can you think of one that does?
Other than the construction, nah, I just think that’s important.
It’s really nice to build a sparse matrix like:
sparse_matrix[N, N] m;
for(i in 1:N)
for(j in 1:N) {
if(f(i, j) < 1.0) {
m[i, j] = something;
}
}
vs. remembering how csr/csc work and building those arrays manually. Also since Stan doesn’t have dynamically sized types writing that loop out like this:
int i_s[M];
int j_s[M];
real v_s[M];
for(i in 1:N)
for(j in 1:N) {
if(f(i, j) < 1.0) {
i_s[m] = i;
j_s[m] = j;
v_s[m] = something;
m = m + 1;
}
}
Is annoying and would require computing M somehow (which isn’t always easy given how declarations need to be above code in Stan models). I guess building csr/csc directly would be something similar to that.
I guess folks could pretty easily mess themselves up and change the structure of the matrix somehow, but I dunno, seems weird to me. Folks can already easily do this with the dense types if they wanted to. Can’t guard them from everything.
sparsity structure depends on the lengthscale which would be usually an unknown parameter and it seems the changing sparsity structure is difficult for Stan.
Woops, I was thinking about doing the cutoff before scaling by the inverse length scale, but that sounds wrong now that I think about it.
Yeah - these aren’t great models.
I meant the guy managed to figure out how to do random subsampling of a matrix in Stan. Maximum subversion :D.