我有一个太阳辐射时间序列数据2年,它的时间为半小时(每30分钟),并且每天和每年的季节性都没有趋势。所有输入y值均高于0和低于1000。在一天的过程中,从午夜到早晨,值为0,在白天到傍晚,下午的峰值为正值,晚上的值为0。
我非常尝试了简单的模型,在预测中,我看到弹出负值(应该为0)。在此处阅读了先知文档和其他帖子后,我尝试使用将地板设置为0的logistic模型饱和最小选项,并在预测中获得负值(应该为0)。
future = m.make_future_dataframe( periods=48, freq='30min')
future['floor']=0
future['cap']=1000
df_solar['cap']=1000
m = Prophet(growth='logistic', weekly_seasonality=False)
forecast = m.fit(df_solar).predict(future)
那么,最低限度不起作用?如何使用值应为0的负值正确预测的负值?任何帮助,感谢。
I have a Solar radiation time series data for 2 years, It is half hourly(every 30 mins) and it has a daily and yearly seasonality with no trend. All the input y values are above 0 and below 1000. Over the course of the day, from midnight till morning the values are 0 and during the day till evening it has positive values with peak in the afternoon and values are 0 in the night.
I intially tried simple model and in the forecasting I see negative values popping up(that were supposed to be 0). After reading through the prophet documentation and other posts here , I tried saturating minimum option, using logistic model with floor set to 0 and cap to 1000, but still I get negative values in the prediction(that was supposed to be 0).
future = m.make_future_dataframe( periods=48, freq='30min')
future['floor']=0
future['cap']=1000
df_solar['cap']=1000
m = Prophet(growth='logistic', weekly_seasonality=False)
forecast = m.fit(df_solar).predict(future)
So, is the staturating minimum not working ? How can I get to predict correctly with out negative values where the values should be 0 ? Any help, appreciated.
发布评论
评论(1)
我建议绘制模型的组成部分:
使用逻辑增长模型,先知将地板/盖饱和点设置为趋势成分。但是,其他组件(即额外的回归器)可能会将您的预测推向负数。如果您需要在0和1000中进行硬停止,则应考虑审查回归(又称TOBIT回归)。您可以看到一个示例使用pymc 或使用Stan进行估计。
I recommend to plot the components of the model:
With the logistic growth model, Prophet is setting a floor/cap saturation point to the trend component. But it is possible that other components (i.e., the extra regressors) are driving your predictions into a negative number. If you require a hard stop in 0 and 1000, instead you should consider a Censored Regression (a.k.a. Tobit regression). You can see an example using PyMC here or perhaps do the estimation using Stan.