Esempio n. 1
0
def plotErrorCorrection(prices, forecast, preds, company):

    datesF = list(forecast.index.values)[1:]
    datesP = list(prices.index.values)

    valuesF = list(forecast['FORECAST'].values)[1:]
    valuesP = list(prices['PRC'].values)
    colorF = list(forecast['OFFSET'].values)[1:]

    datesPred = list(preds['MONTH'].values)
    valuesPred = list(preds['VALUE'].values)
    variationP = list([0]*len(valuesPred))
    for i in range(len(datesPred)):
        datesPred[i] = datesPred[i]+12

    minC = min(variationP)
    maxC = max(variationP)
    '''variationP = list(forecast['VALUES'].values)
    variationP = np.nan_to_num(variationP)
    variation = [-val for val in variationP]
    print(variation)
    minC = min(variation)
    maxC = max(variation)

    print(variation)
    print(forecast)'''

    ploting_utilities.plots2D([datesP,datesF,datesPred],
                              [valuesP,valuesF,valuesPred],
                              [None,None,variationP],
                              [False,False,True],
                              company,
                              minC,
                              maxC)
Esempio n. 2
0
def test():
    x1 = [10, 11, 12, 13]
    y1 = [100, 101, 102, 103]
    x2 = [11, 12, 13, 14]
    y2 = [101, 102, 103, 104]

    ploting_utilities.plots2D([x1, x2], [y1, y2])
Esempio n. 3
0
def plotRelative(prices, preds, grades, forecast, company):
    datesF = list(forecast.index.values)
    for i in range(len(datesF)):
        datesF[i] = datesF[i]

    forecasts = list(forecast['FORECAST'].values)
    valprice = list(prices['PRC'].values)
    datesprice = list(prices.index.values)

    gradeDate = [i+12 for i in grades['MONTH'].values]
    gradePreds = list(grades['VALUE'].values)
    gradeGrades = list(grades['GRADE'].values)

    ploting_utilities.plots2D([datesF, datesprice, gradeDate],
                              [forecasts, valprice, gradePreds],
                              [None,None,gradeGrades],
                              [False,False,True],
                              company)
Esempio n. 4
0
def plotAbsolute(prices, preds, grades, forecast, company):
    datesF = list(forecast['MONTH'].values)
    for i in range(len(datesF)):
        datesF[i] = datesF[i]

    forecasts = list(forecast['FORECAST'].values)
    bestF = list(forecast['BEST_FORECAST'].values)
    straightF = list(forecast['STRAIGHT_FORECAST'].values)
    valprice = list(prices['PRC'].values)
    datesprice = list(prices.index.values)

    gradeDate = list(grades['MONTH'].values)
    gradePreds = list(grades['FORECAST'].values)
    gradeGrades = list(grades['GRADE'].values)

    ploting_utilities.plots2D(
        [datesF, datesprice, datesF, datesF, gradeDate],
        [forecasts, valprice, bestF, straightF, gradePreds],
        [None, None, None, None, gradeGrades],
        [False, False, False, False, True], company)
Esempio n. 5
0
def plotShortTerm(prices, forecast, company):

    datesF = list(forecast.index.values)[1:]
    datesP = list(prices.index.values)

    valuesF = list(forecast['FORECAST'].values)[1:]
    valuesP = list(prices['PRC'].values)

    variationP = list(forecast['FORECAST'].values)
    variationP = np.nan_to_num(variationP)
    variation = [-val for val in variationP]
    print(variation)
    minC = min(variation)
    maxC = max(variation)

    print(variation)
    print(forecast)

    ploting_utilities.plots2D([datesP, datesF], [valuesP, valuesF],
                              [None, variation], [False, True], company, minC,
                              maxC)