[proFit-list] covariance matrix

perego perego at fi.infn.it
Sat Apr 5 05:38:01 CDT 2008


Hi!
It is customary in statistics to associate a "correlation matrix" C(X)  
to any set of variables
(let's say,X={ x1,... xn}). The correlation matrix is a symmetrical n  
x n matrix whose diagonal
elements are the variances of the xi and the off-diagonal terms are  
given by the
covariance factors cov(xi,xj).
If one has another variable (Y={y1,...ys}) that is a linear function  
of X (Y= M X + A, where
M is a s x n matrix and A ={a1,... as} a vector of constants), the  
covariance matrix of Y
is given by   C(Y)= M  C(X)  M^t   , where standard matrix product is  
implied and  ^t is the matrix
transposition operator. This formula is often expanded also to cases  
where the function Y=f(X) is
not linear, by using the partial derivatives (dyi/dxj) as elements of  
M, taken at X= <X>, mean value
of X, and may be seen as the - perhaps - most general formula for  
error propagation (the formula
you have shown is clearly a particular case).

proFit copes with covariance matrices, as it is able, for instance, to  
yield the covariance matrix of
the fitted parameters in fit operations. Unfortunately, I don't know  
which practical form the
data of your "projects" have and I'm also no expert in proFit  
programming, so that
I cannot help you in a more practical way.

Andrea

On Apr 4, 2008, at 10:19 PM, Eduard Kas wrote:
> Dear subscribers,
>
> I am relatively new to proFit and I'm wondering whether the following
> calculation can be done with proFit.
>
> For an assignment I would like to calculate the variance of a
> portfolio of projects. This in accordance with the formula (for a
> 'three projects' situation):
>
> x1^2 * Var(x1) + x2^2 * Var(x2) + x3^2 * Var(x3) + 2 * x1 * x2 * sd
> (x1) + sd(x2) * corr (x1x2) + 2 * x1 * x3 * sd(x1) * sd(x3) * corr
> (x1x3) +
>
> 2 * x2 * x3 * sd(x2) * sd(x3) * corr(x2x3)
>
> where: x1, x2, x3  are weightings in the portfolio, in terms of
> investment value; Var = variance; sd = standard deviation; and corr =
> correlation
>
> In the above example with only three projects there are just  two
> correlation terms. This calculation is still relatively easy to
> handle. For a portfolio with 38 projects the calculations is however
> a much lengthier process. I would like to start as follows: define 41
> columns: one for the projects weightings, one for the variance, and
> 38 columns that are filled with the correlations of a project with
> each of the other projects in the portfolio. (The standard deviation
> of a project can of course be calculated as the square root of the
> variance of the same project); and define 38 rows, one row for each
> of the projects. In this example we have 38 terms in which the
> squared values of a project weighting are multiplied by the variance
> of that project and 361 terms that include a correlation of a project
> with another project (that is, 38 * 37 / 2 = 361).
>
> A complication in the calculation is that in a 'three porject
> situation' only three correlations are relevant, in order to
> calculate the project variance. In the example below only one 0.8,
> one 0.6, and one 0.5. As we know the correlation between projects x1
> and x2 we also know the correlation between projects x2 and x1. We
> are also not interested in the correlation of a project with its own.
> (See the three "1s" in the example below.)
>
> 1.0		0.8		0.6
>
> 0.8		1.0		0.5
>
> 0.6		0.5		1.0
>
> Think that the above calcutions are related in some way to vectors or
> matrices, but I really don't know where to start and how to proceed.
>
> Does anyone know how the above can be handled in proFit? Any help
> would be very much appreciated.
>
> Best regards,
>
>
> Eduard Kas
>
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://mail.quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com




More information about the proFit-list mailing list