own_tech.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Multiple-factor-risk-model 作者: icezerowjj 项目源码 文件源码
def ret_reg_loading(tech_loading,ret,dummy):
    '''
    ???????111????Loading??????111??????????????????????????
    :param tech_loading:
    :param ret:
    :return:
    '''
    # ???????
    significant_days=dict()
    for tech in tech_loading.columns:
        significant_days[tech]=0
    # ??????111?????loading????
    for tech in tech_loading.columns:
        # ?????111???????????
        for i in range(ret.shape[0]):
            model = sm.OLS(ret.iloc[i,:].values, pd.concat([tech_loading[tech],dummy],axis=1).values).fit()
            pvalue=model.pvalues[0]
            if pvalue<0.1:
                significant_days[tech]+=1
    return significant_days
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号