Hello to everyone, I am looking to parallelise within chain some code in STAN to boost computation time. Unfortunately my target function cannot be aggregated trough a simple sum, i.e reduce_sum
in this case does not work. I need some parallel code that returns a vector of known length b
and then I have to post process that to get my desired likelihood.
The main issue I am having is that to compute this likelihood I need to pass 4 auxiliary matrices to the likelihood function, say A,B,C, Omega. From these I can the compute the likelihood. It seems to me that currently map_rect
only accepts a pre-specified number of inputs;
vector map_rect((vector, vector, array[] real, array[] int):vector f,
vector phi, array[] vector thetas,
data array[,] real x_rs, data array[,] int x_is);
From this source it seems I can only pass one auxiliary vector phi
to themap_rect
function, is it true? Ideally I would like to have something like:
vector lp(matrix A, matrix B, matrix C, matrix Omega, array[] matrix Y){.....
.................
return lp'
}
Where my data is an array of matrices. Can I pass this type of data to map_rect
, or does it only work for the data types presented in the Rstan documentation?
Best,
Luca