from forecast import Forecast weather = Forecast() # weather.clean_tmy('../data/golden.csv') weather.load_tmy('../data/golden_clean.csv') weather.add_predictor('Dry-bulb (C)').add_predictor('Dew-point (C)') predictions = weather.auto_regressive(12, 2) print(predictions) weather.persist()
n10 = n10DB[hour] n10.rename('n10', inplace=True) n50 = n50DB[hour] n50.rename('n50', inplace=True) n100 = n100DB[hour] n100.rename('n100', inplace=True) data = pandas.concat([n10, n50, n100], axis=1) p = seaborn.boxplot(data=data) p.set(title='Dry bulb temperature ranges at 15:00 on July 1st', xlabel='Number of scenarios generated', ylabel='Dry Bulb (C)') seaborn.plt.show() """ predictions, test = atlanta.auto_regressive(48, 50, trim_data=False) db = predictions[atlanta.predictor_variables[0]] testAtl = test[atlanta.predictor_variables[0]] predictions, test = golden.auto_regressive(48, 50, trim_data=False) goldenDB = predictions[golden.predictor_variables[0]] testGold = test[golden.predictor_variables[0]] print('...predictions succeeded, now plotting...') f, (ax, ax2) = plot.subplots(2,1) p = seaborn.boxplot(data=goldenDB, ax=ax) p2 = seaborn.boxplot(data=db, ax=ax2) seaborn.tsplot(testGold, ax=ax) seaborn.tsplot(testAtl, ax=ax2) #ax.set_title('GLobal Horizontal Irradiation (W/m^2)') ax.set_title('Dry-Bulb (C) for Golden, CO')
# Create the forecast object (default horizon = 24 hours): weather = Forecast() # set horizon with Forecast(horizon=48) # load weather data: #weather.clean_tmy('../data/houston.csv') # this saves a 'cleaned' tmy file weather.load_tmy('../data/atlanta_clean.csv') # set the simulation time if necessary: weather.simulation_time = '07/01/1900 01:00' # Set up the VAR model by adding variables: weather.add_predictor('Dry-bulb (C)').add_predictor('RHum (%)') # Make a number of predictions and capture the predictions and the test data: predictions, test = weather.auto_regressive(72, 50, trim_data=False) # Extract a variable of interest (index values correspond to the order the variables were added): db = predictions[weather.predictor_variables[0]] rh = predictions[weather.predictor_variables[1]] # ...and the test data: dbtest = test[weather.predictor_variables[0]] rhtest = test[weather.predictor_variables[1]] # use seaborn to make a pretty plot: f, (ax, ax2) = plot.subplots(2, 1) pretty = seaborn.boxplot(data=db, ax=ax) seaborn.tsplot(dbtest, ax=ax) pretty2 = seaborn.boxplot(data=rh, ax=ax2)