price = df.squeeze() #print(price.head()) #print(price.index) Target = Stocker(price, name=sid) #Target.changepoint_prior_validation(start_date ='2015-12-03',end_date ='2018-12-21',changepoint_priors = [0.3,0.4,0.45,0.5,0.6]) #Target.plot_stock() #原始參數預測 #model, model_data = Target.create_prophet_model(days=10) #原始參數回測 #Target.evaluate_prediction() #Target.changepoint_prior_analysis(changepoint_priors=[0.001, 0.05, 0.1, 0.2]) #Target.changepoint_prior_validation(start_date='2015-01-07', end_date='2018-12-21', changepoint_priors=[0.05,0.1,0.2,0.3,0.4]) #調整參數為0.4 Target.changepoint_prior_scale = 0.1 #Target.changepoint_prior_scale = 0.6 #修改後回測 Target.evaluate_prediction() #修改後參數預測 Target.predict_future(days=30) Target.predict_future(days=90) model, model_data = Target.create_prophet_model(days=60) #Target.evaluate_prediction(start_date='2017-12-15', end_date='2018-12-17', nshares=1000)
model, model_data = amazon.create_prophet_model(days=90) amazon.evaluate_prediction() amazon.changepoint_prior_analysis(changepoint_priors=[0.001, 0.05, 0.1, 0.2]) amazon.changepoint_prior_validation(start_date='2016-01-04', end_date='2017-01-03', changepoint_priors=[0.001, 0.05, 0.1, 0.2]) amazon.changepoint_prior_validation( start_date='2016-01-04', end_date='2017-01-03', changepoint_priors=[0.15, 0.2, 0.25, 0.4, 0.5, 0.6]) amazon.changepoint_prior_scale = 0.5 amazon.evaluate_prediction() amazon.weekly_seasonality = True amazon.evaluate_prediction() amazon.changepoint_prior_scale = 0.5 amazon.weekly_seasonality = True amazon.evaluate_prediction(nshares=1000) amazon.evaluate_prediction(start_date='2008-01-03', end_date='2009-01-05', nshares=1000)