Commit a2f61993 authored by 王志伟's avatar 王志伟

数据指标波动假设检验统计

parent 63d0b99e
...@@ -86,36 +86,33 @@ print(y_crv_new) ...@@ -86,36 +86,33 @@ print(y_crv_new)
# #
# #
# #
# def t_test(x,y): #进行t检验 def t_test(x,y): #进行t检验
#
# #策略前的数据,赋值给x,策略后的数据赋值给y,均采用10日内数据 #策略前的数据,赋值给x,策略后的数据赋值给y,均采用10日内数据
# x=[2,4,2,3,4,2,3] #检验数据方差是否齐性
# y=[4,5,6,3,4,5,6] a=levene(x,y)
# p_value=a[1] #结果若p_value>0.05,则认为两组数据方差是相等的,否则两组数据方差是不等的
# #检验数据方差是否齐性
# a=levene(x,y) if p_value>0.05: #认为数据方差具有齐性,equal_var=ture
# p_value=a[1] #结果若p_value>0.05,则认为两组数据方差是相等的,否则两组数据方差是不等的 t_test=ttest_ind(x,y,equal_var=True)
# t_p_value=t_test[1]
# if p_value>0.05: #认为数据方差具有齐性,equal_var=ture if t_p_value>0.05:
# t_test=ttest_ind(x,y,equal_var=True) print("策略前后两组数据无显著性差异,即该指标没有显著提升,p_value:%f" % t_p_value)
# t_p_value=t_test[1] else:
# if t_p_value>0.05: print("策略前后两组数据有显著性差异,即该指标获得显著提升,p_value:%f" % t_p_value)
# print("策略前后两组数据无显著性差异,即该指标没有显著提升,p_value:%f" % t_p_value) else: #认为数据方差不具有齐性,equal_var=false
# else: t_test = ttest_ind(x, y, equal_var=False)
# print("策略前后两组数据有显著性差异,即该指标获得显著提升,p_value:%f" % t_p_value) t_p_value = t_test[1]
# else: #认为数据方差不具有齐性,equal_var=false if t_p_value > 0.05:
# t_test = ttest_ind(x, y, equal_var=False) print("策略前后两组数据无显著性差异,即该指标没有显著提升,p_value:%f" % t_p_value)
# t_p_value = t_test[1] else:
# if t_p_value > 0.05: print("策略前后两组数据有显著性差异,即该指标获得显著提升,p_value:%f" % t_p_value)
# print("策略前后两组数据无显著性差异,即该指标没有显著提升,p_value:%f" % t_p_value)
# else:
# print("策略前后两组数据有显著性差异,即该指标获得显著提升,p_value:%f" % t_p_value)
# #
# ###假设检验,判断是否具有显著性 # ###假设检验,判断是否具有显著性
# #
# #新用户cvr假设检验 #新用户cvr假设检验
# crv_new_ttest=t_test(x_crv_new,y_crv_new) crv_new_ttest=t_test(x_crv_new,y_crv_new)
# #老用户cvr假设检验 #老用户cvr假设检验
# crv_old_ttest=t_test(x_crv_old,y_crv_old) # crv_old_ttest=t_test(x_crv_old,y_crv_old)
# #
# #新用户ct_cvr假设检验 # #新用户ct_cvr假设检验
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment