Created
March 4, 2019 23:46
-
-
Save davmre/6cabbe7ff9162b9bd79a37866fd5a5ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
temperature_effect = tfp.sts.LinearRegression( | |
design_matrix=tf.reshape(temperature - np.mean(temperature), | |
(-1, 1)), name='temperature_effect') | |
hour_of_day_effect = tfp.sts.Seasonal( | |
num_seasons=24, | |
observed_time_series=demand, | |
name='hour_of_day_effect') | |
day_of_week_effect = tfp.sts.Seasonal( | |
num_seasons=7, | |
num_steps_per_season=24, | |
observed_time_series=demand, | |
name='day_of_week_effect') | |
residual_level = tfp.sts.Autoregressive( | |
order=1, | |
observed_time_series=demand, name='residual') | |
model = tfp.sts.Sum([temperature_effect, | |
hour_of_day_effect, | |
day_of_week_effect, | |
residual_level], | |
observed_time_series=demand) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment