Esempio n. 1
0
# # x12_corr1_ft = crtf.fish_trans(x12_corr2)
# # x12_corr1_ft_c = cum_spec(x12_corr1_ft)
# # # x12_corr1_ft_sm = 6*(crtf.ema(x12_corr1_ft_c, 5)-crtf.ema(x12_corr1_ft_c, 7))/(7-1)
# # x12_corr1_ft_sm = crtf.lrbeta(x12_corr1_ft_c, 5, lg=False)
# # x12_corr6_ = crtf.fish_inv_trans(x12_corr1_ft_sm)
# x12_corr6_ = crtf.fish_inv_trans(crtf.lrbeta(crtf.cumsum_special(crtf.fish_trans(x12_corr2)), 7, lg=False))
# ny = crtf.fst_nan(x12_corr6_)
# x12_corr6 = np.empty(x12_corr6_.shape[0])*np.nan
# x12_corr6[ny+7*3:] = x12_corr6_[ny+7*3:]
# crup.plot_ts(dt, x12_corr6)
#

# ---

x12_corr2 = np.ones(n)*np.nan
x12_corr2 = 3*crtf.ema(x1*x2, mi2)/np.sqrt(crtf.ema(x1**2, mi2)*crtf.ema(x2**2, mi2))-\
            2*crtf.ema(x1*x2, mi)/np.sqrt(crtf.ema(x1**2, mi)*crtf.ema(x2**2, mi))
crup.plot_ts(dt, x12_corr2)


x12_corr1_ft = crtf.fish_trans(x12_corr2)
x12_corr1_ft_c = cum_spec(x12_corr1_ft)
# x12_corr1_ft_sm = 6*(crtf.ema(x12_corr1_ft_c, 5)-crtf.ema(x12_corr1_ft_c, 7))/(7-1)
x12_corr1_ft_sm = crtf.lrbeta(x12_corr1_ft_c, 5, lg=False)
x12_corr6_ = crtf.fish_inv_trans(x12_corr1_ft_sm)
ny = crtf.fst_nan(x12_corr6_)
x12_corr6 = np.empty(x12_corr6_.shape[0])*np.nan
x12_corr6[ny+7*2:] = x12_corr6_[ny+7*2:]
crup.plot_ts(dt, x12_corr6)

x12_corr3 = crtf.cor_cc(testc1, testc2, mi)
Esempio n. 2
0


    print(i)
    print(Value[0:20])
    print(Yg[0:20])
    print(Wg[0:20])
    print(WgCs[0:20])
    print(jIdx)
    print(WgCs[jIdx])
    print(Ym[0:25])
    print(Y[0:25])

crup.plot_ts(x['Date'].values, Input)
crup.plot_ts(x['Date'].values, Y)
Y2 = crtf.ema(Input, Periods)
crup.plot_ts(x['Date'].values, Y2)




#
# def mma(x, m, lg=False):
#     n = x.shape[0]
#     ny = crtf.fst_nan(x)
#     mi = int(m)
#     x1 = crtf.fill(x)
#     y = np.empty(n)*np.nan
#     ym = np.empty(n)*np.nan
#     yg = np.empty(n-ny)*np.nan
#     wg = np.empty(n-ny)*np.nan