LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

Odaily星球日报Publicado a 2024-02-06Actualizado a 2024-02-06

Resumen

本篇根据大类对因子的相关性进行检验,依据检验结果对因子做了舍弃或合成处理。

书接上回,关于《用多因子模型构建强大的加密资产投资组合》系列文章中,我们已经发布了三篇:《理论基础篇》《数据预处理篇》《因子有效性检验篇》

前三篇分别解释了多因子策略的理论与单因子测试的步骤。

一、因子相关性检验的原因:多重共线性

我们通过单因子测试部分筛选出一批有效因子,但以上因子不能直接入库。因子本身可以根据具体的经济含义进行大类划分,同类型的因子间存在较强的相关性,若不经相关性筛选直接入库,根据不同因子进行多元线性回归求预期收益率时,会出现多重共线性问题。计量经济学中,多重共线性是指回归模型中的一些或全部解释变量存在“完全”或准确的线性关系(各变量间高度相关)。

因此,有效因子筛选出后,首先需要根据大类对因子的相关性进行 T 检验,对于相关性较高的因子,要么舍弃显著性较低的因子,要么进行因子合成。

多重共线性的数学解释如下:

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

会存在两种情况:

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

多重共线性导致的后果:

1.完全共线性下参数估计量不存在

2.近似共线性下 OLS 估计量非有效

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

3.参数估计量经济含义不合理

4.变量的显著性检验(t 检验)失去意义

5.模型的预测功能失效:通过多元线性模型拟合出的预测收益率极其不准确,模型失效。

二、步骤一:同类型因子的相关性检验

检验新求出的因子与已入库因子的相关性。通常来说,有两类数据求相关性:

1.根据所有 token 在回测期间的因子值求相关

2.根据所有 token 在回测期间的因子超额收益值求相关

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

我们所求的每个因子对 token 的收益率都有一定的贡献和解释能力。进行相关性检验**,是为了找到对策略收益有不同解释和贡献的因子,策略的最终目的是收益**。如果两个因子对收益的刻画是相同的,即使两个因子值存在很大差别也无意义。因此,我们并不是想找到因子值本身差异大的因子,而是想找到因子对收益刻画不同的因子,所以最终选择了用因子超额收益值求相关。

我们的策略是日频,所以按回测区间的日期计算因子超额收益之间的相关系数矩阵

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

编程求解与库内相关最高的前 n 个因子:

def get_n_max_corr(self, factors, n= 1):
       factors_excess = self.get_excess_returns(factors)
       save_factor_excess = self.get_excess_return(self.factor_value, self.start_date, self.end_date)
       if len(factors_excess) < 1:
           return factor_excess, 1.0, None
       factors_excess[self.factor_name] = factor_excess['excess_return']
       factors_excess = pd.concat(factors_excess, axis= 1)
       factors_excess.columns = factors_excess.columns.levels[ 0 ]
       # get corr matrix
       factor_corr = factors_excess.corr()
       factor_corr_df = factor_corr.abs().loc[self.factor_name]
       max_corr_score = factor_corr_df.sort_values(ascending=False).iloc[ 1:].head(n)
       
       return save_factor_excess, factor_corr_df, max_corr_score

三、步骤二:因子取舍、因子合成

对于相关性较高的因子集合,可以采取两种方式处理:

(1)因子取舍

根据因子本身的 ICIR 值、收益率、换手率、Sharpe 比率,挑选某维度下最有效的因子进行保留,删除其他因子。

(2)因子合成

对因子集合中的因子进行合成,截面上尽可能多的保留有效信息

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

假设当前有 3 个待处理的因子矩阵:

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

2.1 等权加权

各因子权重相等(w= 1/因子个数),综合因子=各因子值加总求平均。

Eg.动量类因子,一个月收益率、两个月收益率、三个月收益率、六个月收益率、十二个月收益率,这六个因子的因子载荷各占 1/6 的权重,合成新的动量因子载荷,然后再重新进行标准化处理。

synthesis 1 = synthesis.mean(axis= 1) # 按行求均值

2.2 历史 IC 加权、历史 ICIR、历史收益加权

用回测期的 IC 值(ICIR 值、历史收益值)对因子进行加权。过去有很多期,每一期都有一个 IC 值,所以用它们的均值作为因子的权重。通常使用回测期 IC 的均值(算数平均值)作为权重。

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

2.3 历史 IC 半衰加权、历史 ICIR 半衰加权

2.1 与 2.2 都是计算算数平均值,回测期的每一次 IC、ICIR 对于因子的作用被默认为相同。

但现实中,回测期的每一期对于当期的影响程度不完全相同,存在时间上的衰减。越接近当前期的时期,影响越大,越远影响越小。在此原理,求 IC 权重前首先定义一个半衰权重,距离当期越近的权重值越大、越远权重越小。

半衰权重数学推导:

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

2.4 最大化 ICIR 加权

通过求解方程,计算最优因子权重 w 使得 ICIR 最大化

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

