How to create a Beta matrix?

2 visualizaciones (últimos 30 días)
Krish Ferguson
Krish Ferguson el 2 de Feb. de 2018
Comentada: dpb el 2 de Feb. de 2018
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 comentario
dpb
dpb el 2 de Feb. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by