# 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 Business cycle and COVID # Load data, specify path LoadData(".\data\USGDP.csv") # Specify name of the dependent variable SetYVar("LGDP") # Remove all model selections SelectCmp() # Select component level and set to fixed = (True/False) SelectCmp(COM_LVL, True) # Select component slope and set to fixed = (True/False), and order of trend (1-4) SelectCmp(COM_SLO, False, 1) # Select component cycle SelectCmp(COM_CYC) # Select intervention component # Second argument: specify True for automatic and False for manual intervention analysis SetIntervention(True, True) # Specify intervention settings: minimum t-stat, max number of intv, find outliers, find breaks InterventionSettings(5.0, 10, True, True) # Set starting value of cycle period but do not fix the parameter SetParByName("Cycle 1 period", False, 20.0) # Estimate model: BFGS_NUM, begin sample, end sample (-1 for end sample) EstimateModel(BFGS_NUM, 1, 302) ################### # Clear existing plot ClearPlot("GraphPage") # Set confidence bounds # Specify: # 1) Add confidence bounds to plotted lines (True/False) # 2) Width of confidence bound to either direction (number of standard errors). # 3) Confidence region (LINE / AREA). SetConfidenceBounds("GraphPage", True, 2.0, AREA) # 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, "Cycle", "Solid", "black") AddSubPlot() SetConfidenceBounds("GraphPage", False) DrawComponent(ST_SMO, "Y data", "Solid", "black") DrawComponent(ST_SMO, "Level", "Solid", "tsl blue") DrawComponent(ST_SMO, "Trend + Intv", "Solid", "orange") AddSubPlot() DrawComponent(ST_SMO, "Standardized residuals", "Solid", "black")