Main Content

convert2sur

Convert multivariate normal regression model to seemingly unrelated regression (SUR) model

Description

example

设计= convert2sur(Design,Group)将多元正常回归模型转换为具有数据系列分组的看似无关的回归模型。

Examples

collapse all

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 areAlphaBeta.

Using simulated data, where theAlphaestimate(s) are displayed in the first row(s) and theBetaestimate(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

collapse all

Data series, specified as a matrix or a cell array that depends on the number of data seriesNUMSERIES.

  • IfNUMSERIES = 1,convert2surreturns theDesignmatrix.

  • IfNUMSERIES > 1,Designis a cell array withNUMSAMPLEScells, where each cell contains aNUMSERIES-by-NUMPARAMS已知值的矩阵。

Data Types:double|cell

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 hasNUMSERIESelements. Elementi = 1, ..., NUMSERIESin the vector, and has the indexj = 1, ..., NUMGROUPSof the group in which seriesiis a member.

  • To identify groups by groups, construct a cell array withNUMGROUPSelements. Each cell contains a vector with the indexes of the series that populate a given group.

    In either case, the number of series isNUMSERIES和the number of groups isNUMGROUPS, with1NUMGROUPSNUMSERIES.

Data Types:double|cell

Output Arguments

collapse all

看似无关的回归模型,具有指定的数据系列分组,返回为矩阵或单元格数组,取决于该值的值NUMSERIES.

  • IfNUMSERIES = 1,设计= Design, which is aNUMSAMPLES-by-NUMPARAMSmatrix.

  • IfNUMSERIES > 1NUMGROUPSgroups are to be formed,Designis a cell array withNUMSAMPLEScells, 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.

版本历史

Introduced in R2006a