任务指令
气候风险韧性耦合因子
假设
气候相关风险对企业经营的冲击具有明显时滞，且不同公司在缓释能力上存在显著差异。若企业暴露度低且具备较强缓释能力（如供应商多元化、在地化生产、充足的灾害保险与应急预案），则在极端气候事件或相关政策冲击后，其股价表现相对稳健；反之，暴露高且缓释能力弱的企业往往在事件发生后出现更高的波动性和下跌风险。基于历史气候事件与企业缓释能力的组合，构建一个量化因子来捕捉“韧性-暴露耦合”的投资信号。
实施方案
数据组合与构建要点：
暴露Score：衡量企业在地理分布、行业敏感度、供应链集中度、原材料依赖程度等方面的气候暴露水平；可结合极端天气事件密度、区域气候风险指数、行业对气候敏感性的历史Correlation等信号。
缓释Score：衡量企业缓释能力的指标，如供应商多元化程度、在地化生产比例、保险覆盖率、灾害应急资金与预案披露水平、历史灾害恢复速度等。
韦尔斯分解/耦合分数：将暴露Score与缓释Score按权重组合，形成综合的气候韧性分数（越高表示越强的韧性，越低表示越脆弱）。可通过分组算子对相同暴露水平的公司进行缓释能力横截面比较，或通过时序分位数算子观察过去六至十二个月的变化趋势并回填缺失数据。
交易规则设计：
当综合韧性分数处于低位（高暴露、低缓释）时建立空头仓位；当分数处于高位（低暴露、高缓释）时建立多头仓位。
观察窗口：以季度为基本观测单位，事件发生后在8–12周内动态调整权重与敞口，以捕捉缓释效应的滚动效应。
风险控制：设置最低/最高头寸限制、以及波动性或最大回撤约束，避免因单一事件极端化组合。
数据处理与算子思路（可在你现有的数据处理框架中应用）：
时序回填算子（ts_backfill）用于修复因事件导致的缺失数据。
横截面分组算子用于同类企业的缓释能力对比与排名。
分布形态转换算子对暴露与缓释分数进行标准化处理，便于跨行业比较。
行业中性化处理：对不同行业的气候暴露特征差异进行中性化，以提升因子稳定性。
情景分组算子：根据不同气候事件强度情景对信号权重进行调整，提升在极端情况下的鲁棒性。
监控与修订：
定期回顾暴露与缓释分数的权重设定，结合宏观气候情景更新参数。
进行滚动回测，评估因子在不同经济周期和地区市场的稳定性与盈利能力。
阿尔法因子优化建议
行业中性化与分组分析：对不可比的行业暴露差异进行中性化处理，按行业分组比较缓释能力与暴露的组合信号。
场景驱动的权重调整：引入极端气候情景（如强降雨洪水、干旱、热浪等）的权重分组，针对不同情景对韧性信号进行动态排序与权重分配。
数据正态化与稳定性：对暴露/缓释分数执行Box-Cox或Z-score等标准化，减少极端值对回测的影响；对因子进行多因子回归的稳健性检验，排除数据分布偏态带来的误导。
跨时间维度的一致性评估：使用滚动相关性与超额收益回归，检验气候韧性因子在不同时间段的稳定性，避免后验过拟合。
组合构建策略：采用分位排序+等权或分层权重分配的方式，避免单点极端信号带来过度换手；结合风险预算模型控制因子暴露。
解释性与透明性：对因子信号进行逐项解释，明确暴露与缓释指标的权重来源，提升策略的可解释性与合规性。
*=========================================================================================*
输出格式：
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹（如引号）、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在，请严格遵守以上所有规则，开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西)：
表达式
表达式
表达式
...
表达式
=================================================================
重申：请确保所有表达式都使用WorldQuant WebSim平台函数，不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha：
必须遵守操作符的使用方法

以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子

