Question

Covariance matrix I want to make a covariance matrix with the following variables: AGG, VAW, IWN,...

Covariance matrix

I want to make a covariance matrix with the following variables: AGG, VAW, IWN, SPY, EWG and EWW.

I found the covariance of the variables in r with this code:

cov(wr[ ,c("AGG","VAW","IWN","SPY","EWG","EWW")])

Here's the result:

              AGG           VAW           IWN           SPY
AGG  3.571068e-05 -4.260068e-05 -2.587826e-05 -3.239567e-05
VAW -4.260068e-05  1.301973e-03  9.838237e-04  7.927169e-04
IWN -2.587826e-05  9.838237e-04  1.024990e-03  7.221941e-04
SPY -3.239567e-05  7.927169e-04  7.221941e-04  6.143463e-04
EWG -5.084499e-05  1.109888e-03  9.502014e-04  8.046398e-04
EWW -3.710732e-05  1.184849e-03  1.010141e-03  8.152602e-04
              EWG           EWW
AGG -5.084499e-05 -3.710732e-05
VAW  1.109888e-03  1.184849e-03
IWN  9.502014e-04  1.010141e-03
SPY  8.046398e-04  8.152602e-04
EWG  1.444157e-03  1.179610e-03
EWW  1.179610e-03  1.659257e-03

How do I make a covariance matrix of the result?

Thanks in advance.

Homework Answers

Answer #1

No need to worry the computed matrix is itself a covariance matrix but the output is slightly confusing as the variables are not in need order. I have typed the output in a simple manner so you can understand. The highlighted part are the variables corresponding to that are the values of the variance and covariance. Hope this helps.

AGG VAW IWN SPY EWG   EWW
AGG 3.571068e-05 -4.260068e-05 -2.587826e-05 -3.239567e-05 -5.084499e-05 -3.710732e-05
VAW -4.260068e-05 1.301973e-03 9.838237e-04 7.927169e-04 1.109888e-03 1.184849e-03
IWN -2.587826e-05 9.838237e-04 1.024990e-03 7.221941e-04 9.502014e-04 1.010141e-03
SPY -3.239567e-05 7.927169e-04 7.221941e-04 6.143463e-04 8.046398e-04 8.152602e-04
EWG -5.084499e-05 1.109888e-03 9.502014e-04 8.046398e-04 1.444157e-03 1.179610e-03
EWW -3.710732e-05 1.184849e-03 1.010141e-03 8.152602e-04 1.179610e-03 1.659257e-03

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following code must be written in Matlab I want to print the following in Matlab...
The following code must be written in Matlab I want to print the following in Matlab (x1,x2, x3, ....xn) = (0.33333, 0.33333, 0.33333,....) That is for n variables . The whole thing should be on the same line. I need to use fprintf and write out the coordinates with 5 decimal places of variable xn = (0.33333, 0.33333, 0.33333,....) Thanks!
1. Given a matrix variable "mat", write code using for loops, if statements, etc. that will...
1. Given a matrix variable "mat", write code using for loops, if statements, etc. that will accomplish the same as the following: matsum = sum(mat') Please make sure to store the result in "matsum" and dont use sum. This is what I have so far but it keeps telling me is wrong.... % mat has been initialized for you: mat = randi([-100,100],randi([15,20]),randi([15,20])); % write your statements that accomplish the code above: [r c]=size(mat); for i=1:c matsum=0; for j=1:r matsum=matsum+mat(j,i); end...
I don't want explanation , I just want a correct answer, Very quickly. 06- Based on...
I don't want explanation , I just want a correct answer, Very quickly. 06- Based on the GDP deflator, inflation is positive (relative to the base year) if Select one: a. nominal GDP is larger than real GDP b. can't be detrmined from the given information c. nominal GDP equals real GDP d. nominal GDP is less than real GDP e. All of the above 05- Based on price setting behavior, we know that an increase in the markup will...
I'm using Rstudio and i am not very familiar using it. I am not sure how...
I'm using Rstudio and i am not very familiar using it. I am not sure how i am suppose to code this to place it in the chunk to get results. Let's think of calendar year 2016 as a sample of all the days in olywthr. First create a dataframe, cal2016, containing only days in 2016 from the larger dataframe olywthr (I have supplied the R code to do this in the following chunk). Run str() and summary() on the...
3) Which of the following statements is TRUE about multiple regression? I. We do not want...
3) Which of the following statements is TRUE about multiple regression? I. We do not want our explanatory variables to be interrelated. II. At least one slope should be statistically significant. III. The slopes should not change if one variable is removed. A) I only B) II only C) I and II only D) I and III only 4) A regression model is built using the heights and body fat percentages to predict the weights of 30 volunteers. How many...
How do I make this code not include negative numbers in the total or average if...
How do I make this code not include negative numbers in the total or average if they are entered? (C++) For example, if you enter 4, 2, and -2, the average should not factor in the -2 and would be equal to 3. I want the code to factor in positive numbers only. ----- #include using namespace std; int main() {    int x, total = 0, count = 0;       cout << "Type in first value ";   ...
1.1 Suppose you want to make a scale model of a hydrogen atom. You choose, for...
1.1 Suppose you want to make a scale model of a hydrogen atom. You choose, for the nucleus, a small ball bearing with a radius of [01] mm. The radius of the hydrogen atom is 0.529 × 10−10 m and the radius of the nucleus is 1.2 × 10−15 m. (a) What would be the radius (m) of the model? (b) Suppose that now you want to make a scale model of the solar system using the same ball bearing...
Given the following questions, I would like to know the answers to c, d, and e....
Given the following questions, I would like to know the answers to c, d, and e. located at the bottom (due to 4 answers per post limit). Thanks! Platinum (Pt) is used in part of your car's catalytic converter to reduce carbon monoxide emissions by the following chemical reaction: 2CO(g) + O2(g) Pt 2CO2(g) ---> 1) A matrix contains 7.1mg Pt/g of matrix. What is the %Pt in the matrix by mass? mass of pt = 7.1 mg mass of...
The following is a small data set of 25 observations. I want you to calculate some...
The following is a small data set of 25 observations. I want you to calculate some statistics by hand to cement the class material. You can use the regular formula for the variance or the computational formula - I’m just interested in the correct result. If you use the computational formula, you will want to calculate a separate row of each value squared in order to calculate the Sum(x^2). Excel can be used to solve this problem. Var 28 4...
The following algorithm finds the initial substring of y that can be reversed and found in...
The following algorithm finds the initial substring of y that can be reversed and found in y. For example, longestInitialReverseSubstringLength(“aabaa”) = 5, because “aabaa” is the same string forwards and backwards, so the longest initial substring that can be reversed and found in the string is “aabaa”. Also, longestInitialReverseSubstringLength(“bbbbababbabbbbb”) is 6, because “babbbb” can be found in the string (see color-highlighted portions of the string), but no longer initial string exists reversed in any part of the string. longestInitialReverseSubstringLength(String y)...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT