How to create a Beta matrix?

Hi all, I’m looking for some help with creating a beta matrix (i.e. the slope function in MS Excel). I’ve imported an nxm Matrix of historical asset prices with n being the number of historical observations and m the number of assets. To create a correlation matrix, I used the following: correlation_matrix = corr(HistPrices); I wondered if a similar function existed for a beta matrix? Or if someone could help me create a script to achieve this. Any help would be greatly appreciated!

1 Kommentar

dpb
dpb am 2 Feb. 2018
Since this is Matlab forum, not unusual that we don't know what a "beta matrix" is in Excel parlance...tell us what you're actually trying to compute. If it is just the slope of a LS regression line for an array of X,Y values, there are a number of ways depending on which Toolboxen you've got installed.
The base ML product polyfit isn't vectorized, but it's trivial to use it in an anonymous function with array/cellfun or just in a for...end loop.
Problem is, we don't know if that's what you're looking for or not...when I hear "beta" and see financial data, I think of the volatility beta.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 2 Feb. 2018

Kommentiert:

dpb
am 2 Feb. 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by