========================= 操作符开始 =======================================注意: Operator: 后面的是操作符,
Description: 此字段后面的是操作符对应的描述或使用说明, Description字段后面的内容是使用说明, 不是操作符
特别注意!!!! 必须按照操作符字段Operator的使用说明生成 alphaOperator: abs(x)
Description: Absolute value of x
Operator: add(x, y, filter = false)
Description: Add all inputs (at least 2 inputs required). If filter = true, filter all input NaN to 0 before adding
Operator: densify(x)
Description: Converts a grouping field of many buckets into lesser number of only available buckets so as to make working with grouping fields computationally efficient
Operator: divide(x, y)
Description: x / y
Operator: inverse(x)
Description: 1 / x
Operator: log(x)
Description: Natural logarithm. For example: Log(high/low) uses natural logarithm of high/low ratio as stock weights.
Operator: max(x, y, ..)
Description: Maximum value of all inputs. At least 2 inputs are required
Operator: min(x, y ..)
Description: Minimum value of all inputs. At least 2 inputs are required
Operator: multiply(x ,y, ... , filter=false)
Description: Multiply all inputs. At least 2 inputs are required. Filter sets the NaN values to 1
Operator: power(x, y)
Description: x ^ y
Operator: reverse(x)
Description: - x
Operator: sign(x)
Description: if input > 0, return 1; if input < 0, return -1; if input = 0, return 0; if input = NaN, return NaN;
Operator: signed_power(x, y)
Description: x raised to the power of y such that final result preserves sign of x
Operator: sqrt(x)
Description: Square root of x
Operator: subtract(x, y, filter=false)
Description: x-y. If filter = true, filter all input NaN to 0 before subtracting
Operator: and(input1, input2)
Description: Logical AND operator, returns true if both operands are true and returns false otherwise
Operator: if_else(input1, input2, input 3)
Description: If input1 is true then return input2 else return input3.
Operator: input1 < input2
Description: If input1 < input2 return true, else return false
Operator: input1 <= input2
Description: Returns true if input1 <= input2, return false otherwise
Operator: input1 == input2
Description: Returns true if both inputs are same and returns false otherwise
Operator: input1 > input2
Description: Logic comparison operators to compares two inputs
Operator: input1 >= input2
Description: Returns true if input1 >= input2, return false otherwise
Operator: input1!= input2
Description: Returns true if both inputs are NOT the same and returns false otherwise
Operator: is_nan(input)
Description: If (input == NaN) return 1 else return 0
Operator: not(x)
Description: Returns the logical negation of x. If x is true (1), it returns false (0), and if input is false (0), it returns true (1).
Operator: or(input1, input2)
Description: Logical OR operator returns true if either or both inputs are true and returns false otherwise
Operator: days_from_last_change(x)
Description: Amount of days since last change of x
Operator: hump(x, hump = 0.01)
Description: Limits amount and magnitude of changes in input (thus reducing turnover)
Operator: kth_element(x, d, k)
Description: Returns K-th value of input by looking through lookback days. This operator can be used to backfill missing data if k=1
Operator: last_diff_value(x, d)
Description: Returns last x value not equal to current x value from last d days
Operator: ts_arg_max(x, d)
Description: Returns the relative index of the max value in the time series for the past d days. If the current day has the max value for the past d days, it returns 0. If previous day has the max value for the past d days, it returns 1
Operator: ts_arg_min(x, d)
Description: Returns the relative index of the min value in the time series for the past d days; If the current day has the min value for the past d days, it returns 0; If previous day has the min value for the past d days, it returns 1.
Operator: ts_av_diff(x, d)
Description: Returns x - tsmean(x, d), but deals with NaNs carefully. That is NaNs are ignored during mean computation
Operator: ts_backfill(x,lookback = d, k=1, ignore="NAN")
Description: Backfill is the process of replacing the NAN or 0 values by a meaningful value (i.e., a first non-NaN value)
Operator: ts_corr(x, y, d)
Description: Returns correlation of x and y for the past d days
Operator: ts_count_nans(x ,d)
Description: Returns the number of NaN values in x for the past d days
Operator: ts_covariance(y, x, d)
Description: Returns covariance of y and x for the past d days
Operator: ts_decay_linear(x, d, dense = false)
Description: Returns the linear decay on x for the past d days. Dense parameter=false means operator works in sparse mode and we treat NaN as 0. In dense mode we do not.
Operator: ts_delay(x, d)
Description: Returns x value d days ago
Operator: ts_delta(x, d)
Description: Returns x - ts_delay(x, d)
Operator: ts_mean(x, d)
Description: Returns average value of x for the past d days.
Operator: ts_product(x, d)
Description: Returns product of x for the past d days
Operator: ts_quantile(x,d, driver="gaussian" )
Description: It calculates ts_rank and apply to its value an inverse cumulative density function from driver distribution. Possible values of driver (optional ) are "gaussian", "uniform", "cauchy" distribution where "gaussian" is the default.
Operator: ts_rank(x, d, constant = 0)
Description: Rank the values of x for each instrument over the past d days, then return the rank of the current value + constant. If not specified, by default, constant = 0.
Operator: ts_regression(y, x, d, lag = 0, rettype = 0)
Description: Returns various parameters related to regression function
Operator: ts_scale(x, d, constant = 0)
Description: Returns (x - ts_min(x, d)) / (ts_max(x, d) - ts_min(x, d)) + constant. This operator is similar to scale down operator but acts in time series space
Operator: ts_std_dev(x, d)
Description: Returns standard deviation of x for the past d days
Operator: ts_step(1)
Description: Returns days' counter
Operator: ts_sum(x, d)
Description: Sum values of x for the past d days.
Operator: ts_zscore(x, d)
Description: Z-score is a numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean: (x - tsmean(x,d)) / tsstddev(x,d). This operator may help reduce outliers and drawdown.
Operator: normalize(x, useStd = false, limit = 0.0)
Description: Calculates the mean value of all valid alpha values for a certain date, then subtracts that mean from each element
Operator: quantile(x, driver = gaussian, sigma = 1.0)
Description: Rank the raw vector, shift the ranked Alpha vector, apply distribution (gaussian, cauchy, uniform). If driver is uniform, it simply subtract each Alpha value with the mean of all Alpha values in the Alpha vector
Operator: rank(x, rate=2)
Description: Ranks the input among all the instruments and returns an equally distributed number between 0.0 and 1.0. For precise sort, use the rate as 0
Operator: scale(x, scale=1, longscale=1, shortscale=1)
Description: Scales input to booksize. We can also scale the long positions and short positions to separate scales by mentioning additional parameters to the operator
Operator: winsorize(x, std=4)
Description: Winsorizes x to make sure that all values in x are between the lower and upper limits, which are specified as multiple of std.
Operator: zscore(x)
Description: Z-score is a numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean
Operator: vec_avg(x)
Description: Taking mean of the vector field x
Operator: vec_sum(x)
Description: Sum of vector field x
Operator: bucket(rank(x), range="0, 1, 0.1" or buckets = "2,5,6,7,10")
Description: Convert float values into indexes for user-specified buckets. Bucket is useful for creating group values, which can be passed to GROUP as input
Operator: trade_when(x, y, z)
Description: Used in order to change Alpha values only under a specified condition and to hold Alpha values in other cases. It also allows to close Alpha positions (assign NaN values) under a specified condition
Operator: group_backfill(x, group, d, std = 4.0)
Description: If a certain value for a certain date and instrument is NaN, from the set of same group instruments, calculate winsorized mean of all non-NaN values over last d days
Operator: group_mean(x, weight, group)
Description: All elements in group equals to the mean
Operator: group_neutralize(x, group)
Description: Neutralizes Alpha against groups. These groups can be subindustry, industry, sector, country or a constant
Operator: group_rank(x, group)
Description: Each elements in a group is assigned the corresponding rank in this group
Operator: group_scale(x, group)
Description: Normalizes the values in a group to be between 0 and 1. (x - groupmin) / (groupmax - groupmin)
Operator: group_zscore(x, group)
Description: Calculates group Z-score - numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean. zscore = (data - mean) / stddev of x for each instrument within its group.
========================= 操作符结束 =======================================

