For loops and financial regressions

1 回表示 (過去 30 日間)
Bailey Walker
Bailey Walker 2017 年 7 月 13 日
回答済み: Mukul Rao 2017 年 7 月 18 日
I am looking to use fitlm to run about 200 different regressions. I've been told a "for" loop would make that easier, but it seems to me like equal amounts of work. The data are also varying in size so i don't know if that matters as well. Is there an time saving way to run these regressions with the for loop?
In that same vein, is there a different way to do multiple CAPM regressions quickly? I can't seem to find the actual "financial toolbox" though so that could just be user error on my part :)

回答 (1 件)

Mukul Rao
Mukul Rao 2017 年 7 月 18 日
Hi,
You could consider the example on estimation of the CAPM on multiple stocks here:
Though the example deals with missing data, the workflow of looping through the stocks should apply to your use case as well. If you would like to avoid using "for" loops, you can consider the use of " ArrayFun"

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by