Пример #1
0
###################################################################
###### find missing dates #########################################
###################################################################

vector_dates = np.concatenate([
    np.array(data[data.columns[0]]),
    np.array(data2[data2.columns[0]]),
    np.array(data3[data3.columns[0]]),
    np.array(data4[data4.columns[0]]),
    np.array(data5[data5.columns[0]]),
    np.array(data6[data6.columns[0]])
])

global_dates = temp.dates(pd.Series(vector_dates))

missing = Functions_for_TSP.finding_missing_dates(global_dates, milano)
missing2 = Functions_for_TSP.finding_missing_dates(global_dates, torino)

test = Functions_for_TSP.update_meteo(milano, torino)
test.to_csv('storico_milano_aggiornato.txt', sep="\t", index=False)
missing2 = Functions_for_TSP.finding_missing_dates(global_dates, test)

missingca = Functions_for_TSP.finding_missing_dates(global_dates, ca)
missingpa = Functions_for_TSP.finding_missing_dates(global_dates, pa)
missingrc = Functions_for_TSP.finding_missing_dates(global_dates, rc)
missingfi = Functions_for_TSP.finding_missing_dates(global_dates, fi)

diffmiro = Functions_for_TSP.simulate_meteo(milano, roma)
difffiro = Functions_for_TSP.simulate_meteo(fi, roma)
diffparo = Functions_for_TSP.simulate_meteo(pa, roma)
diffcaro = Functions_for_TSP.simulate_meteo(ca, roma)
Пример #2
0
plt.plot(min_season)

D, Y = temp.create_dataset(data, "ven")
Y = np.array(Y)

acf, Q, P, = statsmodels.tsa.stattools.acf(Y, nlags=48, qstat=True)
statsmodels.graphics.tsaplots.plot_acf(Y, lags=1000)

per = statsmodels.tsa.stattools.periodogram(Y)

plt.plot(per)

S_per = pd.Series(per)
S_per.describe()

peaks = Functions_for_TSP.find_peaks(per, 10)

FE = Functions_for_TSP.fourierExtrapolation(Y, n_predict=24)

fitted_FE = FE[0:8736]

diff = Y - fitted_FE
np.mean(diff)
np.var(diff)

#RMSE = np.sqrt(np.mean(diff**2))

sp_y = Functions_for_TSP.Signum_Process(Y)
sp_f = Functions_for_TSP.Signum_Process(fitted_FE)

sp_p = sp_y * sp_f