macrosynergy.panel.lincomb_adjust#
- linear_combination_adjustment(df, adj_zns_xcat, weights_xcat, cids=None, min_score=None, coeff_new=0.5, normalize=True, normalize_to_pct=False, adj_name='lincomb')[source]#
Adjust the weights of the zns scores based on the linear combination of the cross-sectional values.
- Parameters:
df (QuantamentalDataFrame) – The input dataframe.
zns_xcat (str) – The category of the zns scores to adjust. This category should be present in the df.
min_score (float, optional) – The minimum score to consider. Default is None, where it is set to the minimum score discovered in the panel of zns_xcat.
coeff_new (float, optional) – The coefficient to use for the new weights. Default is 0.5.
normalize (bool, optional) – Whether to normalize the weights. Default is True.
normalize_to_pct (bool, optional) – Whether to normalize the weights to percentages. Default is False.
adj_name (str, optional) – The name of the new category. Default is “lincomb”.
- Returns:
The adjusted dataframe.
- Return type: