Notation: How to condition on specific elements of a vector?

155 Views Asked by At

I have a vector $\mathbf{s}=(s_{aa},s_{ab},s_{ba},s_{bb})$ of length $I$. Now I would like to sum over all elements of $\mathbf{s}$ that have $a$ in the $k^{th}$ position of the subscript.

So, if $k=1$, I would like to have the sum $s_{aa} + s_{ab}$. In sum notation, I would have to condition the index of $\mathbf{s}$ on the value of $k$: $\sum_{i}^{I} \mathbf{s}$

Is there general notation for $i$? Or do I have to express the condition in words?