Questions tagged [covariance-matrix]

113 questions
0
votes
1 answer

How to roll-over an explicitly defined covariance matrix?

I defined a weighted COVAR matrix. Now I am trying to roll it over time. That is, I want to obtain a weighted COVAR matrix with a rolling window of 60. As an example, I will take the population covariance matrix: def cm(data): data =…
Max
  • 21
  • 7
0
votes
0 answers

Pandas Covariance Matrix

I have an array, but I need to transform it into an 11x11 matrix, how to do this? d = {'Ambev': retornoAmbev, 'Bardell': retornoBardell, 'Bombril': retornoBombril,'Braskem': retornoBraskem, 'Petrobras': retornoPetrobras,'Vale':…
0
votes
0 answers

Covariance matrix between 2 assets over a specific time horizon

I have to compute the inverse of the covariance matrix [variance covariance covariance variance] between 2 assets (SPY and TLT) over the time horizon 2006 2010 I did this ret1=diff(SPY1) %2006-31/12/2009 of log of…
0
votes
2 answers

Covariance of Matrix in python

I want to find the covariance of a 10304*280 matrix (i.e 280 variable and each have 10304 subjects) and I am using the following numpy function to find this. cov = numpy.cov(matrix) I am expected 208*280 matrix as a result but it returned …
-1
votes
1 answer

How to create a N = 1000 , 2 dimensional 2 classes dataset given mean = [-8,8]T, covariance = [ [0.3 1.5] [1.5 9.0] ]

Generate a 1000 two-dimensional dataset, X that is of two classes and plot. The 1 500 data vectors are modeled by the Gaussian distribution with mean, m1 = [­ 8, 8] T and the rest 500 data vectors are modeled by the Gaussian distribution with…
-1
votes
1 answer

starting with a lavaan SEM model, cor2cov does not reproduce the original cor matrix

I created a SEM model in lavaan that produced a good fit to my data. I inspected the resulting covariance matrix using: cov1 <- lavInspect(my_fit, what="fitted")$cov which produced this matrix (the variables themselves are not of interest) …
-2
votes
1 answer

Does Eigen have solution for repair non-positive defined covariance matrix

Does Eigen contains an algorithm for solving nearest correlation matrix problems?
Gluttton
  • 5,739
  • 3
  • 31
  • 58
1 2 3 4 5 6 7
8