covariance matrix

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

covariance matrix

gigifaye29
Hello,

Just a quick question about getting covariance matrix with QuantLib. I went through the matrixutilities folder and found the method getcovariance() ; however, it takes a correlation matrix as an input.

Does Quantlib have available method that directly takes the time series(of factors) and return the covariance matrix(of the factors)?

thx,
XC
Reply | Threaded
Open this post in threaded view
|

Re: covariance matrix

Sylvain Bertrand
Hi,

The covariance matrix is 1/n * M * t(M).
You could use the operators defined here (http://quantlib.org/reference/class_quant_lib_1_1_matrix.html) to get your cov matrix.

Rgds,
Sylvain

On Thu, May 22, 2008 at 1:34 PM, gigifaye29 <[hidden email]> wrote:

Hello,

Just a quick question about getting covariance matrix with QuantLib. I went
through the matrixutilities folder and found the method getcovariance() ;
however, it takes a correlation matrix as an input.

Does Quantlib have available method that directly takes the time series(of
factors) and return the covariance matrix(of the factors)?

thx,
XC
--
View this message in context: http://www.nabble.com/covariance-matrix-tp17409495p17409495.html
Sent from the quantlib-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: covariance matrix

Luigi Ballabio
In reply to this post by gigifaye29
On Thu, 2008-05-22 at 10:34 -0700, gigifaye29 wrote:
> Does Quantlib have available method that directly takes the time series(of
> factors) and return the covariance matrix(of the factors)?

Yes---you can use the SequenceStatistics class.  Write back if you need
advice on how to use it.

Luigi


--

Though this be madness, yet there is method in't.
-- Hamlet, Act II, scene II



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users