示例#1
0
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()
示例#2
0
from forecast import Forecast
import matplotlib.pyplot as plot
import seaborn
import pandas
import numpy

atlanta = Forecast()

#weather.clean_tmy('../data/lafayette.CSV')
atlanta.load_tmy('../data/atlanta_clean.csv')
atlanta.simulation_time = '07/01/1900 08:00'

#weather.add_predictor('GHI (W/m^2)').add_predictor('DNI (W/m^2)')
atlanta.add_predictor('Dry-bulb (C)').add_predictor('Dew-point (C)')

# now let's look at colorado:
golden = Forecast()
golden.load_tmy('../data/golden_clean.csv')
golden.simulation_time = '07/01/1900 08:00'

#weather.add_predictor('GHI (W/m^2)').add_predictor('DNI (W/m^2)')
golden.add_predictor('Dry-bulb (C)').add_predictor('Dew-point (C)')

"""
# Grab predictions for 10, 50 and 100 scenarios:
predictions, test = weather.auto_regressive(24, 10)
print('...predictions succeeded, now plotting...')

stuff = test[weather.predictor_variables[0]].T
junk = test[weather.predictor_variables[1]].T
示例#3
0
import seaborn
import pandas
import numpy

# 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)