========================= 数据字段开始 =======================================
注意: data_set_name: 后面的是数据字段(可以使用), description: 此字段后面的是数据字段对应的描述或使用说明(不能使用), description_cn字段后面的内容是中文使用说明(不能使用)

{'data_set_name': 'fnd6_capxv', 'description': 'Capital Expend Property, Plant and Equipment Schd V', 'description_cn': '资本支出资产、 plant 和设备计划表 V'}
{'data_set_name': 'fscore_bfl_total', 'description': 'The final score M-Score is a weighted average of both the Pentagon surface score and the Pentagon acceleration score.', 'description_cn': '最终得分M-_score=五角大楼表面评分与五角加速评分加权平均值'}
{'data_set_name': 'rp_nip_ratings', 'description': 'News impact projection of analyst ratings-related news', 'description_cn': '分析师评级相关新闻的/news_impact_projection'}
{'data_set_name': 'fnd2_a_ltrmdmrepopliny5', 'description': 'Amount of long-term debt payable, sinking fund requirements, and other securities issued that are redeemable by holder at fixed or determinable prices and dates maturing in the 5th fiscal year following the latest fiscal year. Excludes interim and annual periods when interim periods are reported on a rolling approach, from latest balance sheet date.', 'description_cn': '长期债务应付金额, sinking fund要求,及其他可由持有者在固定或可确定价格及日期于第5个财政年度内赎回的其他证券,不包括采用滚动期间报告的中间和年度期段从最新资产负债表日期起的期间。'}
========================= 数据字段结束 =======================================

以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合