Hi,
I am a little stuck trying to vectorise something.
I am modelling the probability of players winning points in a tennis match. Originally, I had the following setup:
int s_id[num_matches]; // server ids
vector[num_players] s; // serving ability
I could then pick out the ones specific to a match using:
Now, I want to make the model time-dependent. This is the new setup:
int s_id[num_matches]; // server ids
int period[num_matches]; // the current period
matrix[num_periods, num_players] s; // serving ability
I would like to vectorise the new statement. I tried:
but it returns a matrix. I really only want to pick out the vector corresponding to the indices (i, j), where i is given by one integer array and j by another. Is there a way to do this in vectorised form?
Thanks a lot,
Martin