具有特定系数和公共系数的 R 投资组合特定回归
R portfolio specific regression with specific & common coefficients
在 R 中搜索和尝试不同的东西几天后,我 运行 对我的问题和要查找的搜索词没有想法。如果我的问题已经有了答案,我很抱歉提出我的问题。到目前为止,我找不到一个。
我目前正在做债券财务数据的回归。 Objective 我的回归是确定两个债券投资组合是否显示出显着不同的收益率。
我控制 4 个变量(V1 到 V4)以控制其他风险来源。
回归公式如下:
ield(p)=∝(p)+ 1(p)*V1+2(p)*V2(,)+3*V3(p)+4*V4(p)
(p)
表示特定于投资组合的值。
因变量 (Yield
) 是特定于投资组合的。
请注意 V1
和 V2
具有特定于投资组合的系数和公共变量值,
而 V3
和 V4
具有共同的系数和特定于投资组合的变量值。
此外,截距必须是特定于投资组合的值。
如何将提到的回归方程转换为 R?
特别是,我如何获得 V1
和 V2
的投资组合特定系数以及 V3
和 V4
的公共系数?
我可以通过
对每个投资组合进行 "stand-alone" 回归
Regression <- lm(Yield ~ V1 +V2 + V3+ V4)
如有任何意见或建议,我们将不胜感激。
亲切的问候,
西蒙
我对你的问题的理解是:
v1
和 v2
的参数需要特定于投资组合
v3
和 v4
的参数对于不同的投资组合需要相同
- 您的数据包含许多 (>1) 个不同的投资组合
- 线性回归将是您选择的分析方法
基于这些假设,您可以先拟合 v3
和 v4
,然后使用输出(作为偏移量)为每个拟合 v1
和 v2
您的投资组合
类似于:
# fit the first model to decide the parameters of v3 and v4 (beta3 and beta4)
model1 <- lm(Yield~V3+V4)
# Create offset which "frozen" the parameters of v3 and v4
offset_term <- beta3*V3 + beta4*v4
# fit final model with offset for each of your porfolio data
# assuming index_p1 is the row index of your portfolio 1, and index_p2 is for portfolio 2, then:
final_model_portfolio1 <- lm(Yield[index_p1]~V1[index_p1]+V2[index_p1]+offset(offset_term[index_p1]))
final_model_portfolio2 <- lm(Yield[index_p2]~V1[index_p2]+V2[index_p2]+offset(offset_term[index_p2]))
在 R 中搜索和尝试不同的东西几天后,我 运行 对我的问题和要查找的搜索词没有想法。如果我的问题已经有了答案,我很抱歉提出我的问题。到目前为止,我找不到一个。
我目前正在做债券财务数据的回归。 Objective 我的回归是确定两个债券投资组合是否显示出显着不同的收益率。 我控制 4 个变量(V1 到 V4)以控制其他风险来源。
回归公式如下:
ield(p)=∝(p)+ 1(p)*V1+2(p)*V2(,)+3*V3(p)+4*V4(p)
(p)
表示特定于投资组合的值。
因变量 (Yield
) 是特定于投资组合的。
请注意 V1
和 V2
具有特定于投资组合的系数和公共变量值,
而 V3
和 V4
具有共同的系数和特定于投资组合的变量值。
此外,截距必须是特定于投资组合的值。
如何将提到的回归方程转换为 R?
特别是,我如何获得 V1
和 V2
的投资组合特定系数以及 V3
和 V4
的公共系数?
我可以通过
对每个投资组合进行 "stand-alone" 回归Regression <- lm(Yield ~ V1 +V2 + V3+ V4)
如有任何意见或建议,我们将不胜感激。
亲切的问候,
西蒙
我对你的问题的理解是:
v1
和v2
的参数需要特定于投资组合v3
和v4
的参数对于不同的投资组合需要相同- 您的数据包含许多 (>1) 个不同的投资组合
- 线性回归将是您选择的分析方法
基于这些假设,您可以先拟合 v3
和 v4
,然后使用输出(作为偏移量)为每个拟合 v1
和 v2
您的投资组合
类似于:
# fit the first model to decide the parameters of v3 and v4 (beta3 and beta4)
model1 <- lm(Yield~V3+V4)
# Create offset which "frozen" the parameters of v3 and v4
offset_term <- beta3*V3 + beta4*v4
# fit final model with offset for each of your porfolio data
# assuming index_p1 is the row index of your portfolio 1, and index_p2 is for portfolio 2, then:
final_model_portfolio1 <- lm(Yield[index_p1]~V1[index_p1]+V2[index_p1]+offset(offset_term[index_p1]))
final_model_portfolio2 <- lm(Yield[index_p2]~V1[index_p2]+V2[index_p2]+offset(offset_term[index_p2]))