MCPcopy Create free account

hub / github.com/JoinQuant/jqfactor_analyzer / functions

Functions218 in github.com/JoinQuant/jqfactor_analyzer

↓ 1 callersFunctionneutralize
中性化 data: pd.Series/pd.DataFrame, 待中性化的序列, 序列的 index/columns 为股票的 code how: str list. 中性化使用的因子名称列表. 默认为 ['jq_l1', 'market_cap'], 支持的中性化方法有:
jqfactor_analyzer/preprocess.py:230
↓ 1 callersFunctionplotting_context
(context='notebook', font_scale=1.5, rc=None)
jqfactor_analyzer/plot_utils.py:32
↓ 1 callersFunctionquantile_turnover
计算当期在分位数中的因子不在上一期分位数中的比例 Parameters ---------- quantile_factor : pd.Series 包含日期, 资产, 和因子分位数的 DataFrame. quantile : int
jqfactor_analyzer/performance.py:387
↓ 1 callersMethodquantile_turnover
换手率分析 返回值一个 dict, key 是 period, value 是一个 DataFrame(index 是日期, column 是分位数)
jqfactor_analyzer/analyze.py:862
↓ 1 callersFunctionrethrow
重新抛出当前作用域中的最后一个异常, 保留堆栈信息, 并且在报错信息中添加其他内容
jqfactor_analyzer/exceptions.py:7
↓ 1 callersFunctionrolling_apply
( x, window, func, min_periods=None, freq=None, center=False, args=None, kwarg
jqfactor_analyzer/compat.py:14
↓ 1 callersFunctionset_cache_dir
设置缓存目录
jqfactor_analyzer/factor_cache.py:34
↓ 1 callersFunctionstandardlize
(data, inf2nan=True, axis=1)
jqfactor_analyzer/preprocess.py:158
↓ 1 callersFunctionvalid_index
(s)
jqfactor_analyzer/preprocess.py:278
↓ 1 callersFunctionweighted_mean_return
计算(年化)加权平均/标准差
jqfactor_analyzer/performance.py:263
↓ 1 callersFunctionwinsorize
(data, scale=None, range=None, qrange=None, inclusive=True, inf2nan=True, axis=1)
jqfactor_analyzer/preprocess.py:18
↓ 1 callersFunctionwinsorize_med
(data, scale=1, inclusive=True, inf2nan=True, axis=1)
jqfactor_analyzer/preprocess.py:98
Method__init__
(self, factor, prices, groupby=None, weights=1.0, quantiles=None, bins=None, periods=(1, 5, 1
jqfactor_analyzer/analyze.py:235
Method__init__
参数 ---------- weights: 持仓权重信息, index 是日期, columns 是标的代码, value 对应的是当天的仓位占比 (单日仓位占比总和不为 1 时, 剩余部分认为是当天的现金)
jqfactor_analyzer/attribution.py:61
Method__init__
数据接口, 用于因子分析获取数据 参数 ---------- price : 使用开盘价/收盘价计算收益 (请注意避免未来函数), 默认为 'close' - 'close': 使用当日收盘价和次日收盘价计算当日因子的远期收益
jqfactor_analyzer/data.py:16
Method_factor_quantile
(self)
jqfactor_analyzer/analyze.py:308
Method_get_average_weights
(self, securities, start_date, end_date)
jqfactor_analyzer/data.py:421
Method_get_cached_mkt_cap_by_valuation
市值处理函数, 将获取的市值数据缓存到本地
jqfactor_analyzer/data.py:332
Method_get_circulating_market_cap
(self, securities, start_date, end_date, ln=False)
jqfactor_analyzer/data.py:416
Method_mean_return_by_date
(self)
jqfactor_analyzer/analyze.py:685
Functionagg
(values, weights)
jqfactor_analyzer/performance.py:267
Functionanalyze_factor
单因子分析 输入: factor: pandas.DataFrame: 因子值, columns 为股票代码 (如 '000001.XSHE'), index 为 日期的 DatetimeI
jqfactor_analyzer/__init__.py:11
Methodapi
(self)
jqfactor_analyzer/data.py:167
Methodapis
(self)
jqfactor_analyzer/data.py:445
Methodattr_daily_returns
(self)
jqfactor_analyzer/attribution.py:222
Methodattr_returns
(self)
jqfactor_analyzer/attribution.py:229
Functionattribution_analysis
归因分析 用户需要提供的数据: 1. 日度股票持仓权重 (加总不为 1 的剩余部分视为现金) 2. 组合的的日度收益率 (使用 T 日持仓盘后的因子暴露与 T+1 日的收益进行归因分析) 组合风格因子暴露 (含行业, country) = sum(组合权重 * 个
jqfactor_analyzer/__init__.py:51
Methodauth
(self, username='', password='')
jqfactor_analyzer/data.py:159
Functionaverage_cumulative_return
(q_fact, demean_by)
jqfactor_analyzer/performance.py:499
Methodcalc_autocorrelation_n_days_lag
滞后1-n天因子值自相关性 参数: n: 滞后1天到n天的因子值自相关性 rank: - True: 秩相关系数 - False: 普通相关系数
jqfactor_analyzer/analyze.py:571
Methodcalc_ic_mean_n_days_lag
滞后 0 - n 天因子收益信息比率(IC)的均值 滞后 n 天 IC 表示使用当日因子值和滞后 n 天的因子收益计算 IC 参数: n: 滞后0-n天因子收益的信息比率(IC)的均值 group_adjust: -
jqfactor_analyzer/analyze.py:613
Methodcalc_quantile_turnover_mean_n_days_lag
各分位数滞后1天到n天的换手率均值 参数: n: 滞后 1 天到 n 天的换手率
jqfactor_analyzer/analyze.py:550
Functioncall_w_context
(*args, **kwargs)
jqfactor_analyzer/plot_utils.py:16
Methodclean_factor_data
(self)
jqfactor_analyzer/analyze.py:304
Functioncompute_mean_returns_spread
计算两个分位数的平均收益之差, 和(可选)计算此差异的标准差 参数 ---------- mean_returns : pd.DataFrame 各分位数因子远期收益均值 upper_quant : int 作为被减数的因子
jqfactor_analyzer/performance.py:344
Methodcreate_event_returns_tear_sheet
因子预测能力分析 参数: avgretplot: tuple 因子预测的天数 -(计算过去的天数, 计算未来的天数) demeaned: 详见 calc_mean_return_by_quantile 中 demean
jqfactor_analyzer/analyze.py:1403
Methodcreate_full_tear_sheet
全部分析 参数: demeaned: - True:使用超额收益计算 (基准收益被认为是每日所有股票收益按照weight列中权重加权的均值) - False:不使用超额收益 group_adjust:
jqfactor_analyzer/analyze.py:1439
Methodcreate_information_tear_sheet
因子 IC 分析 参数: group_adjust: - True: 使用行业中性收益 (行业收益被认为是每日各个行业股票收益按照weight列中权重的加权的均值) - False: 不使用行业中性收益 by_grou
jqfactor_analyzer/analyze.py:1370
Methodcreate_returns_tear_sheet
因子值特征分析 参数: demeaned: 详见 calc_mean_return_by_quantile 中 demeaned 参数 - True: 使用超额收益计算 (基准收益被认为是每日所有股票收益按照weight列中权重加权的
jqfactor_analyzer/analyze.py:1324
Methodcreate_summary_tear_sheet
因子值特征分析 参数: demeaned: - True: 对每日因子收益去均值求得因子收益表 - False: 因子收益表 group_adjust: - True: 按行业对因子收益去均值后求得因子
jqfactor_analyzer/analyze.py:1306
Methodcreate_turnover_tear_sheet
因子换手率分析 参数: turnover_periods: 调仓周期
jqfactor_analyzer/analyze.py:1391
Methodcumulative_return_by_quantile
(self)
jqfactor_analyzer/analyze.py:881
Functioncustomize
(func)
jqfactor_analyzer/plot_utils.py:13
Functiondec
(*args, **kwargs)
jqfactor_analyzer/exceptions.py:35
Functiondecorator
(func)
jqfactor_analyzer/utils.py:30
Methodfactor_cn_name
(self)
jqfactor_analyzer/attribution.py:164
Functionfunc_wrapper
(*args, **kwargs)
jqfactor_analyzer/utils.py:32
Methodget_groupby
(self, securities, start_date, end_date)
jqfactor_analyzer/data.py:324
Methodget_mkt_cap
(s, date, field)
jqfactor_analyzer/data.py:363
Methodget_mkt_cap_cache
(s, date, field)
jqfactor_analyzer/data.py:371
Methodget_prices
(self, securities, start_date=None, end_date=None, period=None)
jqfactor_analyzer/data.py:260
Methodget_weights
(self, securities, start_date, end_date)
jqfactor_analyzer/data.py:424
Methodic
IC 分析, 日度 ic 返回 DataFrame, index 是时间, column 是 period 的值 (1, 5, 10)
jqfactor_analyzer/analyze.py:841
Methodic_by_group
行业 ic
jqfactor_analyzer/analyze.py:849
Methodic_monthly
(self)
jqfactor_analyzer/analyze.py:854
Functionignore_warning
过滤 warnings
jqfactor_analyzer/utils.py:28
Functionlist_to_tuple_converter
(func)
jqfactor_analyzer/factor_cache.py:66
Methodmean_return_by_date
(self)
jqfactor_analyzer/analyze.py:695
Methodmean_return_by_group
分行业的分位数收益 返回值: MultiIndex 的 DataFrame index 分别是分位数、 行业名称, column 是 period (1, 5, 10)
jqfactor_analyzer/analyze.py:712
Functionmean_return_by_quantile
计算各分位数的因子远期收益均值和标准差 参数 ---------- factor_data : pd.DataFrame - MultiIndex 一个 DataFrame, index 为日期 (level 0) 和资产(level 1) 的 M
jqfactor_analyzer/performance.py:292
Methodmean_return_spread_by_quantile
(self)
jqfactor_analyzer/analyze.py:740
Methodmean_return_spread_std_by_quantile
(self)
jqfactor_analyzer/analyze.py:745
Methodmean_return_std_by_date
(self)
jqfactor_analyzer/analyze.py:700
Methodmean_return_std_by_group
(self)
jqfactor_analyzer/analyze.py:729
Methodmean_return_std_by_quantile
收益分析 用来画分位数收益的柱状图 返回 pandas.DataFrame, index 是 factor_quantile, 值是(1, 2, 3, 4, 5), column 是 period 的值 (1, 5, 10)
jqfactor_analyzer/analyze.py:667
Functionnon_unique_bin_edges_error
捕获 pd.qcut 的异常, 添加提示信息并报错
jqfactor_analyzer/exceptions.py:20
Functionplot_cumulative_returns
(factor_returns, period=1, overlap=True, ax=None)
jqfactor_analyzer/plotting.py:542
Functionplot_cumulative_returns_by_quantile
( quantile_returns, period=1, overlap=True, ax=None )
jqfactor_analyzer/plotting.py:582
Methodplot_disable_chinese_label
关闭中文图例显示 画图时默认会从系统中查找中文字体显示以中文图例 如果找不到中文字体则默认使用英文图例 当找到中文字体但中文显示乱码时, 可调用此 API 关闭中文图例显示而使用英文
jqfactor_analyzer/analyze.py:1521
Methodplot_disable_chinese_label
关闭中文图例显示 画图时默认会从系统中查找中文字体显示以中文图例 如果找不到中文字体则默认使用英文图例 当找到中文字体但中文显示乱码时, 可调用此 API 关闭中文图例显示而使用英文
jqfactor_analyzer/attribution.py:489
Functionplot_events_distribution
(events, num_days=5, full_dates=None, ax=None)
jqfactor_analyzer/plotting.py:702
Methodplot_events_distribution
画有效因子数量统计图 参数: num_days: 统计间隔天数
jqfactor_analyzer/analyze.py:1294
Methodplot_exposure
绘制风格暴露 factors: 绘制的暴露类型 , 可选 'style'(所有风格因子), 'industry'(所有行业因子), 也可以传递一个list, list 为 exposure_portfolio 中 columns 的一个或者多个 index_symbo
jqfactor_analyzer/attribution.py:358
Methodplot_exposure_and_returns
将因子暴露与收益同时绘制在多个子图上 factors: 绘制的暴露类型, 可选 'style'(所有风格因子) , 'industry'(所有行业因子), 也可以传递一个 list, list为 exposure_portfolio 中 columns 的一个或者多个
jqfactor_analyzer/attribution.py:419
Functionplot_factor_rank_auto_correlation
( factor_autocorrelation, period=1, ax=None )
jqfactor_analyzer/plotting.py:441
Functionplot_ic_by_group
(ic_group, ax=None)
jqfactor_analyzer/plotting.py:427
Functionplot_ic_hist
(ic, ax=None)
jqfactor_analyzer/plotting.py:143
Methodplot_ic_hist
画信息比率分布直方图 参数: group_adjust: - True: 使用行业中性收益 (行业收益被认为是每日各个行业股票收益按照weight列中权重的加权的均值) - False: 不使用行业中性收益 metho
jqfactor_analyzer/analyze.py:980
Functionplot_ic_qq
(ic, theoretical_dist=stats.norm, ax=None)
jqfactor_analyzer/plotting.py:183
Functionplot_ic_ts
(ic, ax=None)
jqfactor_analyzer/plotting.py:93
Functionplot_information_table
(ic_data, return_df=False)
jqfactor_analyzer/plotting.py:61
Functionplot_mean_quantile_returns_spread_time_series
( mean_returns_spread, std_err=None, bandwidth=1, ax=None )
jqfactor_analyzer/plotting.py:356
Functionplot_missing_events_distribution
( events, num_days=5, full_dates=None, ax=None )
jqfactor_analyzer/plotting.py:744
Functionplot_monthly_ic_heatmap
(mean_monthly_ic, ax=None)
jqfactor_analyzer/plotting.py:494
Functionplot_quantile_average_cumulative_return
( avg_cumulative_returns, by_quantile=False, std_bar=False, ax=None, periods_before='',
jqfactor_analyzer/plotting.py:615
Functionplot_quantile_returns_bar
( mean_ret_by_q, by_group=False, ylim_percentiles=None, ax=None )
jqfactor_analyzer/plotting.py:225
Functionplot_quantile_returns_violin
(return_by_q, ylim_percentiles=None, ax=None)
jqfactor_analyzer/plotting.py:305
Functionplot_quantile_statistics_table
(factor_data, return_df=False)
jqfactor_analyzer/plotting.py:79
Methodplot_returns
绘制归因分析收益信息 factors: 绘制的暴露类型, 可选 'style'(所有风格因子), 'industry'(所有行业因子), 也可以传递一个 list, list 为 exposure_portfolio 中 columns 的一个或者多个
jqfactor_analyzer/attribution.py:382
Functionplot_returns_table
(alpha_beta, mean_ret_quantile, mean_ret_spread_quantile)
jqfactor_analyzer/plotting.py:28
Functionplot_top_bottom_quantile_turnover
(quantile_turnover, period=1, ax=None)
jqfactor_analyzer/plotting.py:471
Functionplot_top_down_cumulative_returns
(factor_returns, period=1, ax=None)
jqfactor_analyzer/plotting.py:563
Functionplot_turnover_table
(autocorrelation_data, quantile_turnover, return_df=False)
jqfactor_analyzer/plotting.py:42
Functionquantile_calc
(x, _quantiles, _bins, _zero_aware, _no_raise)
jqfactor_analyzer/prepare.py:58
Functionrate_of_return
转换回报率为"每期"回报率:如果收益以稳定的速度增长, 则相当于每期的回报率
jqfactor_analyzer/prepare.py:453
Functionrate_of_returns
(ret, period)
jqfactor_analyzer/performance.py:245
Functionrolling_std
(x, window, min_periods=None, center=False, ddof=1)
jqfactor_analyzer/compat.py:63
Functionsplit_portfolio
(ret, period)
jqfactor_analyzer/performance.py:233
Functionsrc_ic
(group)
jqfactor_analyzer/performance.py:36
Functionstd_conversion
转换回报率标准差为"每期"回报率标准差
jqfactor_analyzer/prepare.py:461
← previousnext →101–200 of 218, ranked by callers