Tag Info

1

Thank you gordon! So in addition to the solution you posted, hereĀ“s what I actually used in the script where I needed this formula. In the case anyone else can use it: Cov(X,A) = Cov(0.25A+0.25B+0.5C,A) = 0.25Var(A) + 0.25Cov(B,A) + 0.5 Cov(C,A) Corr(X,A) = Cov(X,A) / sqrt( Var(X)*Var(A) ) beta[A] = ( vol[A] / vol[X] ) * Corr[X,A] have a Good day!

2

You only need to note the following \begin{align*} corr\left(X_1, \sum_{i=1}^nw_i X_i\right) &= \frac{cov\big(X_1, \, \sum_{i=1}^nw_i X_i \big)}{\sqrt{var(X_1)} \sqrt{var(\sum_{i=1}^n w_i X_i)}}\\ &= \frac{E\Big(\big(X_1-E(X_1)\big)\big(\sum_{i=1}^n w_i X_i - E(\sum_{i=1}^n w_i X_i) \big)\Big)}{\sqrt{var(X_1)} \sqrt{var(\sum_{i=1}^n w_i X_i)}}\\ ...

0

I have made a solution to an index construction but not in Matlab but in C++ with Visual Studio. Maybe you would like to check it out. It automatically spits out the index from the Bloomberg stream data (https://github.com/RTRindex/raleigh-triangle-index)

1

Sounds more like a programming question, but what you stressed is relevant, you need to define a methodology to deal with this calendar issue. The options you have are whether choose the smallest common set of dates to calculate your index, or use previous close. Choosing between the two involves investability of your index IMO. Would you be able to purchase ...

0

Bram made a good point about looking at longer-term returns, but that weakens the quality of estimates. Here are two sources that address the issue directly - a formal approach here and one specifically in financial context here.

0

Closing prices should be very highly correlated, I assume you care about close to close returns instead. Given the frequencycle of the data that you seem to be looking at (ie you don't seem to be looking at correlation of the futures return intraday), I assume this is for some sort of modelling/pricing over a longer horizon. What I believe most people do ...

1

The answer is no. First, the question is ambiguous about what year Y is. Is year Y actually 2015? Knowing those returns in one year says nothing about correlation. Second, if it means that if Stock A goes up 5% then Stock B will go up by 2%, then that also says nothing. What if Stock A goes down. Does stock B go up or down? Additionally, look at the ...

3

Does this mean that correlation is 40%? No. Very simple example (in R). Let A and B be stocks with returns stockA and stockB. Consider following example: stockA = c(0.05, 0.04, 0.05, 0.06) stockB = c(0.01, 0.02, 0.03, 0.02) mean(stockA) mean(stockB) cor(stockA, stockB) stockA = c(0.04, 0.05, 0.05, 0.06) stockB = c(0.01, 0.02, 0.02, 0.03) mean(stockA) ...

0

I suspect that you are mixing correlation and cointegration. What you describe as the co-movement of prices sounds like cointegration.

2

Actually prices dont make sense as they are correlated with previous samples (prices), returns are not. Better will be difference between prices, but then you dont have reference point and comparability between assets, so eventually you need returns. At the end that is what you are interested in I think as profit is usually measured in return.

Top 50 recent answers are included