协方差矩阵的估计问题:协方差矩阵用于衡量不同资产之间的关联性。统计学中常以样本协方差矩阵代替总体协方差矩阵,但在样本量不足时,样本协方差矩阵与总体协方差矩阵的差异会很大。所以有人提出了压缩估计的方法,原理是使估计协方差矩阵与实际协方差矩阵之间的均方误差最小

方式:

1.样本协方差矩阵

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

2.Ledoit-Wolf 收缩:引入一个缩小系数,将原始的协方差矩阵与单位矩阵进行混合,以减少噪音的影响。

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

3.Oracle 近似收缩:对 Ledoit-Wolf 收缩的改进,目标是通过对协方差矩阵进行调整,从而在样本大小较小的情况下更准确地估计真实的协方差矩阵。(编程实现与 Ledoit-Wolf 收缩同理)

2.5 主成分分析 PCA

主成分分析(Principal Component Analysis,PCA)是一种用于降维和提取数据主要特征的统计方法。其目标是通过线性变换,将原始数据映射到一个新的坐标系,使得数据在新坐标系下的方差最大化。

具体而言,PCA 首先找到数据中的主成分,也就是数据中方差最大的方向。然后,它找到与第一个主成分正交(无关)且具有最大方差的第二个主成分。这个过程一直重复,直到找到数据中所有的主成分。

LUCIDA:如何利用多因子策略构建强大的加密资产投资组合(因子合成篇)

Lecturas Relacionadas

TechFlow Intelligence Bureau: Anthropic IPO Odds Exceed 80%, Iran Closes Strait of Hormuz Again, Triggering Oil Price Volatility

**Market Digest** **AI & Tech:** Anthropic is widely expected to announce an IPO before November 2026, raising questions about balancing its trillion-dollar valuation ambitions with its core "AI safety" mission. Brands are increasingly adopting AI-generated virtual influencers for marketing. Cloudflare introduced temporary accounts for AI agents to ease automation workflows. **Infrastructure & Hardware:** Google's IPv6 traffic surpassed 50%, marking a major internet milestone. Goldman Sachs warned that massive projected AI capital expenditure ($5.3T) is approaching credit saturation limits, potentially curbing the "AI arms race." **Space & Robotics:** SpaceX's IPO saw a historic $370M retail buying frenzy in three days. Hyundai Motor Group plans to acquire full ownership of Boston Dynamics. Elon Musk speculated about future "septillion-dollar" investments in antimatter for interstellar travel. **Energy & Geopolitics:** Iran's military announced another closure of the strategic Strait of Hormuz, accusing Israel of violating a ceasefire, causing oil market volatility. However, ship-tracking data indicated some traffic continued. Concurrently, Iran resumed crude loadings at Kharg Island, potentially releasing up to 20 million barrels to the market. **Finance & Macro:** A European CLO (collateralized loan obligation) experienced its first post-2008-crisis-era equity tranche default, raising alarms in credit markets. Nomura warned that new Federal Reserve Chair Wash's perceived hawkish debut speech could signal a significant policy shift. **The Undercurrent:** Seemingly disparate events—the Strait of Hormuz tension, the European CLO default, and warnings on AI spending—point to a tightening of global liquidity and rising marginal costs across energy, credit, and tech investment. Meanwhile, capital continues chasing grand narratives like space exploration and advanced AI, highlighting a divergence where old-world leverage frays as new-world stories grow more ambitious.

marsbitHace 1 hora(s)

TechFlow Intelligence Bureau: Anthropic IPO Odds Exceed 80%, Iran Closes Strait of Hormuz Again, Triggering Oil Price Volatility

marsbitHace 1 hora(s)

The Hunter Becomes the Hunted: The Most Profitable MEV Bot Gets Hacked

A well-known and highly profitable Ethereum MEV Bot, Jaredfromsubway.eth, suffered a sophisticated on-chain attack this Saturday, losing over $7.5 million. Analysis by Blockaid and others reveals this was not a conventional phishing or smart contract exploit, but a targeted "counter-MEV honeypot attack." The attacker meticulously laid a trap over several weeks, deploying 66 fake token contracts and liquidity pools disguised as major assets like WETH and USDC. These pools created the illusion of arbitrage opportunities. The MEV Bot's automated system detected these signals, executed trades, and in the process, granted approval permissions to attacker-controlled contracts. These approvals were not revoked, creating a persistent vulnerability. The attacker then exploited this in a single transaction, draining the bot's ETH, USDC, and USDT holdings. Jaredfromsubway.eth is notorious as one of Ethereum's most active and profitable MEV Bots, primarily known for executing "sandwich attacks" to profit from transaction slippage. Estimates suggest it has earned tens of millions in MEV revenue. The incident highlights escalating crypto security threats, demonstrating that even top-tier automated "predators" are vulnerable to novel, logic-based attacks designed to exploit their own operational rules. Following the hack, an unverified X account impersonating Jaredfromsubway.eth emerged, falsely offering a bounty for the return of funds, prompting developer warnings for users to stay vigilant.

marsbitHace 2 hora(s)

The Hunter Becomes the Hunted: The Most Profitable MEV Bot Gets Hacked

marsbitHace 2 hora(s)

Trading

Spot
Futuros
活动图片