# Enter batch code below # Everything after "#" is ignored by the interpreter # Each line can only hold one function # Example Batch programs can be found in the "Batch programs" folder of the installation directory # During a Batch run, text output is presented on the Text Output page and not on the Batch page ############################################ # Example batch program for Case Study Nile # Load data, specify path LoadData(".\data\NileData.csv") # Specify name of the dependent variable SetYVar("Nile") # Remove all model selections SelectCmp() # Select local level model # Other options are EXP_SMO, HW, SHW, LL, LLT, LL_SEAS, BSM, ARIMA, SD_ARMA, SD_tARMA, SD_GED, # SD_EGB2, SD_EXP, SD_WEIBULL, SD_POISS, SD_NEGBIN, SD_BERN, SD_SKELLAM, XGB, MDL_AVG_MN, MDL_AVG_OLS, # MDL_AVG_OLSc, MDL_AVG_FCVAR SelectModel(LL) # Estimate model: BFGS_NUM, begin sample, end sample (-1 for end sample) EstimateModel(BFGS_NUM, 1, -1) # Clear existing plot ClearPlot() # Draw extracted signal # Specify: # 1) Type of component to plot. For state space models: ST_PRED, ST_FIL, or ST_SMO. # For other models: ST_PRED # 2) Name of component. This name corresponds with the names on the Graphics page. # 3) Line type (Solid, Dashed, Dotted, ...). See plot options on the Graphics page for all line types. # 4) Line color, see plot options on the Graphics page for all line colors. DrawComponent(ST_SMO, "Y data", "Solid", "black") DrawComponent(ST_SMO, "Level", "Solid", "tsl blue") DrawComponent(ST_FIL, "Level", "Solid", "orange") ################### SetYVar("Nile_missing") SelectCmp() SelectModel(EXP_SMO) SelectModel(LL) EstimateModel(BFGS_NUM, 1, -1) ClearPlot("GraphPage") # Select next to last model SetModel("GraphPage", -1) DrawComponent(ST_SMO, "Y data", "Solid", "black") DrawComponent(ST_PRED, "Total signal", "Solid", "tsl blue") # Select last model SetModel("GraphPage", 0) DrawComponent(ST_PRED, "Total signal", "Solid", "orange") ################### ClearPlot("ForecastPage") SetModel("ForecastPage", -1) DrawForecast("Y data in-sample", "Solid", "black") DrawForecast("Y data out-of-sample", "Cirkels 4", "black") DrawForecast("Total signal", "Solid", "tsl blue", ONE_STEP) # Select last model SetModel("ForecastPage", 0) DrawForecast("Total signal", "Solid", "orange", ONE_STEP)