# Generalising propagation of covariance for sums of indexed variables

this is my first post in mathematicaSE. I have a question relating an answer given in an earlier <post>. Oleksandr uses as an example the expression

PropagateCovariance[a*b/c, {a, b, c}, "ExpansionOrder" -> 2] // Simplify


however I would like to use the same function (hence Oleksandr code) to calculate the variance of an expression including sums of indexed variables, say something of the form (this is more pseudocode than code since I do not know what the correct syntax would be in mathematica)

PropagateCovariance[Sum[x_i,{i,0,n}]/Sum[y_i,{i,0,k}], {x_1,x_2,...,x_n,y_1,y_2,...,y_k}, "ExpansionOrder" -> 2] // Simplify

where x_i (and y_i) would be something like Subscript[x,i]. The other important thing is that I want to get a completely general answer, therefore I cannot enumerate manually all {x_1,x_2,...,x_n,y_1,y_2,...,y_k} in the curly brackets.

Any suggestion would be of great help!

-
This won't work because the function PropagateCovariance requires the variables explicitly in its second argument. In general, most symbolic calculations involving vectors require explicit lists to work properly (except for some tensor related functions). –  Jens Jun 21 at 17:16
Thank you for replying Jens. I know that it doesn't work as it is, I would like to know whether there is a way around this, maybe expressing everything as a list/matrix. There must be a way of calculating analytical expressions for the error propagation of expressions involving sums, unfortunately I do not know Mathematica well enough to do it without help. –  smcantab Jun 21 at 17:28
If you want to use this same code, you must expand the sums so as to be able to write down the covariance matrix. But you won't get a completely general answer using this approach, as (while following the ISO recommendations on uncertainty propagation, which are sufficient for almost all practical purposes) this code is based on a non-rigorous approximation and takes advantage of many resulting simplifications. If you want a completely general answer, you might be in the wrong place. Perhaps try CrossValidated instead? –  Oleksandr R. Jun 22 at 2:18