convert2sur
Convert multivariate normal regression model to seemingly unrelated regression (SUR) model
Description
Examples
Use convert2sur to Estimate Stock Alpha and Beta Values
This example shows a CAPM demonstration using 6 stocks and 60 months of simulated asset returns, where the model for each stock isAssetReturn = Alpha * 1 + CashReturn + Beta * (MarketReturn - CashReturn) + Noise
和the parameters to estimate areAlpha
和Beta
.
Using simulated data, where theAlpha
estimate(s) are displayed in the first row(s) and theBeta
estimate(s) are display in the second row(s).
Market = (0.1 - 0.04) + 0.17*randn(60, 1); Asset = (0.1 - 0.04) + 0.35*randn(60, 6); Design = cell(60, 1);fori = 1:60 Design{i} = repmat([ 1, Market(i) ], 6, 1);end
Obtain the aggregate estimates for all stocks.
[Param, Covar] = mvnrmle(Asset, Design); disp({'All 6 Assets Combined'});
{'All 6 Assets Combined'}
disp(param);
0.0233 0.1050
使用单个股票的估计参数convert2sur
Group = 1:6; DesignSUR = convert2sur(Design, Group); [Param, Covar] = mvnrmle(Asset, DesignSUR); Param = reshape(Param, 2, 6); disp({'A','B','C','D','E','F'});
{'A'} {'B'} {'C'} {'D'} {'E'} {'F'}
disp(param);
0.0144 0.0270 0.0046 0.0419 0.0376 0.0291 0.3264 -0.1716 0.3248 -0.0630 -0.0001 0.0637
Estimate parameters for pairs of stocks by forming groups.
disp({'A & B','C & D','E & F'});
{'A & B'} {'C & D'} {'E & F'}
Group = { [1,2 ],[3,4],[5,6]}; DesignSUR = convert2sur(Design, Group); [Param, Covar] = mvnrmle(Asset, DesignSUR); Param = reshape(Param, 2, 3); disp(Param);
0.0186 0.0190 0.0334 0.0988 0.1757 0.0293
Input Arguments
Design
—Data series
matrix|单元阵列
Data series, specified as a matrix or a cell array that depends on the number of data seriesNUMSERIES
.
If
NUMSERIES = 1
,convert2sur
returns theDesign
matrix.If
NUMSERIES > 1
,Design
is a cell array withNUMSAMPLES
cells, where each cell contains aNUMSERIES
-by-NUMPARAMS
已知值的矩阵。
Data Types:double
|cell
Group
—Grouping for data series
vector|单元阵列
Grouping for data series, specified using separate parameters for each group. Specify groups either by series or by groups:
To identify groups by series, construct an index vector that has
NUMSERIES
elements. Elementi = 1, ..., NUMSERIES
in the vector, and has the indexj = 1, ..., NUMGROUPS
of the group in which seriesiis a member.To identify groups by groups, construct a cell array with
NUMGROUPS
elements. Each cell contains a vector with the indexes of the series that populate a given group.In either case, the number of series is
NUMSERIES
和the number of groups isNUMGROUPS
, with1
≤NUMGROUPS
≤NUMSERIES
.
Data Types:double
|cell
Output Arguments
设计
— Seemingly unrelated regression model with a specified grouping of the data series
matrix | cell array
看似无关的回归模型,具有指定的数据系列分组,返回为矩阵或单元格数组,取决于该值的值NUMSERIES
.
If
NUMSERIES = 1
,设计= Design
, which is aNUMSAMPLES
-by-NUMPARAMS
matrix.If
NUMSERIES > 1
和NUMGROUPS
groups are to be formed,Design
is a cell array withNUMSAMPLES
cells, where each cell contains aNUMSERIES
-by-(NUMGROUPS * NUMPARAMS)
已知值的矩阵。
The original collection of parameters that are common to all series are replicated to form collections of parameters for each group.
版本历史
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- United States(English)
欧洲
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)