the duali/dualpc software for optimal control models… · the duali/dualpc software for optimal...

260
The Duali/Dualpc Software for Optimal Control Models: User's Guide Hans M. Amman and David A. Kendrick Center for Applied Research in Economics The University of Texas TP 92-03 September 1992 revised December 1999

Upload: vokhanh

Post on 13-Sep-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The Duali/Dualpc Software for

Optimal Control Models: User's Guide

Hans M. Amman and

David A. Kendrick

Center for Applied Research in Economics The University of Texas

TP 92-03

September 1992 revised December 1999

Page 2: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Preface This is a user's guide for the Duali/Dualpc software for quadratic-linear optimal control models. Duali (which is pronounced “dual I”) provides a graphical interface for deterministic, passive and active learning stochastic models as well as solvers for deterministic models and for passive learning stochastic models. It does not yet contain a solver for adaptive control models. However it does provide a procedure to export a file, which can be used to solve adaptive control models with the Dual or Dualpc software packages. Duali/Dualpc runs under Windows 95 or later and Windows NT 4.0 or later on personal computers. Duali is written is the C language. Dualpc is written in Fortran using Microsoft PowerStation. Duali has been developed and compiled using Microsoft Visual Studio 6.0, which contains Microsoft Visual C++ Ver. 6.0. This guide is for Version 0.321 of Duali and version xx of Dualpc. We would like to thank Jose Enrique Garcilazo, Haibo Huang and Li Zhu for comments on earlier drafts of this Guide.

Page 3: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Contents 1. Introduction

Part I Deterministic Models 2. Experiments with Existing Models 3. Transformations 4. Creating a New Model

Part II Stochastic Models: Introduction 5. Open Loop Feedback without Updating

Part III Stochastic Models: Comparison of Methods 6. Stochastic Control: Overview 7. Handcrafted Feedback Rules 8. Certainty Equivalence 9. Open Loop Feedback 10. Open Loop Feedback with Insight - Policy to Parameter Effects 11. Monte Carlo Runs 12. Active Learning with Dualpc

Part IV The Rest 13. Common Problems 14. The Model Library

Appendices A Default Setting for Some Elements for the OLF Models with Monte Carlo and the Kalman Filter B Duali Source Code Files C Model Library Files D Importing Data from Other Applications References

1

Page 4: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 1 Introduction

The Duali/Dualpc software system is designed to solve deterministic and stochastic optimal control models of economic systems. The Duali part of this duo has a graphical user interface to facilitate use by upper level undergraduates and first and second year graduate students. Thus it provides software, which is useful for teaching about dynamic deterministic and stochastic economic models. It is also a useful research tool for work with deterministic and passive learning stochastic models. In contrast, Dualpc is primarily a research tool for deterministic as well as both passive and active learning stochastic control models. Models developed in Duali and solved first as deterministic and then as passive learning stochastic models can be exported in the proper format for solution as either passive or active learning stochastic control models in the Dualpc software. The Duali software is written in the C language and runs in Windows 95 or later and Windows NT 4.0 or later. Dualpc is written in Fortran and runs on PC’s under either DOS or Windows. This user’s guide focuses primarily on the Duali software and provides a pathway for the user to progress from deterministic models in Part I to passive learning and active learning stochastic control models in Parts II and III. The remaining components of the user’s guide including chapters on common errors and on the model library are grouped in Part IV. In our experience working with examples of existing models is one of the best ways to learn a new software system. Therefore Duali comes with a variety of example economic models and the User’s Guide begins with an introduction in Chapter 2 showing how one of these models is represented in the software. After seeing how a small and simple model in structured in Duali, the user is encouraged to make use of the example models in order to understand how models of substantial complexity are represented in the software and how experiments with these models can be conducted by changing desired paths, weights and coefficients. Computer models can become complex very quickly and one way to control this complexity is to begin with a simple models and slowly but surely transform the simple

2

Page 5: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

model into a complex model. This approach is facilitated in Duali by the library of example models and by procedures in the software to transform models. For example, one can begin with a deterministic model that has a single state variable and a single control variable and add states, controls and sources of uncertainty while continuing to solve the model at each step. This process helps to ensure that the user’s understanding advances along with the increase in complexity of the model. In this spirit, Chapter 3 provides a description of the transformations, which are available in Duali. Many modeling projects lend themselves well to the approach discussed above of taking a simple model and slowly but surely transforming it step by step into a large and/or complex model. However, it is sometimes desirable to start with a clean slate. Chapter 4 provides guidelines for this approach when the user wishes to create an entirely new model. Uncertainty is introduced in Part II with a focus on uncertainty in parameter estimates. While the most common form of uncertainty in economic models is additive noise terms, one of the most interesting forms of uncertainty stems from treating the model parameters as uncertain rather than as deterministic. For this introduction to stochastic models in Chapter 5 we keep the discussion simple by not using the Kalman filter to update the parameter estimates. Thus in this chapter parameters are treated as uncertain but the estimates of the means and variances of these parameters are not updates from one time period to the next. Part III provides a full discussion of stochastic control including the use of the Kalman filter to update parameters estimates. The first chapter in the this part (Chapter 6) provides an overview of the various types of stochastic control by classifying models by the sources of uncertainty and by the methods which are used to solve the models. Four sources of uncertainty are considered: (1) additive noise terms in the system equations, (2) uncertain parameters which create a source of multiplicative uncertainty, (3) measurement error in the observation equations and (4) uncertainty about initial state variables and parameter estimates. Five methods for dealing with the uncertainty are discussed. They are as follows:

3

Page 6: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

a. Handcrafted Feedback Rules – Chapter 7 b. Certainty Equivalence (without and with updating) – Chapter 8 c. Open Loop Feedback – Chapter 9 d. Open Loop Feedback with Insight – Chapter 10

Then Monte Carlo procedures are introduced in Chapter 11 as a vehicle for comparing these methods to one another. If the user wants to solve stochastic control models with adaptive procedures it is necessary to export the model from Duali and use the Dualpc software. Chapter 12 discusses the export procedures and provides a brief introduction to the Dualpc software. The Dualpc software can be used either in conjunction with Duali or in a stand-alone capacity. The user’s guide for Dualpc is Amman and Kendrick (1992a). If Dualpc is used with Duali the user can exploit the visual interface to enter the matrix data and/or to make changes in parameters or in penalty function weights. Duali can then be used to write an ASCII input file for Dualpc. Following this the problem can be solved by using the Dualpc software. The last two chapters in this User’s Guide provide additional materials, which may be of use to user’s doing both deterministic and stochastic models. Chapter 13 includes a discussion of common problems of past users in hopes that this experience may be useful to current users. Chapter 14 provides a description of the models in the model library. This is supplemented by the Data: Description window, which can be accessed in Duali for each model. A caution about the use of Duali is important and can be illustrated by a comparison to econometric software. There are now available a substantial number of competing commercial econometric packages. Most of these programs have been in long and widespread use. The same models have been estimated with different software packages to assure that the estimations results are accurate. There is even a rapidly growing literature about the comparative numerical accuracy of the different packages. In contrast, there is a relatively limited set of software packages that will solve stochastic control models, so solution of the same model with a number of different packages is not easy. This means that it is difficult to be sure that solutions are accurate. As time passes and a variety of stochastic control packages become available this kind of checking will

4

Page 7: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

become widespread and the user can have greater assurance that the solutions to such models are correct. We have used other software packages to check our results on a number of models in the Duali Model Library. For deterministic models this is relatively easy to do but for stochastic models it is more difficult. So the caution to the user is to be sure to solve your model not only with Duali but also with some other software packages whenever it is possible to do so. When this is not possible and hand calculations of some solutions are possible it is wise to do that. If you find some incorrect results which you think are due to errors in the Duali code please get in touch with us. What’s New in Duali Version 0.316 thru 0.321? Users who are familiar with Duali from previous versions will find some new capabilities in this version. 1. Transformations have been added. It is now possible to transform a model from deterministic to stochastic within Duali without having to export, modify and import it. Also, one can change most of the model structure options using the transformations. For example, one can change from constant to time-varying penalty matrices or vice versa. The same applies to desired paths and exogenous variables. In addition, one can increase or decrease the size of the model by changing the number of states variables, control variables, time periods, etc. 2. Forward variable solution methods for rational expectations models have been added. These methods use the Fair-Taylor procedure. They support forward variables in both deterministic and stochastic models. However, one should exercise great care in the use of this capability, as we do not yet have substantial experience yet with these methods in Duali and have not been able yet to check the results against other codes. So for the meantime we would suggest that if you use this capability, you would be well-advised, if possible, to also solve the model with another software system so that you can cross-check the results. 3. Cut, Copy and Paste capabilities have been added to the matrix windows.

5

Page 8: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

4. A property sheet has been used to replace the dialog box for debug printing under the commands “Solve: OLF (w/o update) Print” and “Solve: Compare Print”. The added space has permitted the inclusion of additional print control capabilities. For example, it is now possible to print selected matrices for a chosen Monte Carlo run. For example, if you have done twenty Monte Carlo runs and discover from the print of the criterion values that run #14 is an outlier, then you can repeat the Monte Carlo experiment and request substantial printout of results for only that Monte Carlo run. Thus you can examine in detail what is causing the results for that run to be so different. 5. The Write:QLP to Disk and Write:DUAL to Disk menu commands have been renamed and moved to the File menu so that they are now File:Export QLP and File:Export DUAL 6. A considerable number of new example files have been added to the model library. 7. A plotting capability has been added so that rough plots can be done directly in Duali for visual display on the monitor. Plots can be made for a single solution not only of states and controls but also of parameter estimates. In addition the user can perform a series of solution in which some parameter or specification of the model is altered and a scenario name can be assigned to each of these solutions. Then the scenarios can be plotted against one another in order to analyze the effects of parameter or specification changes on the solution to the model. 8. The Data menu has been altered and a Specification menu has been added. Also, the Solve menu has been modified. All of these changes are a part of an effort to provide a clear framework for deterministic and stochastic model specifications. 9. Handcrafted feedback rules have been added. Some users have wanted to use feedback rules, which were not optimal but rather handcrafted. So the capability to input the necessary matrices and solve models with these feedback rules has been provided. 10. Procedures have been added to permit the calculation of the variance of the states and controls over time within a single Monte Carlo run and then to get the average of these variances across Monte Carlo runs.

6

Page 9: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

11. It is now possible to import data matrices one a time. For example, the user may have generated a large variance-covariance matrix for the parameters in an estimation package and wish to import that into Duali. This can be done using the File: Import Matrices option. The submenu's then allow the user to specify the matrix, which is to be imported, and a debug file option is provided to help the user insure that the data is imported without error. 12. A capability has been added to alter a single element of the covariance of the unknown parameters in a future time period. This facilitates experiments, which analyze the effects of increases in the uncertainty of a future parameter value on the optimal control variables in the first time period. This is accessed via the Preferences menu with the "Caution Experiment" option. 13. A "Clear" option has been added. However, this is not yet fully debugged and should be used with caution. 14. The software for displaying tables of results for the states and controls has been modified substantially to include the capability to provide tables of parameter estimates. Also a new dialog box has been introduced to facilitate control of the displays of tables of states and control variables and parameter estimates. 15. A new capability has been introduced to enable users to analyze the effects of policy changes on the parameters of the model, i.e. the “Lucas” effect. 16. Two new methods for solving stochastic control models have been added in order to enrich the comparison of solution methods. The first of these is like certainty equivalence but without updating of parameter estimates with the Kalman filter – thus this method is called “Certainty Equivalence without Updating”, i.e. CEWO. The second is like open loop feedback but also models a situation in which the policy maker has insight about the effect of policy changes on movements in model parameters. This method is used in conjunction with the policy-to-parameter or “Lucas” effect discussed above. This method is call “Open Loop Feedback with Insight”, i.e. OLIN.

7

Page 10: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Part I

Deterministic Models

8

Page 11: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 2 Experiments with Existing Models

1. Getting Started

In Windows click on the Duali icon and the main window for Duali will appear.

Fig

Figure 2-1 The Duali Main Window On the Help menu click “About Duali” and the dialog box shown below will appear.

Figure 2-2 The Duali “About” Dialog Box

Click on the OK and the About Duali dialog box will close.

9

Page 12: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Two routes are available to the user to open the example file that is used in this chapter. One route is through the Examples option on the File menu and the other is through the Open option on the same menu. The Examples approach has the virtue that it will introduce the user to the examples that are available with the Duali software. The Open approach has the advantage that it is the procedure with which any Duali model can be opened rather than only those that belong to the set of examples. If you want to use the Open approach skip over the next paragraph or so until you get to the appropriate description. If you want to use the Example approach that is recommended for new users continue to the following paragraph. Select Examples from the File menu. A secondary menu will appear offering the user a choice between examples organized by author, country, functional forms, stochastic terms or subject. For now select the By Author item. A tertiary menu will appear offering you a choice of models developed by a number of individuals. For example there are models by Abel, Fair, Klein, Hall, MacRae, Pindyck, Taylor, Sargent, Wallace, and others. At a later stage you may want to return and look at the Fair or Pindyck models that are large deterministic models, one of the MacRae model which are small stochastic models, or the Taylor or Sargent and Wallace models which have rational expectations. However, for now click on the Abel and then on Two Controls and then on Deterministic as illustrated in Figure 2-3.

10

Page 13: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-3 The File: Examples Menu

When you do so a message box will appear informing you that the abelQLP model has been loaded as is shown below. (If this box does not appear, but rather a message appears informing you that the model cannot be found, then select File: Open and navigate to the directory which contains the example files – i.e. the *.dui files. Without selecting a file to open, close the “Open” dialog box by clicking on the x in the upper right hand corner. Then repeat the “File: Example: By Author: Abel: Two Controls: Deterministic” menu selection and the message box below should appear.)

11

Page 14: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The name “abelQLP” is used because this is a version of the Abel model set up to be solved as a deterministic quadratic linear problem (QLP). Click the OK on this box and then the Description window for this model will appear. This window contains a description of the source, size and specification of the model. Click on Cancel and the Description window will disappear and the underlying main window for Duali will appear. This window is disarmingly blank. However, all the specifications and data for the model can be accessed through the menus. Now you are ready to examine the data and can skip over the File:Open discussion below and go directly to Section 2 “The Model Name Dialog Box”. If you want to use the File:Open approach to load the example for this chapter select the Open option from the File menu. The File Open dialog box will appear so that you can navigate to the directory of interest and select the file to open. For the sake of this example go to the directory that contains the Duali software and open the file abelQLP.dui which is the two control variable, deterministic, quadratic linear problem (QLP) version of the Abel (1975) model. This model is small so the loading will be done quickly; however, for large models there may be a slight delay while the model is read into memory. This model loads so quickly that it appears that nothing has happened; however progress to the Model Name dialog box as discussed below to confirm that the model loaded as it should have.

12

Page 15: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

2. The Model Name Dialog Box Begin the use of Duali by pulling down the Specification menu and selecting the Name option. The Model Name dialog box will appear as is shown in Figure 2-4.

Figure 2-4 The Model Name Dialog Box

To change the name of the model, bring the cursor into the name box. The cursor will change shape from an arrow to a line. Click on the mouse and drag this line through the characters you want to change. The selected characters will invert in color, i.e. change from black to white. Then type in the new characters. Also, be careful not to strike a carriage return after you type the new characters. This will cause the dialog box to disappear with no changes being made in the model name. If you do this by mistake then pull down the Specification menu again and click Name. You can also change the acronym of the model in a similar manner. The acronym is not currently used in Duali but might be used in later version with the GAMS system. Once you have completed the changes click on the OK button. However, if you do not want the changes you have made in the dialog box to be made to the internal database, you have the option of clicking on the Cancel button. For now click on the OK button. The dialog box will disappear and the main window will regain the focus, i.e. its caption bar will be colored.

13

Page 16: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

3. The Description Dialog Box Next select the Description item on the Specification menu. The dialog box shown below will appear.

Figure 2-5 The Description Dialog Box

The purpose of this dialog box is to permit users to provide a short description of their models along with references to the appropriate publications. Also, this dialog box may be useful when one is developing a series of variants of a model. Usually the number of characters in the Name dialog box is not sufficient to describe the differences between the variants and the Description dialog box provides more space.

14

Page 17: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

4. The Stochastic Terms Dialog Box

Next select the Stochastic Terms item on the Specification menu. The dialog box shown below will appear.

Figure 2-6 The Stochastic Terms Dialog Box

There are four different levels for specification of stochastic terms for models in Duali. The least complex is the deterministic models which are discussed in this chapter. Then there are three levels associated with stochastic models. These three are discussed in later chapters of this guide.

5. The Functional Forms Dialog Box While at first it would seem that all quadratic-linear control models have the same functional forms there are a number of variants in use. For example, some use quadratic tracking objective functions in which the deviations between the actual and desired paths of state and of control variables are multiplied by penalty matrices. Other models use a quadratic form for the criterion function. The systems equations in some models are specified as a reduced form while others contain current values of the state variables on both the right and left sides of the equality sign. The existence of these and a number of other specifications increases the possibility of error when economic models are input.

15

Page 18: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Duali attempts to ease this problem by using a functional forms dialog box to specify the form of the model. Once the options are selected in this dialog box the user is prompted to input only those components of the model that are necessary for the particular variant chosen. Thus the user who wants a tracking model is asked to enter the desired paths for state and control variables while the user who wants to use a simple quadratic form is not bothered with this request. Therefore, simple models are relatively easy to input in Duali, but that ease is purchased by specifying the functional forms in this dialog box. Pull down the Specification menu and click Functional Forms. The following dialog box will appear.

Figure 2-7 Functional Forms Dialog Box

This dialog box is principally used when creating a new model as is discussed in Chapter 4; however, one can also use this dialog box with an existing model to alter the specification. For now, do not change the settings in this dialog box. Rather use the following discussion to see the options that are available to the user in creating a new

16

Page 19: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

model or transforming an existing model either by changing the settings in this dialog box or by using options from the Transformations menu. The functional form options are an important part of Duali since they shield the user from some of the complexity while allowing substantial versatility in the software. However, on first reading this guide the user may want to skip lightly over this section. For an existing model the options will already be set and the user will have no need to alter them. In the future, as you use various types of models it will be useful to review the settings in this dialog box to see how they change as the structure of the model changes. Then, when you begin at a latter stage to develop your own models, you can read the portions of the material in this section that are relevant to your interest. However, on first reading, pass quickly through the functional forms specification material below until you come to the section on the size dialog box. The functional forms dialog box above in Fig. 2-7 is divided into two major sections. The options on the left hand side are all concerned with the specification of the criterion function and those on the right with the specification of the system equations. We will discuss first the criterion function and then the system equations. a. Criterion Function The options in the “Form” group in the upper left-hand corner of the dialog box determine the specification of the criterion function. The quadratic tracking criterion contains desired paths for both state and control variables while the quadratic form does not explicitly contain these terms but does contain linear as well as quadratic terms and a cross term for states and controls. The quadratic tracking criterion is written

( ) ( )J x x W x xN N N N N= − ′ −12

~ ~

( ) ( ) ( ) (+ − ′ − + − ′ −⎧⎨⎩

⎫⎬⎭=

∑12 0

1

x x W x x u u u uk k k k k k k k k kk

N ~ ~ ~ Λ )~ (2-1)

17

Page 20: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

and the quadratic form is written

J x W x w xN N N N n= ′ + ′12

+ ′ + ′ + ′ + ′ + ′⎧⎨⎩

⎫⎬⎭=

∑ 12

120

1

x W x w x x F u u u uk k k k k k k k k k k k kk

N

Λ λ (2-2)

where = state vector - an n vector xk

~xk = desired state vector - an n vector = control vector - an m vector uk

~uk = desired control vector - an m vector = symmetric state variable penalty matrix at terminal period, N WN

= symmetric state variable penalty matrix for period k, (k = 0 thru N-1) Wk

= linear state coefficient vector for period N wN

w = linear state coefficient vector for period k (k = 0 thru N-1) k

Λ = symmetric control variable penalty matrix for period k, (k = 0 thru N-1) k

λ k = linear control coefficient vector for period k, (k = 0 thru N-1) = coefficient matrix for the x-u cross terms (the ability to input the matrix has Fk Fk

not yet been implemented as of 9/16/95) The default specification is quadratic tracking and that is also the specification of the Abel model. b. Time Varying Variables Elements in the Criterion Function The four boxes grouped below the "Time Varying Elements" label on the left side of the dialog box determine whether the elements of the criterion function are constant or time varying. Also there is a special option for the W matrix in which one can specify that the coefficients have one set of values in all time periods except for the final time period when they may have different values.

18

Page 21: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

c. System Equations The boxes on the right hand side of the dialog box are used to set the specifications for the system equations. System equations in the regular form have the state variables for time period k+1 on the left side of the equality and the state variable for time period k on the right side. In contrast, systems equations in the "I-A" or Pindyck form have state variables for period k+1 on both the left and the right side of the equality. Thus the regular or I form is written as x Ax Bu c k Nk k k k+ = + + = −1 0 1,..., (2-3)

where A = state vector coefficient matrix (n x n) B = control vector coefficient matrix (n x m) c = exogenous vector for period k (n x 1) k

A slightly different version of the usual system equations (2-3) is used in Duali. The modification is made to accommodate exogenous variables. This is done by replacing the exogenous vector c with a coefficient matrix C and a vector of exogenous

variables. Thus the system equations become k zk

x Ax Bu Cz k Nk k k k+ = + + = −1 0 1, , (2-4)

The typical structure of the C matrix is a first column that contains the constant terms from the system equations with the remainder of the matrix containing coefficients that multiply exogenous variables in the systems equations. Consistent with this structure the

vector usually has a one in the first position followed by a column of the exogenous

variables. Moreover, these exogenous variables are time varying in most cases so the vector z is time varying.

zk

k

The Pindyck or I-A form of the system equations used by Pindyck (1973) is more like a structural than a reduced form. It is written

x A x A x B u C z k Nk k k k k+ = + + + = −1 0 1 1 1 1 0+ , , 1 (2-5)

19

Page 22: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

These equations can be converted to the form (2-4) by inverting the I A− 0 matrix to

obtain

( )A I A A= − −0

11

B (2-6) = I − A0( )−1B1

C = I − A0( )−1C1

Thus the name "I-A" for the Pindyck form of the system equations. d. Forward Variables The rational expectations models make use of forward-looking variables. This specification can be accommodated to a substantial extent in Duali. Systems equation in the regular or I form with forward looking variables are written as

xk +1 = Axk + Buk +Czk + D1xk+1|ke + D2 xk+ 2|k

e (2-7)

where

= the expected value of the state variable at period xk +1|ke

as projected from period k . k +1

D1 = forward looking variable parameter matrix for the k +1|k variables

D2 = forward looking variables parameter matrix for the k + 2|k variables In this example, the maximum lead for the forward variables is two periods. The maximum lead must be entered in the Size dialog box, which is discussed below. If one is solving a deterministic QLP model with Duali, the maximum lead can be set at any value between one and three. If one is solving stochastic control models using the Dual code which runs on workstations and mainframes, the maximum lead must be set at two. System equations in the Pindyck or I-A form with forward variables are written xt = A0xt + A1xt−1 + B1ut−1 + C1zt−1 + ˆ D 1xt |t−1

e + ˆ D 2xt+1|t−1e

(2-8) There are no forward-looking variables in the Abel model so the specification in Figure

20

Page 23: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

2-7 is the default value for the Forward Variables box, which is “No”. Next consider in the bottom right-hand corner of the dialog box two specifications that result in time varying elements in the system equations. e. Policy to Parameter Effects Robert Lucas of the University of Chicago has argued in Lucas (1976) that changes in policies may cause changes in the actions of economics agents which would be reflected as changes in the behavioral parameters of econometric models. This provides one of the bases for his critique of the use of optimal control methods for determining macroeconomic policies. In a recent paper Amman and Kendrick (1999) have argued that this critique can be mitigated through the use of the Kalman filter to update the parameter estimate of the model each time period. In order to facilitate experiments of this type Duali now includes a policy-to-parameter relationship in which changes in the control variables cause changes in the parameters of the system equations. This specification can be turned on here in the Functional Forms dialog box. A full discussion of the mathematics of this specification is provided in Chapter 10 on the Open Loop Feedback with Insight method for solving stochastic control models. f. Time Varying Exogenous Variables Since the most common specification for the exogenous variables is only the single variable that is used to multiply the constant terms in the equations the default specification for this option is "constant". In contrast, the time-varying specification would be used when there are truly exogenous variables in the model which are time varying. The asterisk by one item in each group box notes the settings which are required if one is solving stochastic control problems using the Dualpc code. That code does not have as flexible an input structure as Duali so the Dualpc options must be fixed as indicated by the asterisks if one intends to export a file for use with Dualpc. In most of this User’s Guide we will be concerned only with Duali and therefore need not follow these restrictions.

21

Page 24: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The remaining two items on the Specification menu namely "Source of Random Terms" and "Options: Monte Carlo" apply only to stochastic models and will be discussed later.

6. The Size Dialog Box The size of the model can be seen by selecting the Data menu and clicking Size. The dialog box that is shown in Figure 2-8 will appear.

Figure 2-8 Size Dialog Box The example we are using here is a small macroeconomic model that has two state variables and two control variables. The states are consumption and investment and the control variables are government expenditure and the money supply.

22

Page 25: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

In control theory a distinction is made between two groups of exogenous variables - the policy variables and the "truly" exogenous variables. In this version of the Abel model there are two policy variables, government expenditure and the money supply, and no truly exogenous variables. However, Duali uses one exogenous variable to multiply the constant terms in the system equations, so a one is entered in this box in Figure 2-8. Thus the rule to use is to add one to the number of truly exogenous variables and give that specification in the Exogenous Variable box. Another convention that is used in much of the control theory literature is that the initial period of the model is labeled period zero and the final period is labeled period N. Therefore the size dialog box contains places to enter the number of both the initial period and the terminal period. In this example the model includes eight time periods which are numbered 0, 1, 2, ... 7. One need not use zero for the initial period; however it is necessary to use integers for the initial and terminal periods in this dialog box rather than quarterly or monthly time period labels like 84IV or June88. There is provision in the Acronyms Dialog Box that is discussed below for giving labels like 84IV or June88 to the time periods. The section immediately below the label “Add for Forward Variables ...” need not be used unless the model contains forward variables, i.e. systems equations in which the state variable on the left hand side, viz. x(t+1), is a function not only of lagged variables but also of expected future state variables such as x(t+2) and x(t+3). When this is the case one should enter here the maximum forward lead. Thus if only x(t+2) is used one should enter the number 1, but if one of the system equation contains a variable of the form x(t+3), then the number 2 should be entered. Also, if there are forward variables one should enter a limit on the number of iterations that are used in the iterative procedure for solving models with forward variables. In addition enter a convergence tolerance, say something like 0.01 that will be discussed in detail later in this chapter in the section “Models with Forward Variables”. Then if convergence is not obtained before the limit is reached, the code will stop the iterations at the specified iteration limit and report the results. If you are solving a model without forward variables ignore this edit box. The edit boxes below the line "Add for OLF - - - " can be ignored when one is doing experiments with deterministic control models. This section will be discussed later in

23

Page 26: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

connection with stochastic control. For now click the OK at the bottom of the Size dialog box and the focus will return to the Duali main window.

7. Save Your Work This code is in the early stages of development, so it is advisable to save your work often. Since you would probably prefer not to overwrite the example models which are provided with the Duali/Dualpc software be careful to use the “Save As” command rather than the “Save” command the first time you save the file, if you began from one of the example files as is done in this chapter. Thus the procedure is to pull down the File menu in the main window and clicking Save As. Use the dialog box to maneuver to the desired directory and the file name box to assign a name to your file. Duali makes use of the extension “dui” for the model input files so using this will aid you in opening the file later; however, this is not essential. If you are using Windows 95, Windows 98 or Windows NT Ver. 4.0 or later you should not type a file extension since the system will automatically add the extension that is shown in the “Save as type” window. So if you type ch04 the system will add ".dui" and the file will have the name ch04.dui. If you forget and type the extension like “ch04.dui” then the extension will still be added by the system. You will then have a file by the name "ch04.dui.dui" which you might have difficulty locating at a future date. If you are using Windows NT 3.51 or earlier the system does not add the file extension and you must type it in yourself. If you have trouble saving your model, check to be sure that you are not trying to save it in a directory that has been set to “read-only” under the Windows NT file systems security.

24

Page 27: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

8. The Acronym Window Next close the Size dialog box if you have not already done so, pull down the Data menu and select the Acronyms option. The window in Fig. 2-9 will appear.

Figure 2-9 The Acronym Window The acronyms are short (9 characters or less) descriptors of the variables that are used to facilitate input of the parameters of the model and displays of the results. The variables names are longer descriptions that include more detailed information about the variable and are used in the plots. In our experience some users neglect to fill in the acronyms and names; however doing so reduces errors and also make the model easier to understand by both the developer and by others. This window can be scrolled down to reveal acronym and name edit boxes for the exogenous variables and time periods.

25

Page 28: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

For now click the OK box at the top of the window.

9. The System Equations The next portion of the model is the parameter matrices for the system equations. To modify them pull down the Data menu and click System Equations. Then the System Equation dialog box will appear as shown below.

Figure 2-10 System Equations Dialog Box This dialog box will include different matrices depending on the functional form options that have been selected for the model. For example, if the systems equations include forward looking variables, the D1 and D2 matrices will also appear here. Or, if the system equations for the model are in the Pindyck form, the A0 and A1 matrices will appear instead of the A matrix and the B1 and C1 matrices will appear instead of the B and C matrices. For now click on the "A" radio button and the A Matrix window will appear as shown below.

26

Page 29: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-11 The “A” Matrix Window

As you move the cursor across this window it will change from an arrow to an I-beam. It is an I-beam when it is over one of the edit windows for the acronyms or the parameters. You can alter a parameter by dragging through it so that the color is inverted and then typing the text that is to replace the data in the colored area. Also, the Edit menu includes options for Cut, Copy and Paste that can be used to alter the data in the matrix. In addition the short cut keys for these editing commands are enabled, i.e. Cntrl-X for cut, Cntrl-C for copy and Cntrl-V for paste. When you are through making the changes click on the OK button to update the internal database. Or if you have made changes but do not want those changes to be recorded in the internal database, click on the Cancel button to leave the window. For now, do not alter the data; rather click on the Cancel button to close the window. When you click on either the OK box or the Cancel box a small window of the form shown below will appear.

Figure 2-12 OKMsg Box

27

Page 30: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Click on OK and proceed. Be careful not to ignore this little dialog box. It is possible to do so and continue without clicking OK. However, this can cause problems later, so be sure each time it appears to click the OK. This will return you to the System Equations Dialog box in Figure 2-10 and you can then elect to edit the other matrices and vectors in the system equations.

When you have finished editing the parameters and variables of the systems equations click on the OK box in the System Equations dialog box and you will return to the main window. It would probably be advisable to save your work again at this point by selecting the File menu and clicking on Save (assuming that you saved the model with “Save As” above and gave it a name other than the example file name).

10. The Criterion Function Once again pull down the Data menu and this time click Criterion Function. The Criterion Function dialog box will appear as shown below.

Figure 2-13 Criterion Function Dialog Box Of course the matrices listed in this dialog box will differ if the specification of the model differs. For example the WN matrix will not appear if the W matrix is treated as time varying rather than different only in the terminal period.

28

Page 31: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Modification of the parameters of the criterion function works in the same way as changes to the parameters of the systems equations. However, only the diagonal elements of the W, WN and LAMBDA matrices are shown in their respective data entry dialog boxes. The diagonal elements of the W matrix are the priorities (or penalty weights) assigned to each state variable in all periods except the terminal period. The diagonal elements of the WN matrix are the priorities (or penalty weights) assigned to each state variable in the terminal period. Similarly, the diagonal elements of the LAMBDA matrix are the priorities for the control variables. When these elements are entered the entire matrix is not input but rather only a column that becomes the diagonal elements. Thus for a static W a single column is entered but when W is time varying each column of the WS matrix contains the diagonal elements for the W matrix in a single time period. A similar procedure is followed with the priorities for the control variables in the LAMBDAS matrix. The desired paths for the state and control variables in the quadratic tracking problems are stored in the XDES and UDES matrices, respectively. Thus each column of the XDES matrix contains the desired values for the state variables in a given time period. Desired values for the states are entered from period 0 thru period N, i.e. for N+1 time periods. Typically the desired values in period zero are also the actual values in that initial period. Desired values for the control variables are entered for periods 0 thru N-1, i.e. for N periods. However, if you have used acronyms other than these integers for the time periods the column labels of the XDES and UDES matrices will reflect this.

11. Solving the QLP (Deterministic) Model On the Solve menu click either QLP or QLP: Print. The QLP option is simpler since it provides output only to the display, but the QLP: Print option might be preferred since it provides output to both the display and a disk file. The disk file can in turn be placed in an editor and printed or cut and pasted to a spreadsheet and then plotted. Also, the QLP: Print option is useful when you are first solving your model and want to print intermediate results such as the Riccati matrices or the feedback gain matrices to check against hand calculations or results obtained from some other code.

29

Page 32: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

If you choose the QLP: Print option a dialog box will appear telling you that the next dialog box will request the name of the debug filename to use. Duali employs the convention of using the extension *.dbg for the print or debug filename, but you may prefer some other. So for the example at hand, you might use the file name ch04.dbg. If you are using Windows NT 3.51 you should supply the file name and the extension just as discussed above; however, if you are using Windows 95, Windows 98 or Windows NT 4.0 or later be careful to provide only the file name and not the extension. Thus in the “File name” window you would type ch04 and the system will then add the extension shown in the “Save as type” window, which in the case at hand is “.dbg”. If you are using Windows 95, Windows 98 or Windows NT 4.0 or later and forget this and type ch04.dbg then the system will still add the “.dbg” extension and the file will be named

ch04.dbg.dbg making it difficult to find later. After you have supplied the debug filename and its directory and clicked OK the Debug Print Options dialog box as is shown below will appear.

Figure 2-14 Debug Print Options Dialog Box for QLP

30

Page 33: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This dialog box allows you to control the type and amount of output that is written to the debug output file on the disk. Since the output can be rather large, particularly for models with many elements in the state vector and models with many time periods, a judicious choice of output is advised. For example, in Fig. 2-14 only the system equation matrices like A and the criterion function matrices like W, as well as the results for the state variables, x, and the control variables, u, are selected to be written to the disk file. For small models like the current one this dialog box is not too important but for large models the ability to make these selections can be most useful. After you have clicked OK in the Debug Print dialog box or if you took the more direct route above and used the simpler Solve: QLP command without the “Print” option, there may be something of a wait while the model is solved. Then the results will appear as shown below.

Figure 2-15 Results

The results are display as shown in Fig. 2-15 in the default format with the time periods as rows and two numbers to the right of the decimal point; however, the user can modify this format by selecting the Preferences: Results option before selecting Solve. When this is done the dialog box shown in Fig. 2-16 will appear.

31

Page 34: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-16 Preferences for Results

The output can be displayed with the time periods as either rows or columns – the default is rows. In Figure 2-16 the column option has been selected rather than the row option in order to illustrate the outcome. Also, one can display the paths for the optimal states and controls only or can show these results along with the desired paths and/or with parameter values. The parameter values are not of interest in this model but will be later on when the Kalman filter is utilized. The format section of this dialog box enables the user to change the number of significant digits to display. For example, the “00.” option has been chosen above rather than the default “00.00” to illustrate the outcome. The format option affects both the display and the printed results. After these selections are made the “Preference for Results” dialog boxed can be closed by clicking on OK. Then if the problem is solved again by selecting the Solve menu and the QLP option, the window shown below will appear.

32

Page 35: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-17 Results with Time Periods as Columns and with Both Optimal and Desired

Paths Results for only the first six time periods are shown in Fig. 2-17. Results from the other time periods can be seen by scrolling. The format used in Fig. 2-17, with time periods as columns, is a natural one to use when the desired paths are also being displayed because it permits easy comparison of optimal and desired paths.

33

Page 36: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

12. Plots of Results: Single Run There are two plotting procedures in Duali. The first is plots of results from a single run. These plots allow the user to analyze state, control and parameter paths across various solution methods. In this chapter we will be concerned only with the deterministic QLP solution method, but we will use the plots to contrast optimal and desired paths for states and controls. The second plotting procedure in Duali is for scenario plots across multiple solutions. It will be discussed in the next section. In order to plot the results of a single run select Results: Plot: Single Run. Once you do this the following dialog box will open.

Figure 2-18 Plot Options Dialog Box

In the "Variables and Parameters" section select the state variables at first though you will probably want to look at the control variable solutions next. Also, later when using the Kalman filter with stochastic control sections the parameters selection will also be

34

Page 37: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

useful. Once you select either "States" or "Controls" in this part of the dialog box the section just below this called "Variable Selection" will change. It will list the acronyms for the corresponding set of variables. If it does not list acronyms for your model it may be because they have not yet been entered using the Data: Acronyms menu selection. For the time being leave the "cons" item highlighted so that the consumption state variable will be plotted. However, when you return to this dialog box later you will probably want to click on the "inv" acronym so that the path for the investment state variable will be plotted. In the "Show Path(s) For" section select the radio button to show both the optimum and the desired path. Later you may want to do plots in which you show only the optimal path or the difference between the optimal and desired paths. Finally the "Solution Method" used in this chapter is deterministic so the QLP option is selected. If it is not selected this may be an indication that model has not yet been solved with the Solve: QLP or Solve: QLP Print command. Next click on the OK button. Then the following window will appear.

35

Page 38: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-19 Plot Window

This window shows the optimum and desired path for the consumption state variable. Also at the top of the vertical axis it indicates the scaling. If the plotted state variables has unusually large or small numbers it will be scaled so you would find a statement like "cons x 100" or "cons x .01". Thus it is important to check this aspect of each graph to be sure that you do not make a mistake by some factor of ten when you report your results to others. The label "consumption" is the name for the variable that is supplied to Duali via the Acronyms dialog box. If you want to place this plot in a report you are writing, first adjust the window to the size you desire by clicking and dragging on the lower right hand corner. Then make sure that the plot window is selected and strike the Alt-PrintScrn

36

Page 39: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

combination of keys. This will copy a bit-mapped image of the plot window to the clipboard and you can then open a word processing application and paste the window into a document. When you are finished examining the plot click on the OK in the Continue Plotting dialog box as shown below.

Figure 2-20 Continue Plotting Dialog Box

You will then be returned to Plot Options dialog box. When you have finished plotting all of the state variables that are of interest to you, then switch to the control variables by selecting the "Controls" option in the Variables or Parameters section of the Plot Options dialog box. Then when you finish plotting the control variables that are of interest to you select the "Exit" button in the Plot Options dialog box and you will be returned to the main window of Duali.

13. Plots of Results: Scenarios

Consider next the scenario plotting method. This is most useful for doing sensitivity analysis, i.e. for changing a parameter of the model to a series of different values and solving the model each time in order to anlyze the effect on the solutions of the parameter changes.

In order to make use of this capability in Duali it is necessary first to pull down the Preferences menu and select the “Ask scenario question after solution”. This will cause that item to show a check mark. To be sure that the check mark is toggled to the “on” position pull down the menu again, but this time be careful not to select any item in the menu since that would have the effect of toggling that item either off or on to the opposite position.

37

Page 40: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

As an example of scenario plotting consider the effect of changes in the desired path for investment in the abelQLP model. Imagine that there was to be an election in the fourth quarter of 1964 and an incumbent President wanted to push investment up in the third quarter before the election in order to enhance his or her chances for re-election. To implement this, first check again to be sure that the “Ask scenario question after solution” item is check in the Preferences menu.

When doing preparations of scenario plots one alternates between solving the model with a Solve menu item and modifying the data with a Data menu item. In this cycle each time the model is solved there will be an opportuity to provide an acronym for that particular solution.

So we begin by solving the model with the Solve: QLP command using the base data. After you do this the dialog box shown below in Fig. 2-21 will appear.

Figure 2-21 Scenario Acronym and Description Dialog Box

Fill in the Acronym edit box with “base run” and the Description edit box with “desired investment at base value”. Then click OK and the Results window will appear. Close this window.

The next step is to modify the data for the second scenario. In our case this is the investment data in the desired paths for the state variables. To do this modification pull down the Data menu and select the Criterion Function item. Then in the subsequent dialog box select the XDES radio button, which is for the desired paths for the state variables, and the following window will appear.

38

Page 41: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-22 Window for Desired Paths of State Variables

Change the desired value for investment in period 1964-3 from 86.58 to 100.0 as is shown in Fig. 2-22. Then close the window by selecting OK. Be careful that you do not close the window by selecting Cancel or by clicking on the “x” in the upper right hand corner because the changed value will not be written to Duali’s internal memory. Next select OK in the Finished Editing dialog box. This will leave the Criterion Function dialog box. Here again be careful to select OK to close it.

While you are going through a scenario it is important not to use the File: Save command as this will have the effect of altering the model data on the hard disk. Also, it is important when you finish the sensitivity analysis to restore all data to the original values in case you should use a File: Save command. Of course if you really want to save altered versions of the model as you go through the scenario process, you can save these to the hard disk but it is probably best to use the File: Save As command in that case and assign a different file name to each version of the model.

The next step is to solve the model with this new desired path for investment. To do this pull down the Solve menu again and select Solve: QLP. When you do this the dialog box to provide an acronym and description for this solution will appear as shown below.

39

Page 42: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-23 Scenario Acronym and Description Dialog Box

Edit the items in this dialog box to change them to the entries as shown above in Fig. 2-23. Then select OK and the second solution to the model will appear. Close this window and you should be back to the blank main window of Duali.

At this point the model has been solved for two scenarios – (1) a “base run” solution with the desired value for investment in the 1964-3 quarter at 86.58 and (2) an “inv 100” solution in which that desired value was increased to 100.0. It remains only to repeat the steps above in order to compute a third solution with a desired investment value in the 1964-3 quarter of 120. The steps for this are summarized below.

Data: Criterion: XDES – change the 100 in investment in 1964-3 to 120

Click OK to close the desired paths window

Click OK to close the Finished Edition dialog box

Click OK to close the Criterion Function dialog box

Solve: QLP – assign this scenario the acronym “inv 120” and a description.

Close the Results window.

All three of the scenarios have now been created, labelled and stored. So the scenario plot can be made. To do this pull down the Results menu and select the Plots: Scenarios option. If all has gone well above, then when you do this the following dialog box will appear.

40

Page 43: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-24 Scenario Plots Dialog Box

In the Variable Selection box click on the “inv” option so that the investment paths will be plotted. Notice in passing that scenario plots can be done for states, controls or parameters by selection from the Variables group. Also, one can have various combinations of desired and optimal paths by a selection from the Show Paths For group. Up to five scenarios can be show on each plot. Each of the five combo boxes will have a list of all of the available scenarios and you can click in these boxes to select the scenario which you want used for each of the five lines.

Be sure that you have selected “inv” in the Variable Selection combo box and then click on OK. When you do so the scenario plot will appear as shown below.

41

Page 44: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-25 Scenario with Different Desired Paths for Investment

All of the plot lines appear in black and white in this User’s Guide but will appear in color on the computer display. This figure illustrates rather dramatically that changes in the desired path for investment in the 1964-3 quarter result in solutions with (1) substantial increases in investment in that period, (2) some increases in the periods just before and after and (3) a slight decrease in investment in the quarters in the following year of 1965.

Once you have finished with the plot click the OK button in the Continue Plotting dialog and you will be returned to the the Scenario Plots dialog box. You can use this to look at the effects of the changes in the desired path for investment on the consumption state

42

Page 45: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

variable or on the two control variables. When you are finish with the plots select the Exit button in this dialog box and you will return to Duali main window.

14. Display of Results

While plots like those discussed above are the preferred method for analyzing most results, there are time when tables of numbers are better. For example a set of tables can enable the user to look at all the results for states, control and criterion function at one time while each plot may shown only a few aspects of the total solution.

When a model is solved the results are written into an array corresponding to the method in use, viz in the chapter the method is QLP. This array can be accessed later until the model is solved again using the same method in which case the array is overwritten with the new solution.

The results in the “display” storage arrays can be shown by pulling down the Results menu and selecting “Display”. When this is done the following dialog box will appear.

Figure 2-26 Display Options Dialog Box

43

Page 46: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The displays always show the optimal paths for the state and control variables. However, the desired paths may also be shown if the “Desired States and Controls” option is selected. Also, parameters may be displayed in tables but that will be more interesting once the Kalman filter is in use in later chapters in this guide. For now click on OK and the following table will appear.

Figure 2-27 Display of Table of Results

This table has the time periods in the rows. As was discussed earlier, the same results can be displayed in a table with the time periods in the columns by pulling down the Preference menu, selecting the Results option and then clicking on the Columns radio button in the “Time Periods As” group. Also, one can change the format of the numbers in the display – in particular the number of significant digits displayed. Note that both the Preference: Results dialog box and the Results: Display dialog box have options that affect the display of tables of results that appear automatically after each solution as well as those which appear when Results: Display is chosen. Selection of an option in either of these dialog boxes will affect the results in both sources of displays.

44

Page 47: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

15. Models with Forward Variables Dynamic economic models can be divided into those that have only backward variables in the systems equations, viz. )(1 kk xfx =+

and those that have the expectations of some forward variables in the systems equations, viz. ),,( 211

ek

ekkk xxxfx +++ =

These different kinds of specifications for the systems equations were discussed briefly in Section 5 of this chapter. Models that have forward variables have come into increasing use in macroeconomics since the work of Lucas (1976) on rational expectations. Models with rational expectations can be represented as having systems equations with forward variables and can be solved with a variety of different methods. Duali employs the most straightforward of these methods, namely the Fair-Taylor method. In this method arbitrary values for the state variables in all time periods are computed at the start. Then, in the next step, the future values of the state variables are used in the systems equation at each time period to solve for the current value of the state variable. This is done for each time period in the model, from first to last, so that the procedure provides a new set of values for the state and control variables in all time periods. This process is then repeated - to solve for the entire time path of the state and control variables again - until convergence is obtained. As an example of this class of models, consider the simple single-state and single-control model used in Amman and Kendrick (1999a). Restart Duali and open this model. Use Specification: Name and Specification: Description to check the name and to read the description for the model. Then use Specification: Functional Form to obtain the following dialog box.

45

Page 48: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-28 Functional Form Dialog Box The unusual aspect of this dialog box is in the Forward Variables group on the right hand side of the dialog box. Here the Yes radio button is selected as is required for all models with forward variables. Next select Data: Size in order to see the following dialog box.

46

Page 49: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 2-30 Model Size Dialog Box Look in particular at the section labeled “Add for Forward Variables”. The edit box on the left in this line shows that the maximum lead in the model is two periods. The second and third boxes limit the iterations that are used while attempting to obtain convergence. The one on the right labeled “Convergence Tolerance” indicates the criterion for declaring that convergence has been obtained. Thus if the sum of squared difference between all the control variables in all time periods in one iteration and the previous iteration is less than 0.001 then the iterations are halted and convergence is declared. If however, this process requires more iterations than indicated in the “Iteration Limit” edit box in the center of the dialog box, the iterations are halted and an error message appears indicating that convergence was not achieved. This model solution process converges in six iterations so you will not see the warning message if you solve it.

47

Page 50: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

However, to see the how the warning system works, select Preferences: Results and set the format to 4 significant digits. Then change the Iteration Limit in the Size dialog box from 6 to 4 and solve the model with Solve: QLP. The following dialog box will appear.

Figure 2-31 Warning About Convergence Failure In order to obtain more data about the convergence failure, solve the model again, but this time use Solve: QLP Print. Name the debug file “akforw.dbg” and click on OK and then the dialog box bellow will appear.

Figure 2-32 Debug Print Options Dialog Box

48

Page 51: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Check the items indicated above, paying particular care to check the “forward-looking variables” item. Then click OK and the warning dialog box that was described above will appear. Click OK in this dialog box and the Results window will appear as follows.

Figure 2-33 Results Window The solution presented in this window is not the optimal solution since convergence has not been obtained; rather it is the last solution in the iteration process before the Iteration Limit results in a termination in the process of seeking convergence. In order to see how well the convergence was progressing before the termination, close the Results window and you will be back at the Duali main window. Then exit from Duali and put the “akforw.dbg” file into an editor. When you do so the top of the file will look like the following.

Debug File a 0.6000 b 1.0000 capc 300.0000 z 1.0000 d1 0.0000 d2 0.2000

49

Page 52: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

These are the A, B and C matrices, the z vector and the D1 and D2 matrices. Notice in particular that the D2 matrix is nonzero in this model with a forward variable. Scroll down in the file until you find a section that looks like the following.

CheckConvergence - iter = 2 usiter in CheckConvergence 50.9779 29.6894 23.8686 17.8505 usOld in CheckConvergence 67.3780 50.2390 49.2136 39.0300 usIterDiff in CheckConvergence -16.4001 -20.5496 -25.3450 -21.1795 epsCurrent in CheckConvergence 1782.1889

These lines are printed from the CheckConvergence subroutine and report on the convergence process at iteration 2. The array “usiter” is the control variables array “us” in the current iteration. The array “usOld” is the control variable array “us” in the previous iteration and the array “usIterDiff” is the difference between these two arrays. The values “epsCurrent” is the sum of squares of the values in the “usIterDiff” array. This value at 1782 is much larger than the Convergence Tolerance in the Size dialog box of 0.001 so the solution will not have converged yet. Scroll down further in the file until you find the results for iteration 3 which are

epsCurrent in CheckConvergence 21.3369

So epsCurrent is much lower but still above the 0.001 tolerance. Scroll down to the results for the 4th iteration and you will find

epsCurrent in CheckConvergence 0.2896

This is still not down to the tolerance of 0.001. Also, the Iteration Limit of 4 iterations has been reached so the following message will be printed in the debug file.

Warning! Reached iteration limit before reaching convergence tolerance in CheckConvergence.

50

Page 53: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

From the above it is apparent that the iteration process was converging nicely but just needed more iterations to be completed. Therefore the logical thing to do in this case would be to increase the “Iteration Limit” in the Size dialog box from 4 to say 10 and then repeat the solution process. If you were to do this no warning message would appear in a dialog box and the debug file would contain a message indicating that convergence has been obtained in the sixth iteration. In addition to the akforw.dui model there are a number of other models with forward variables in the Duali Model Library as discussed in Chapter 14. One of these models that is deterministic is the sarwal.dui model that is drawn from the classic Sargent and Wallace (1975) paper. You can take a quick look at this model by using the File: Clear command to clear the akforw.dui model and then the File: Examples: By Author: Sargent command to open the sarwal.dui model. (The Clear command has not yet been thoroughly debugged, but it is OK for limited use like this. However, if you get serious about using and perhaps performing some experiments on the Sargent and Wallace model you should exit from Duali, restart and reopen the model.) This completes the main lines of model input and solution of deterministic models. It remains only to provide some information about importing data from other sources and discussing printing and clearing.

16. Import Data One Matrix at a Time If you already have a model in Duali and have re-estimated the model so that the A, B and c matrices changed, then you might want to create three ASCII files with these new matrices and import them one at a time to Duali to replace the old matrices. If you want to create a new model and have most of the data in TSP or GAMS or Excel and want to move it to Duali, then you could create a folder with a set of files one for each matrix, viz. a.dma b.dma c.dma x0.dma

51

Page 54: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

z.dma w.dma lambda.dma etc. Here the extension "dma" stands for "duali matrix". You do not have to use this extension but doing so will simplify the importation. Each *.dma file should contain one matrix in stacked-up form. If, for example, the A matrix is 12 x 12 then it should be partitioned into three matrices: A0 which is 12 x 5, A1 which is 12 x 5 and A2 which is 12 x 2, i.e. [ A0 | A1 | A2]. In the file these matrices would be stacked up as A0 A1 A2 The use of 5 as the number of columns in these partitioned matrices is the default in Duali but can be changed with use of a dialog box that can be accessed from the Preferences menu by selecting the Import Matrix Columns options. The importation itself is accomplished via the File: Import Matrices menu option which has sub menus for the matrices in the System Equations Criterion Additive Noise Terms Parameter Uncertainty Measurement Error Handcrafted Feedback Rule Also, with this command there is a debug print capability. If you are having trouble importing a matrix this capability could be most helpful. However, if everything is going well you will not want to use it and can turn it off by using a "checked" option in the Preferences menu, namely the “Debug Print for Imported Matrices” option. Be careful not to use the File: Import Matrices option until the matrices are already declared and memory is allocated for them in Duali. This means that you have already opened an existing file with File:Open

52

Page 55: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

or that you have created a new model with File:New and have entered in the Size dialog box the dimensions for the model in terms of the number of states, controls, etc. If you want to do a small exercise in order to test this capability, take the file ch04.qlp and divided it up into the component files - one matrix in each file and without a header string to identify the matrix, i.e. include only the data in the file. Then use File:New to create a new model and to dimension it. Then import the matrices one at a time. The component files for this work might be stored in the folder "imports" in the subfolder "ch04". If you want to import data for an entire model rather than one matrix at a time see Appendix B “Importing Data from Other Applications”.

17. Printing Duali does not have the capability to print files directly. Rather use the Solve: QLP Print, Solve:OLF Print or Solve:Compare Print commands to write a file to disk which can then be printed from an editor. Also, you can use the File:Export QLP and File:Export DUAL commands to write files to disk that can be printed from an editor.

18. Clearing A “Clear” command has been implemented in Duali, however, as was mentioned above, it has not yet been thoroughly debugged and should not yet be used other than in a very limited fashion. Therefore, when you want to switch from one model to another it is better to exit from Duali and restart it. Then open the *.dui file for the new model.

53

Page 56: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 3

Transformations Transformations can be used to increase or decrease the size, to change the functional form specification or to alter the stochastic terms specification of a model. The transformation process preserves the existing data - when it is appropriate to do so – and provides guidelines about new data inputs that are required by some of the model modifications. One of the best ways to develop a new model in Duali is to begin with one of the existing example models and slowly but surely transforming it to have the size and specification as well as the data which you desire. By making modifications one at a time and solving the model after each change one can better understand the new model and may be more likely to get it up and running smoothly and without errors. The first thing to do before you begin to transform your model is to use the “Save” or “Save As” commands from the File menu to store a copy of the existing model before you began to alter it. Transformations that decrease the size of the model will results in loss of data and it is wise to be able to restore your original model in case something goes wrong while you are carrying out the transformations. There are three broad types of transformations available in Duali: 1. Changes in functional form specifications viz., from a constant to a time

varying priority matrix for the states or controls 2. Changes in the stochastic terms specification viz., from a “deterministic”

specification for the model to a “stochastic with additive noise terms” specification

3. Changes in size, i.e. addition or deletion of states, controls, etc These three types of transformations can either be done in the Functional Forms, Stochastic Terms or Size dialog boxes or by using the Transformation menu.

54

Page 57: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

1. Transformations from Dialog Boxes It is most natural to use the dialog boxes to do transformations. Thus if you want to change your model from one with two state variables to one with four state variables, it is logical just to change the number in the corresponding edit box in the Size dialog from 2 to 4 and then click OK at the bottom of the dialog box. If you do this a message box of the type shown below will notify you if the operation has been completed successfully.

Figure 3-1 The Transformations Notice Message Box

This operation may involve the creation of a number of new matrices, the copying of portions of the data from the old matrices to these new matrices and then the deletion of the old matrices. Thus these operations may take a little time if you have a large model. If you decide to decrease the size of your model, say by changing the number of states from 2 to 1, then you will need to inform Duali which of the two states you want to delete. In this case you will see a message box like the one below

Figure 3-2 Deletion Procedure Message Box

It is crucial to remove the state variables that are to be deleted in an order starting with the largest row number first and then working backward to the one with the smallest row number. This procedure insures that the data is not garbled during the transformation. Once you click on the OK button above the following dialog box will appear.

55

Page 58: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 3-3 Element-to-Delete Dialog Box

In this example the number two has already been entered to indicate that state variable which to be deleted. After you make this selection a message box will warn you as follows:

Figure 3-4 Warning About Potential Loss of Data

You can select No and the data will not be lost and the transformation will not be completed. Or you can proceed with the Yes option and part of the data will be erased during the transformation process. Next consider using the Stochastic Terms dialog box to transform a model from "deterministic" to "stochastic with additive noise". In this case one will be adding a covariance matrix for the additive noise terms and/or a sample of additive noises. This is accomplished as shown below in the case of the abelQLP.dui model. Before making this or any transformation be sure to save the existing file. Then proceed by selecting the Specifications: Stochastic Terms menu item. When you do this the following dialog box will appear.

56

Page 59: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 3-5 Transforming a Model from "Deterministic" to "Stochastic with Additive Noise"

When the dialog box first open the "Deterministic" option will be selected. Then click the "Stochastic with Additive Noise" option and the dialog box will appear as shown above. Then select OK and a message box will appear confirming that the transformation has been accomplished. When you click OK in that message box the following message box will appear.

Figure 3-6 Reminder to Add Data after a Transformation This message box is a reminder to be sure to enter the data for the Q covariance matrix and/or for the additive noise terms XSIS. If you want a Monte Carlo routine to be used to create the data then input the Q matrix. If, on the other hand, you want to read in the data for the random sequence in order to be able to replicate your own previous experiment or someone else's you should enter the data in the XSIS. Also you should select the Specification: Source of Random Terms

57

Page 60: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

menu item and specify at the top of that dialog box whether you want the random terms to be read in from XSIS or generated internally by using the Q covariance matrix.

Figure 3-7 Source of Random Terms Dialog Box If you select the option to generate the random terms internally you should indicate which terms you want generated. In the case at hand for additive noise terms in the systems equations check only the "Noise Terms for All Periods: System Equations" option. Since we are discussing a stochastic model here we have gotten a little ahead of ourselves. Rather stochastic models will be introduced starting in Part II of this User's Guide. However, the purpose here is not so much to elaborate on stochastic models as it is to caution that when changes are made in the "Stochastic Specifications" menu the user should be prepared to make the corresponding changes by adding data to a number of new matrices which are created and sometimes making other changes. Message boxes are provided to remind the user of most of the necessary changes; however, the user

58

Page 61: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

needs to be aware of the changes that are required and vigilant to make the necessary alternations. Otherwise the results obtained with Duali can be misleading. A simple cautionary exercise to go through after any model transformation is to review the data by selecting each of the items in the Data menu starting with Size and working your way down the menu to be sure that all of the old matrices are still accurate and any new matrices are filled in. Also, it is wise to fill in the new acronyms since their availability decreases errors when revising the data in old matrices or entering the data for the first time in new matrices. Finally, recall that once you have done a transformation that creates new matrices – and in particular if your model is large - to import the data using File: Import Matrices as discussed above than to type in all the elements. 2. Using the Transformations Menu As was mentioned earlier, transformations can be done either by using the Functional Forms, Stochastic Terms or Size dialog boxes or by using the Transformations menu. Pull down the Transformation menu now and you will see the three groupings on that menu as shown below in Fig. 3-8.

59

Page 62: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 3-8 The Transformations Menu

An example would be changing the structure of the penalty matrix specification for the states from time varying to constant. In this case the values for the first time periods are used as the new constant value. This illustrates how important it is to check all the matrices of the model after a transformation. If this change was made according to your expectation, then fine, but if it was not your expectation and you proceed to solve the transformed model without looking at the W matrix you may get solutions of a different character than you expect. Also, as discussed above a number of the transformations delete rows or columns from various matrices, so it is important to check to be sure that the correct rows and columns were deleted and the resulting matrix has the values and the shape that you intended.

60

Page 63: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Not all-possible transformations have been created. You may find that to reach a certain goal you have to do two or more transformations. Or you may find that a transformation you want has not yet been included in the set of possibilities. If this is the case please call it to our attention.

61

Page 64: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 4 Creating a New Model

There is a temptation to create a new model by opening Duali and using the Specification and Data menus to fill in the various items, beginning with Specification: Name and proceeding through Description, Stochastic Terms, etc. This temptation should be avoided. Rather it is necessary to use File: New as shown in Figure 4-1.

Figure 4-1 File: New

After selecting File: New a series of dialog boxes will appear in the following order

Data: Model Name Specification: Stochastic Terms Data: Model Size Specification: Functional Forms Specification: Source of Random Terms

There may be a temptation to skip over the name and move quickly to stochastic terms; however it will be helpful later if you take the time to provide a name for the model you are intending to develop.

62

Page 65: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

As you proceed through these dialog boxes, do not worry if you remember too late an item that you wanted to change or add. Once you make the first passed through you can use the Specification and Data menus to access any of the dialog boxes in whatever order you prefer to make additional changes. In some cases these additional changes may be "transformations" as discussed in the previous chapter, but that should work without difficulty. Once the Model Name dialog box is completed the next step is to provide the "Stochastic Terms" specification. Unless you are sure that you want to create a stochastic model, it is wise to begin with "Deterministic". Next is the "Functional Forms" specification as discussed in an earlier chapter. Also, there is a "Source of Random Terms" dialog box. While you are doing deterministic models just check "Read-In" at the top and ignore the rest of that dialog box. After you have completed this sequence it is wise to provide a brief description of your model by using Data: Description. Even if you write only a single line to describe the model, that is a good start that can be added to or modified later. As you progress from one version of your model to the next it is important to modify the Description as an aid to keep up with the many versions of the typical model. Next add acronyms by using Data: Acronyms before you begin to enter the data. When you open the Data: Acronyms dialog box you will discover that Duali has already numbered the variables; however, it will pay dividends later if you enter your own acronyms in a way that is meaningful for your model. Also, the “names” will be useful to yourself as well as to other users of your model as a reminder of exactly what the acronyms stand for. Also the “names” are used as labels in the graphs.

63

Page 66: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Part II

Stochastic Models: Introduction

64

Page 67: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 5

Open Loop Feedback without Updating This chapter provides a first glimpse into the world of stochastic control models. It does so by using one kind of stochastic model that is an important first step forward from deterministic models. The most common first step from deterministic to stochastic models is to provide additive noise terms to the system equations. However, that step is a little too easy for our purpose here and so we are considering here a case where the uncertainty is in the parameter estimates as well as in the additive noise terms. At the same time we keep the analysis relatively simple by not including the use of the Kalman filter to update parameter estimates from one period to the next. In summary, this chapter considers stochastic control models in which the policy maker treats the parameter estimates as uncertain, but in which the degree of uncertainty does not change from one period to the next as more data is collected. Rather the degree of uncertainty remains the same because there is no use of the Kalman filter to update the mean and covariance of the parameters from one period to the next. The Kalman filter will be introduced in the next part of this User’s Guide. Since we consider here stochastic control models with uncertainty in the parameters of the model, but without updating this chapter corresponds to Chapter 6 and Chapter 7 (Sections 1 and 2) in Kendrick (1981). When the Kalman filter is introduced in the next part of this User’s Guide the material will correspond to Section 3 of Chapter 7 of Kendrick (1981).

1. Getting Started Began by double clicking on the Duali icon. When the Main window opens select File:Open. In the list box double click on the

ch07.dui file. This file is for the one-state, one-control model by Elizabeth Chase MacRae that is used in Chapter 7 of Kendrick (1981). It is an open loop feedback control model. From the Specification menu select the Name option to review the model. Then on the same menu select the Description option. A window will appear providing a description

65

Page 68: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

of the source of the model and its uses. Close this window. Next select the Stochastic Terms item on the Specification menu. This window will appear as is shown below.

Figure 5-1 Stochastic Terms Dialog Box for the MacRae Model Since the model as used in this chapter corresponds to Sections 1 and 2 but not section 3 of Chapter 7 and thus includes parameter uncertainty but not measurement error, the third of the four stochastic terms options has been selected. These options will be discussed in detail in the next part of the User’s Guide.

2. The Functional Forms Dialog Box Next on the Specification menu click Functional Forms. The dialog box shown below will appear.

66

Page 69: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 5-2 Form Specifications Dialog for the MacRae Model Since the MacRae model was originally solved with the Dual code, the options selected above are those that are followed by the asterisks. These are the required options for the Dualpc code; however, these options are not required in Duali. The word "Dual" is used in two different ways in this guide and it is important to distinguish them. First, it is used to indicate the active learning or adaptive control method - a method that is sometimes used to solve stochastic control models. Second it is used as the name of a set of computer codes. The Dual and Dualpc software packages contain code for three methods which will be compared more fully at the beginning of the next part: (1) certainty equivalence - CE, (2) passive learning or open loop feedback - OLF and (3) active learning or dual control - Dual. In this guide the distinction between the two uses of the word will be made by writing either "Dual method" or "Dual code". The reference in the next to last sentence of the paragraph above is to the "Dual code" so the statement applies to that code.

67

Page 70: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The asterisks in Fig. 5-2 should not be interpreted to mean that all stochastic control problems must be specified in this manner. Rather the present input format of the personal computer version of the Dual code, Dualpc, requires these input forms.

3. Source of Random Terms Dialog Box Pull down the Specification menu and selected the Source of Random Terms item. Then the dialog box shown below will appear.

Figure 5-3 Source of Random Terms Dialog Box The Dual code permits the user to either “read in” random terms or to generate them internally. Since, latter, we will want to replicate the results from the later part (Section 3) of Ch. 7 in Kendrick (1981) we select the “Read In” option. The other items in this

68

Page 71: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

dialog box have to do with options that can be exercised when the random noise terms are generated internally. Since we are not concerned with those possibilities here, the discussion of these items will be postponed until later.

4. Size Dialog Box Next, from the Data menu select the Size option. The dialog box shown below will appear.

Figure 5-4 Size Dialog Box for the MacRae Model As is indicated in the dialog box above the MacRae model has one state and one control variable. Also, there is a constant term c in the system equation, which requires that the model have one exogenous variable. The model has three time periods in all, namely an

69

Page 72: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

initial period called period 0 and then periods 1 and 2. There are no forward variables so that section of the dialog box is left blank. As the dialog box indicates there are two new size elements that need to be entered for the passive learning (OLF) case. The first of these is the number of uncertain parameters. The uncertain parameters are a subset of the parameters in the A and B matrices and the c vector of the system equations x Ax Bu c k Nk k k+ = + + = −1 0,..., 1 (5-1)

where A = state vector coefficient matrix (n x n) B = control vector coefficient matrix (n x m) c = exogenous vector (n x 1)

In the algorithm these uncertain coefficients are stacked up in a vector. For example if the model had three state variables and two control variables the A matrix would be 3x3, the B matrix would 3x2 and the c vector would be 3x1. Then if the coefficients a ,

, b and c were to be treated as uncertain the 11

a23 22 3 θ vector of uncertain parameters would be

θ =

⎢⎢⎢⎢

⎥⎥⎥⎥

aabc

11

23

22

3

In this case one would enter four in the uncertain parameters section of the Size dialog box. If on the other hand all of the parameters in the model were treated as uncertain there would be 9 + 6 + 3 = 18 elements in the theta vector and one would enter 18 as the number of uncertain parameters. The other element to be entered in the Size dialog box is the number of Monte Carlo runs. For the moment enter one in this location. This will assure that the model is solved once. The last element of the dialog box about observation variables is not required for this version of the MacRae model and will be discussed later.

70

Page 73: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

5. The Acronyms Window On the Data menu click Acronyms. The acronyms window will open. The MacRae model has a single state and a single control variable so these are given the simple acronyms 'x' and 'u'. Also, by scrolling the window down you will see that the single exogenous variable in this model is given the name 'One' and the time periods are named 0, 1 and 2. Further scrolling will bring you to the section on uncertain parameters. There are three parameters in the MacRae model but only one of these; the 'b' parameter that is multiplied by the control variable is treated as uncertain in this version of the model. At the bottom of the Acronyms dialog box is a section on observation variables that will be used later but can be ignored now. Select OK and you will return from the Acronym Window to the Main Window.

6. The System Equations On the Data menu click System Equations. A dialog box will appear which will enable you to check all of matrices and vectors of the system equations. The z vector for the exogenous variables is provided in time-varying form in case you are later planning to use this model with the Dualpc software. For that code the input matrix for z will need to have a row dimension of the number of states and a column dimension of the number of time periods less one as is also done here.

7. The Criterion Function On the Data menu click Criterion Function. A dialog box will appear which will enable you to check all of matrices and vectors of the criterion function. These elements are the same for stochastic as for deterministic problems so the discussion in Chapter 2 about the role of each matrix or vector can be consulted if necessary. The one important difference is that the Dualpc code requires that the W penalty matrix for the states be input in the "Terminal Diff" format. This means that if you are using Duali to prepare

71

Page 74: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

input for the Dualpc code you cannot use time-varying W matrices except for the case in which the terminal period W matrix is different from the constant W matrices for all other time periods. Thus the Criterion Function dialog box has options to permit the user to enter a matrix for W and a separate matrix WN for the terminal period. It is necessary to enter both matrices. However, if you are planning to solve your model entirely in Duali you are free to use any of the options about the W matrices.

8. Additive Noise Terms On the Data Menu click Additive Noise Terms. A dialog box below will appear.

Figure 5-5 Data for Additive Noise Terms

This dialog box provides access to the Q covariance matrix for the additive noise terms and XSIS vectors of additive noise terms. The user will commonly use either the one or the other of these - the first if the noises are to be generated internally or the second if the noises are from a known sample and are to be read in. However, in the model at hand both of these data items are provided. Thus the model can be used in either mode. Moreover, the availablility of the sample noise terms in XSIS enables one check the results here against those in Ch. 7 of Kendrick (1981). The Q matrix is the covariance matrix for the additive noises in the systems equations. Therefore, if single equation estimation methods are employed this matrix will be a diagonal matrix and if simultaneous equation methods are used it will be a full matrix.

72

Page 75: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Thus this matrix is input to Duali as a full matrix in order to accommodate either estimation possibility. The row dimension of the XSIS matrix will be the number of state variables and the column dimension will be the number of time periods since a vector of noise terms must be provided for each time period.

For a more thorough discussion of additive noise terms see the discussion in the next part of this guide.

9. Parameter Uncertainty On the Data Menu click Parameter Uncertainty. A dialog box will appear which will enable you to select each of matrices that must be provided for this type of model. The dialog box is shown below.

Figure 5-6 Data for Parameter Uncertainty

73

Page 76: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

TH0 (theta-zero) is a vector of the initial values of the elements in the θ parameter vector. Thus in one of the cases discussed above this vector would have 4 elements and in another case it would have 18 elements. For the present version of the MacRae problem this vector has a single element that is the initial estimate of the b parameter. The SITT0 (sigma-theta-theta-zero) matrix is the covariance matrix for the θ vector at the initial time period of the model. Thus when there are 4 uncertain parameters this matrix will be 4x4. In the case at hand for the MacRae model it is a single element because there is a single unknown parameter. Notice that this matrix is not the covariance matrix for all the parameters in the model but rather only for the subset of the parameters that are treated as unknown and which are therefore in the θ vector. The ITHN (i-theta-to-n) matrix is used to indicate which of the parameters in the model are treated as unknown parameters and to provide a mapping from the position in the theta vector to position in the system equations matrices. For example, we discussed above the case of a model with three state variables and two control variables in which four of the parameters were treated as unknown. These parameters were a , a , b and c . The ITHN matrix has three columns to provide the required information. The first column indicates the matrix (0 for the A matrix, 1 for the B matrix and 2 for the c vector) and the second and third columns indicate the row and column number of the parameter in the matrix. There will be as many rows in the ITHN matrix as there are unknown parameters. Thus for the four parameter case above the ITHN matrix would be

11 23 22

3

0 1 1 0 2 3 1 2 2 2 3 1 For the MacRae model with only the b parameter as unknown the ITHN matrix will have a single row and will be 1 1 1 i.e. there is a single unknown parameter that is in the B matrix and is the (1,1) element in that matrix.

74

Page 77: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Warning: OLF solutions are not yet implemented in Duali for models in which some of the unknown parameters are in a column other than the first column of the C matrix. Thus the present version of the code is well equipped to deal with cases where there is a c vector of coefficients in the system equations which represent the constant terms in the equations and where this c vector become the first (or only) column in the C matrix for the input to Duali (see Eqs (2-3) and (2-4) in Chapter 2). In summary: the present version of Duali works fine for models with constant terms in the equations which become a c vector in the state space form of the equations and can accommodate some of these coefficients in the theta vector as unknown parameters. However, Duali cannot yet accommodate a specification in which there is a C matrix in the model with some exogenous variables in addition to the “one” as the first element in the z vector and where some of the elements of the C matrix other than those in the first column are treated as unknown parameters. Hopefully by the time you read this warning Duali may have been extended to deal with unknown parameters in all columns of the C matrix so check with the authors. Thus the present version of Duali cannot include a line in the ITHN matrix that is 2 3 2 i.e. where one of the uncertain elements is in the C matrix – as indicated by the first 2 -and is element (3, 2) in that matrix; however Duali can accommodate a specification like 2 3 1 when there is a c vector and the unknown parameter is in the (3,1) position of the C matrix.

10. Data for the Measurement Error Terms It is not necessary to enter any data via this menu since measurement errors are not used in this model. Rather this menu item will be discussed later.

75

Page 78: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

11. Solving the OLF Model On the Solve menu click either “OLF (w/o update)” or “OLF (w/o update): Print”. These refer to the OLF method without the Kalman filter updating method. Of the two the “OLF” option is simpler since it provides output only to the display, but the “OLF: Print” option might be preferred since it provides output to the disk. The disk output can later be printed or can be cut and pasted to a spreadsheet and plotted if you want to use plotting methods in addition to those provided in Duali. If you choose the OLF: Print option a dialog box will appear telling you that the next dialog box will request the name of the file to use for the debug print. Duali employs the convention of using the extension *.dbg for the debug file, but you may prefer some other. So for the example at hand you might use the file name ch07.dbg As has been discussed before for *.dui files, if you are using Windows NT 3.51 or earlier you should supply the file name and the extension just as shown above; however, if you are using Windows 95, Windows 98 or Windows 4.0 or later be careful to provide only the file name and not the extension. Thus in the “File name” window you would type ch07 and the system will then add the extension shown in the “Save as type” window, which in the case at hand is .dbg. If you are using Windows 95, Windows 98 or Windows NT 4.0 or later and forget this by typing ch07.dbg then the system will still add the “.dbg” extension and the file will be named “ch07.dbg.dbg” making it difficult to find later. After you have supplied the debug file name and its directory and clicked OK one of two things will happen. If you chose OLF above, then there will be a wait while the problem is solved before the results are displayed. If you chose the OLF: Print option then the Debug Print Options for OLF property sheet shown below will appear.

76

Page 79: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 5-7 Debug Print Options for OLF Property Sheet This property sheet is a tabbed dialog box that allows you to control the type and amount of output that is written to the debug output file on the disk. The tabs divide the print controls into five groups Summary Input Intermediate Results Averages The Summary print controls are shown on the first page of the property sheet and are sufficient for the print control used in this chapter. Since the output can be rather large, particularly for models with many elements in the state vector and with many time periods, a judicious choice of output is advised. For

77

Page 80: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

example, in Fig. 5-7 the “Only inputs and results summary” item is selected rather than the “All” item. The output can be voluminous even for a small model like the MacRae model so it is advisable to begin with the more parsimonious options and work toward getting more and more output until you obtain what you need. Next click on the OK button to close the property sheet. We will not discuss the rest of this property sheet here but rather in a later chapter when more of the options are relevant. For small models like the current one this property sheet is not too important but for large models the ability to make these selections can be most useful. After you have clicked OK in the Debug Print Options for OLF property sheet there may be something of a wait while the model is solved. Then the results will appear as shown below.

Figure 5-8 Results This result for u0 of 1.71 agrees with the results in Section 7.2 of Kendrick (1981); however, the rest of the results do not agree with those in Section 7.3. The reason for this is that the results in Sec. 7.3 are influenced by the additive noise terms which are not used when "Solve: OLF" or "Solve: OLF Print" are used to solve the model. However they are used when "Solve: Compare" or "Solve: Compare Print" are used to solve the model - as will be discussed in the next part of the User’s Guide.

78

Page 81: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The results are display as shown in Fig. 5-8 in the default format; however, the user can modify this format by selecting the Preferences: Results option as was discussed in Chapter 2. The results can be further examined by using the “Results: Plot: Single Run” menu option. When this is done the following dialog box will appear.

Figure 5-9 Plot Options

The use of the Plot dialog box was discussed earlier and will not be repeated here except to describe the selection in the "Solution Methods" part of the dialog box. The "OLF w/o updated coef" item is selected there. This is the appropriate choice for the model in this chapter since "Solve:OLF (w/o update)" rather than "Solve:Compare" is used to solve the model and there is therefore no parameter updating. The other "OLF" options further down in this portion of the dialog box refer to OLF with updating. This option will be discussed later.

79

Page 82: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

When you are finished with the plotting select the "Exit" button in the dialog box. Then if you used "Solve: OLF Print" and want to examine the debug print it is necessary to exit from Duali in order to close the debug print file and make it available for use in an editor. Use an editor (such as Microsoft Word) and open the ascii "ch07.dbg" file. Depending on the print options one selects, this file may contain considerable information that is useful. For example, it is valuable to echo print the input data and check it to be sure that the data you wanted was used in the solution. Also, a wide variety of intermediate and final results may be helpful to you depending on the part of the model that is the current focus of your work. These results may be copied and pasted from the *.dbg file to Excel or some other plotting program in order to provide plots to supplement those available from Duali.

12. Scenario Plot

One important research question in the field of stochastic control of economic models is the changes in the control variable paths which occur when the uncertainty in the parameters is increased. In seems likely that as the policy maker becomes less certainty of the effect of a change in a policy variable that the variable will be used less. Lets look at that proposition here by doing a series of runs starting from the base run in which the variance of the “b” parameter which is multiplied by the control is at 0.5, and then increasing it in two steps to 0.7 and to 0.9.

As was discussed earlier, the first step in making scenario plots is to pull down the Preferences menu and select the “Ask scenario question after solution?” menu item. Once this is done the base run can be made by using “Solve: OLF (w/o update)”. Assign an acronym for this base run of “b = 0.5” and provide a name and then click on the OK button.

Then prepare for the second run by selecting “Data: Parameter Uncertainty: SITT0” and changing the 0.5 to 0.7. Be sure to click OK rather than cancel at each option until you get back to the main window. Then select “Solve: OLF (w/o update)” again and this time assign the acronym “b = 0.7” and provide a name. Finally repeat the steps above for the third scenario run but this time set the b coefficient to 0.9.

When this is completed the plot can be made by selecting “Results: Plot: Scenarios”.

80

Page 83: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 5-10 Scenario Plot Dialog Box

When the Scenario Plot dialog box appears use the Variables group to select Controls and the dialog box should look something like that shown above. Then click on the OK button and the plot shown below will appear.

81

Page 84: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 5-11 Response of the Control Variable Paths to Increases in

Parameter Uncertainty

Indeed Fig. 5-11 shows that in this case as the variance of the uncertain parameter is increased the optimal control paths become lower.

Be careful when you finish looking at the scenario plot to locate the small “Continue Plotting” dialog box and click the OK button in it. This will close the plot window. If instead you close the plot window directlty by clicking on the small x in the upper right hand corner, the plot window will still close but will leave the “Continue Plotting” dialog box open. If you forget this step a time or two Duali will crash, so be sure to close the small “Continue Plotting” dialog box after each plot.

82

Page 85: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

It is a good idea to restore the original data for the model after each set of scenario runs. Do this now by selecting “Data: Parameter Uncertainty: SITT0” and changing the variance from 0.9 back to 0.5.

Also, when you are finished with the scenario plots, pull down the Preferences menu and toggle off the check mark on the “Ask scenario question after solution?” option.

13. Forward Variables

There is an example model among the Duali set which has forward variables and which can be used for experiments with rational expectations models. It is the akforwst.dui model and is a variant of the model used in the chapter in this guide on deterministic models. It is taken from the Amman and Kendrick (1999a) paper. See the discussion of deterministic forward variables in Chapter 2 for a review of the convergence procedures used with this class of models.

14. Caution Experiment

Since there is no updating of parameter estimates in the OLF w/o update solution the variance of the uncertain parameter is constant across time in these solutions. However, it may be useful to analyze the effect on the use of the control variables in the first time period (period 0) in response to increases in parameter uncertainty in later periods. An option for doing this is now available in Duali and can be turned on by pulling down the Preferences menu and selecting the option entitled "Caution Experiment" which yields the dialog box shown below.

83

Page 86: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 5-12 Caution Experiment Dialog Box

This dialog box enables the user to run the kind of experiments with OLF models that are described in Mercado and Kendrick (1998). These experiments analyze the effects of increases in the uncertainty associated with an uncertain parameter in either the first or some subsequent time period on the optimal control for the first time period.

84

Page 87: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Part III

Stochastic Models: Comparison of Methods

85

Page 88: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 6 Stochastic Control: Overview

In the previous chapter we introduced stochastic control with the use of a particular example: open loop feedback to solve models with additive noise and parameter uncertainty but without Kalman filter updating of parameter estimates. In this part of the User’s Guide we step back to take a broader look at the many kinds of stochastic control solution methods and discuss the capabilities in the Duali software to facilitate comparison of these methods. It would seem to be a simple enough statement. "I am solving a stochastic control model." That means that the person is solving dynamic optimization problems in which there are some uncertain elements. However, there is such a wide array of types of stochastic control problems that it is useful to categorize them by asking three questions? 1. What method is used to compute the solution? 2. Are the uncertain parameters re-estimated from one period to the next? 3. What elements in the model are treated as stochastic? Let’s consider these three dimensions of stochastic control problems one by one. 1. Method How is the solution computed? The simplest way is to write down a feedback rule and guess about the parameters in that rule. Or to express it another way - to make a "handcrafted rule". The common form of a feedback rule for a quadratic linear optimal control model of is a linear feedback rule of the form (6-1) gGxu +=

where the control vector with elements =u m

=x the state vector with elements n

the feedback gain matrix =G =g the feedback gain vector

86

Page 89: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

For example, consider a model that has two state variables (the inflation rate and the unemployment rate) and two control variables (the money supply and government expenditures). The feedback rule for such a model might be something like

(6-2) ⎥⎦

⎤⎢⎣

⎡+⎥

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡−=⎥

⎤⎢⎣

⎡7550

3.002.

uni

em

where the money supply =m

government expenditures =e

the inflation rate =i

the unemployment rate =un

Thus the user would just select the four numbers in the G matrix and the two numbers in the g vector and then try out that feedback rule. If it did not work as desired then the user would modify one or more of the numbers in G and g and then try again. This

process would be repeated until a satisfactory feedback rule was obtained. Thus the user would effectively "handcraft" the feedback rule. In the second method the user might compute an optimal feedback control rule using a tracking criterion function of the sort described in Chapter 2 of this guide. If the uncertainties in the parameters were ignored while computing this optimal feedback rule, the optimization procedure would be called the "certainty equivalence" method. Since all the uncertainty is ignored, this is effectively the same as the deterministic control procedure that is outlined in Chapter 2 of Kendrick (1981). If on the other hand, the covariance matrix of the parameter estimates is considered while computing the elements of the feedback rule; the optimization procedure is called the "open loop feedback" method. This procedure is described in Chapter 6 of Kendrick (1981) and is the method used in the previous chapter but with the addition of the Kalman filter to update parameter estimates in each time period. Finally, a very elaborate optimization procedure may be used in which one considers the effects of the control variable choices not only on the future path of the system but also on the degree of uncertainty in the parameter estimates. This is called "dual" control because the control variable has dual purposes to both guide the system and to probe the system to decrease the uncertainty in the parameter estimates.

87

Page 90: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

So in summary there are four basic optimization procedures – three of which are available in the current version of Duali

• handcrafted feedback rules HCFR • certainty equivalence CE • open loop feedback OLF • dual DUAL (not in Duali but in Dualpc)

there are in addition in Duali two subsidiary optimization procedures that are variants of the basic procedures. They are

• certainty equivalence w/o update CEWO • open loop feedback with insight OLIN

The first of these, certainty equivalence w/o update (CEWO), is identical to the certainty equivalence method except that there is no updating of parameters with the Kalman filter. Thus under this method a policy maker may start with an incorrect estimates of the parameters of the model and does not improve on these estimates over time. The second method, open loop feedback with insight (OLIN), is the same as open loop feedback except that it is used for a particular kind of experiments involving policy to parameter effects. These effects follow the Lucas critique, which argues that when policy variables are changed that private agents modify their behavior and thus that the parameters of the model will shift. With the OLF method the policy makers do not know exactly what effect changes in policies will have on parameters but with the OLIN method it is assumed that policy makers have the “insight” to know exactly what the effect will be on parameter values of changes in policy levels. So in summary there are five different methods in Duali that can be compared with one another by using the Solve: Compare command.

88

Page 91: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

• handcrafted feedback rules HCFR • certainty equivalence w/o update CEWO • certainty equivalence CE • open loop feedback OLF • open loop feedback with insight OLIN

2. Updating Parameter Estimates Are the uncertain parameters re-estimated from one period to the next? The simplest thing to do is to avoid updating the parameter estimates. In contrast, when updating is done the procedure may go as follows. One chooses a set of control variables in a given time period and uses those to move the system forward one time period. In a stochastic control environment additive noises strike the system so the combination of the controls and lagged states plus the noise elements yields a new vector of state variables. That new vector can be used along with a Kalman filter to update the estimates of the uncertain parameters. So the simple thing to do is to ignore the new data and the more complicated thing to do is to use a Kalman filter or some other estimation procedure to update the parameter estimates. Thus in summary there are two choices

• no updating • updating

3. Stochastic Specification of the Model What elements in the model are treated as stochastic? The most common specification for random elements in a stochastic control model is to provide additive noise terms in the system equations. Thus the system equations (2-3) that were used in Chapter 2 of this users guide, i.e.

89

Page 92: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

x Ax Bu c k Nk k k k+ = + + = −1 0 1,..., (6-3) where A = state vector coefficient matrix (n x n)

xk = state vector for period k - an n vector B = control vector coefficient matrix (n x m) uk = control vector for period k - an m vector ck = exogenous vector for period k (n x 1)

is modified by including an additive error term to become

1,...,01 −=+++=+ NkcBuAxx kkkkk ξ (6-4)

where kξ = vector of additive error terms

The next level of stochastic specification is to also treat the parameters of the model as unknown and to add the specification that all or a subset of the parameters in and

are treated as constant but unknown. Thus estimates of the means and covariance matrix of the unknown parameters are used in the model specification.

BA,

c

A third level of stochastic specification is reached by retaining both the additive noise terms and the unknown parameters and adding additional sources of uncertainty. The addition sources are primarily in the measurement errors. Thus it is assumed that the state vector x cannot be observed directly, but rather only through a noisy measurement relationship of the form kkk Hxy ζ+= (6-5)

where = measurement vector ky

H = measurement matrix kζ = measurement error vector

This specification has the affect of making the state vector uncertain, so this class of models also usually includes uncertainty about the initial state of the system. An additional source of uncertainty is included in this third specification. This is an additive error term in the parameter evolution equations. This is used only in cases where the model coefficients are treated not only as unknown but also as time varying, viz. in the OLIN experiments that are discussed in Chapter 10 of this guide.

90

Page 93: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

In summary, there are three levels of stochastic specification as well as deterministic so we end up with four categories

• deterministic • stochastic with additive error terms • stochastic with additive error terms and parameter uncertainty • stochastic with additive error terms, parameter uncertainty and

measurement error 4. A Table of Stochastic Specifications One can display the various combinations of specifications in a table as shown below. The entries in Table 6-1 show the chapter in this guide where each type of model is discussed and also show the types of stochastic terms that are included in that model.

Updating Options Optimization Options no updating updating

handcrafted feedback rules NA HCFR Ch. 7

additive noise certainty equivalence CEWO

Ch. 8 additive noise

CE Ch. 8

additive noise open loop feedback OLFwo

Ch 5 parameter uncertainty

OLF and OLIN Ch 9

parameter uncertainty dual NA DUAL

Ch 11 export to Dualpc

Table 6-1 The Varieties of Stochastic Models

91

Page 94: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The OLFwo method is not yet fully integrated into the comparison procedures. Thus OLFwo solutions can be obtained one at a time following the procedure outlined in Chapter 5, but cannot be compared with the other methods while doing Monte Carlo runs of the type discussed in the chapters which follow this one. Also measurement error and time varying parameters can be used via the “measurement error” specification with all of the methods except OLFwo.

92

Page 95: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 7

Handcrafted Feedback Rules

1. Mathematics As discussed above the most straightforward optimization procedure is to write down or "handcraft" a feedback rule, test it, modify it, test it, etc until a satisfactory rule is obtained. It is a rather crude form of optimization but may be quite effective. This is particularly true when similar models exist for which optimal feedback rules have already been calculated or where substantial experience either already exist or can be gained over time with experimentation. The common form of a feedback rule for a quadratic linear optimal control model of the type discussed in the previous chapter is (7-1) gGxu +=

where the control vector with elements =u m

=x the state vector with elements n

the feedback gain matrix of conformable size =G =g the feedback gain vector of conformable size

For example, if the model has two control variables (the money supply and government expenditures) and two state variables (the inflation rate and the unemployment rate) the feedback rule might be something like

(7-2) ⎥⎦

⎤⎢⎣

⎡+⎥

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡−=⎥

⎤⎢⎣

⎡7550

3.002.

uni

em

where the money supply =m

government expenditures =e

the inflation rate =i

the unemployment rate =un

93

Page 96: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Thus the user would select the four numbers in the G matrix and the two numbers in the g vector and then try out that feedback rule. If it did not work as desired, then the user would modify one or more of the numbers in G and g and try again. This process would

be repeated until a satisfactory feedback rule was obtained. Thus the user would effectively "handcraft" the feedback rule. 2. Data Inputs For this part of the User’s Guide we will make use of the stochastic version of the Abel (1975) model that is in the file abel.dui. So use “File: Open: abel.dui” to open this model in Duali. Then select Data: Handcrafted Feedback Rule and the following dialog box will appear.

Figure 7-1 Inputs for Handcrafted Feedback Rule

First select the G item and an m by n input matrix will appear which can be filled-in.

94

Page 97: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 7-2 Feedback Gain Matrix for the Handcrafted Feedback Rule Notice that the control variables are the row labels and the state variables are the column labels. Thus, for example, when consumption rises this will tend to decrease government expenditures in order to decrease economic activity and stabilize the economy. The feedback gain matrix, G, shown in Fig. 7-2 may not be a particularly good one and the user is invited to try his or her hand at improving on it. For now leave the G matrix as it is and click on OK. Then go the data entry window for the g feedback gain vector, but also leave it as it is for now. Then click on the dialog boxes until you get back to the Duali main window.

95

Page 98: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

3. Solution Procedure The model can be solved by selecting Solve: Compare at which point the following dialog box will appear.

Figure 7-3 Method Choice

Check the " HCFR, Handcrafted Feedback Rule" box and then select OK. The results will appear as shown below.

96

Page 99: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 7-4 HCFR Solution

This is a solution for a single method – namely HCFR – but shortly we will be able to compare this solution to those obtained with other methods.

97

Page 100: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 8 Certainty Equivalence

In contrast to the handcrafted feedback rule discussed in the previous chapter, the user may compute an optimal feedback rule using a tracking criterion function of the sort described in Chapter 2 of this guide. If the uncertainty in the parameters is ignored while computing this optimal feedback rule in the presents of an additive noise term in the system equations, the optimization procedure is called "certainty equivalence". Since all the uncertainty except the additive noise is ignored, this is similar to the deterministic control procedure. In fact the data inputs for kind of model differ from those for the deterministic model described in Chapter 2 primarily in the treatment of the stochastic additive noise terms. Therefore the section below focuses on these inputs. 1. Data Inputs A useful way to illustrate a model with stochastic additive noise terms is to use a transformed version of the abelQLP.dui model used in Chapter 2. Open this model that is called abeladd.dui. To do this restart Duali and use “File: Open: abeladd.dui”. First check the Stochastic Terms dialog box. Do this by selecting the “Specifications: Stochastic Terms” menu item. When you do this the following dialog box will appear.

Figure 8-1 Stochastic Terms Specification for a Model with Additive Noise

98

Page 101: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Next pull down the Data menu and select the Additive Noise Terms option. The following dialog box will appear.

Figure 8-2 Additive Noise Terms Dialog Box

The most important data for the additive noise specification is the Q matrix that is the covariance of the additive noise terms. Select the Q radio button and the following window will appear.

Figure 8-3 The Covariance Matrix Q for the Additive Noise Terms

Notice that both the row and column labels for the matrix are state variables (consumption and investment) so the matrix is square and in the case at hand it is a diagonal matrix. When single equation estimation methods are employed the matrix will

99

Page 102: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

be diagonal and when simultaneous equation methods are used the off diagonal elements will also be nonzero. The Q matrix is used by the Monte Carlo subroutines in Duali to generate a set of additive random noise terms. For an example of those terms click on OK and return to the Additive Noise Terms dialog box shown in Fig. 8-2. Then select the XSIS radio button and the following window will appear.

Figure 8-4 A Sample of Additive Noise Terms, XSIS

In this window there is a noise term for each of the two state variables for each of seven time periods. These terms were generated in some past run of the model and then copied and entered into this dialog box. It is not necessary to enter a XSIS matrix in order to solve CE solutions with Duali; rather they are only used when the user wants to replicate a previous solution or a solution done by someone else. Ordinarily the user will enter only the covariance Q matrix and will not see the XSIS which are generated except on the print out of intermediate results; however we have entered them here in order to illustrate the procedure to be used if one wants to use a previous sample of additive noise terms in order to replicate some results. Close the XSIS window and return to the Duali main window.

100

Page 103: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

In order to see how one chooses between the uses of the Q and XSIS pull down the Specification menu and select the “Source of Random Terms” option. The following dialog box will appear.

Figure 8-5 Source of Random Terms Dialog Box: Read In In this case the "Read In" option is selected. As indicated above this is the desired procedure when you have a set of random error terms in XSIS from a previous experiment or from someone else's experiment which you want to replicate. In this case the covariance matrix, Q, will not be used but rather it is necessary to input a XSIS matrix of random terms as has been done for this model. If, on the other hand, you want the noise terms to be generated internally in Duali, then select the "Generate Internally" item at the top of the Source of Random Terms dialog box as is shown below.

101

Page 104: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-6 Source of Random Terms Dialog Box: Monte Carlo Also, in this case, it is important to indicate which or the five types of random terms in Duali you want generated. In the case at hand this is only "Noise Terms for All Periods: System Equations" as is shown above. The reason for this dialog box is that when the Monte Carlo generator is used the corresponding covariance matrix is inverted. If you have not filled in the data for that matrix it may have defaulted to all zeroes and will be singular, thereby causing Duali to issue a warning message or perhaps even to crash. However, Duali will not try to invert the covariance matrix unless the corresponding noise terms are checked in this dialog box. So the rule is simple. Check the type of noise terms you are using in this dialog box and then be sure that the corresponding covariance matrix data has been entered and that the matrix is not singular.

102

Page 105: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Since covariance matrices are by definition non-singular the above should not be a concern. However, it can arise when you are doing experiments with a stochastic control models. Consider for example a model with three state variables and therefore three additive noise terms. One might decide to do an experiment where only one of these noise terms, say the first, was non-zero. Then the user would provide a Q matrix with a positive element on the diagonal in the (1,1) position and all of the other elements of the matrix set to zero. However, this matrix is singular and would result either in an error message from Duali or a crash of the software. So if you want to do this type of experiment then you should also set the (2,2) and (3,3) diagonal elements of Q to small positive values which are large enough to make the matrix nonsingular but small enough not to disturb the purpose of your experiment. One other procedure to use to help avoid problems from singular covariance matrices is to make a systematic check after each model transformations to review the data by selecting each of the items in the Data menu starting with Size and working your way down the menu to be sure that all of the old matrices are still accurate and any new matrices are filled in. This is particularly important when you modify the “stochastic terms” specification of the model, but also applies when you increase the size of the model by adding a state variable or some other element. While you are doing this checking it is also wise to fill in the new acronyms, since these decreases errors when revising the data in the old matrices or entering the data for the first time in the new matrices. 2. Solution Procedure In order to solve this and other stochastic models select Solve: Compare and the following dialog box will appear.

103

Page 106: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-7 Method Choice If you want to do just a CE solution select the "Certainty Equivalence, CE" check box only. However, in order to see how model comparison works, also check the HCFR box so the Handcrafted Feedback Rule solution will also be generated. Then click on the OK button. If the model you are using has been created by a transformation from a deterministic model, you may see the following dialog box.

Figure 8-8 Monte Carlo Runs At Zero Warning

This is a warning that the number of Monte Carlo runs in the Size dialog box is set to zero and therefore no solutions are generated. To correct this problem select the Data menu and the Size option and enter 1 in the edit box for the number of Monte Carlo runs.

104

Page 107: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Since the number of Monte Carlo runs is already set to one in abeladd.dui model you should not see the warning dialog box above and rather you should see the results window below.

Figure 8-9 State Variables in the Results Window for both HCFR and CE Solution Methods

This window shows the state variable paths for consumption and investment for both the HCFR and the CE solution methods. The control variables for this solution can be seen in the above window by scrolling to the right. Notice at the bottom of the window above that the particular handcrafted matrices used here produce a solution which is much worse, i.e. has a much larger criterion value at 1081, than the optimal certainty equivalence solution at 366. Recall that the criterion function is for the minimization of the square of the difference between the desired and optimal paths. When you finish close this window and return to the Duali main window. In order to get a better idea of why the HCFR solution is worse than the CE solution it is worthwhile to display the desired paths along with the optimal paths. Before doing this pull down the Preferences menu and select the Results option and then click on the “Columns” radio button. This will assure that the time periods are in the columns of the Results window that makes the numbers easier to compare.

105

Page 108: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Next pull down the Results menu and select the Display option. When you do so the following dialog box will appear.

Figure 8-10 Display Options Dialog Box

When the dialog box opens the “Desired State and Controls” box will not be checked, but check it now so that the desired paths will appear in the display. Also note that none of the “Singles” radio buttons is turned on, rather one of the “Combinations” buttons – namely the HCFR-CE combination buttons is turned on. This is what we want since we want to compare the HCFR and CE solutions, so click the OK button and the following results window will appear.

106

Page 109: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-11 Results with both Optimal and Desired Paths This window shows the paths for the consumption and investment state variables for only the first few time periods. To see the results for the remaining periods scroll to the right. Also to see the results for the control variables scroll the window down. A comparison of the HCFR and CE paths to the desired paths for first consumption and then investment shows why the criterion value is so much lower for the CE solution than for the HCFR solution. Displaying the results with the time periods as columns facilitates this kind of comparison between optimal and desired paths. While the tables of results like those shown above provide a quick and comprehensive view of the outcomes, plots provide a quicker way to visualize the results. So next close the results window, if you have not already done so, and the pull down the Results menu and select the “Plots: Single Run” option. When you do so the following dialog box will appear.

107

Page 110: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-12 Plots Options for a Single Run Since we want first to look at the plots of one of the state variables and in particular at the time paths for consumption for optimal and desired paths for the combination of HCFR and CE solution methods all the default selections above are the ones we want. Therefore click on the OK button and the plot will appear as follows.

108

Page 111: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-13 Consumption Paths for HCFR, CE and the Desired Path

For this particular Monte Carlo run the CE solution undershoots the desired path while the HCFR solution overshoots it. Also, the CE path seems, on average to be a little closer to the desired path than the HCFR solution. Click on the Continue Plotting dialog box and you will return to the Plot Options dialog box where you can elect to look at the investment paths or can switch to the control variable paths and look at the government expenditure and money supply paths. Do not try to look at the “Parameter” paths because in these solutions none of the parameters have been specified as “unknown parameters”; so moving into this section of the code at this juncture could cause a crash.

109

Page 112: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

So much for the CE solution procedure. As was discussed earlier a second solution procedure in the CE family is available in Duali. It is called CEWO – Certainty Equivalence Without – and means Certainty Equivalence without parameter updating. Consider this method next. 3. The “Certainty Equivalence Without” Method This method has been added to Duali to provide a comparison between methods that do and those that do not include updating of parameter estimates after each time period. It is best understood by solving the abel.dui model for the CEWO and the CE solutions and then comparing the results. So begin by restarting Duali and open the abel.dui file. Then use the command Solve: Compare and select both the CEWO and CE solution options as is shown in the following dialog box.

Figure 8-14 Methods Dialog Box

Then click on the OK button and the following results window will appear.

110

Page 113: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-15 Comparison of CE and CEWO

If the Monte Carlo generator in your computer is different than the one in the machine used to prepare this example, your results may differ somewhat from those shown above. If you want to compare results across machines it may be necessary to provide the same sample of random variables for the XSIS’s on both machine by printing and then copying the sample from one machine to the other machine and then using the “Specification: Source of Random Terms: Read In” option.

One would expect that the criterion value would be lower for the CE solution than for the CEWO solution; however that is not the case for this particular Monte Carlo run. Later in the chapter on Monte Carlo methods we will compare these and other methods over many Monte Carlo runs. For now close this window and select the Results: Plot: Single Run command. When the Plot options dialog box appears make the selections shown below.

111

Page 114: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-16 Plot Options Dialog Box

Select the option to plot Parameters, select the a11 parameter and then click on the radio button for Estimated in the “Show Path(s) For” group. Finally notice that the CE-CEWO combination has been selected among the methods. Then click on the OK button and the following graph will appear.

112

Page 115: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 8-17 A Parameter Plot for CE and CEWO

The true value for this parameter is 0.914 and both methods start with the same wrong estimate provide by the Monte Carlo routine of about 0.886. The CE solution includes re-estimation of the parameter after each time period and this estimate would be expected to converge to the true value after a number of time periods (though it is not doing so well in this example). In contrast, the CEWO solution does not include re-estimation after each time period and retains the same incorrect estimate across all the time periods. This is not a particularly realistic scenario since most macroeconometric models are re-estimated frequently; however, the CEWO method does provide a standard for comparison.

113

Page 116: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 9 Open Loop Feedback

Chapter 5 provided an introduction to stochastic control with uncertain parameters but without the Kalman filter by using the “Open Loop Feedback without updating” method. Chapter 8 introduced additive noise terms in the system equations. Here we combine these two elements and also introduce the Kalman filter. Thus this chapter will also include discussion of updated parameter estimates. We will begin the chapter with the simple MacRae model, viz. ch07.dui, which we used in Chapter 5 and will extend the results to include parameter estimates and the Kalman filter. Later in the chapter we will use a more complicated model, abel.dui, which includes not only additive noise terms and parameter uncertainty but also measurement error and time varying parameters.

1. Extending the MacRae Model with the Kalman Filter

Began by double clicking on the Duali icon. When the Main window opens select File:Open. In the list box double click on the same file that we used in Chapter 5 namely ch07.dui In this chapter will use the same input file as we used in Chapter 5 but instead of solving it with the Solve: OLF (w/o update) command we will use the Solve: Compare: OLF command and this will bring the Kalman filter into play. It is good idea at this point to browse through the options on the Specification and Data menus to refresh one’s memory about this model. Here we will highlight a few of these items. First consider the Specification: Stochastic Terms menu item. Clicking on this opens the dialog box below.

114

Page 117: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-1 Stochastic Terms Specification

This model has both additive noise terms and parameter uncertainty so it has the specification “Stochastic with Parameter Uncertainty”. Next pull down the Specification menu and select the Source of Random Terms item so that the dialog box shown below will appear.

115

Page 118: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-2 Source of Random Terms Dialog Box

The item in this dialog box that is of particular interest here is “Source of Random Terms”. The “Read In” option is selected because we want to replicate the results contained in Chapter 7 of Kendrick (1981) and in order to do that we need to read in the same random terms that were used in that book. To see those terms pull down the Data menu and select the Additive Noise Terms option. The dialog box shown in Fig. 9-3 will appear.

116

Page 119: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-3 Additive Noises Dialog Box Select the XSIS option and data entry window will appear as shown in Fig. 9-3.

Figure 9-4 Data Entry Window for the XSIS Matrix There is only one state variable in this model and its acronym is x. There are three time periods whose acronyms are 0, 1 and 2. However, the additive noises ξ are only

required for periods 0 and 1. The numbers 0.30 and 0.43 are taken from Section 7-3 of Kendrick (1981) and are used here to replicate the solution shown in that section. Next pull down the Solve menu and select the Compare option. This will yield the dialog box below.

117

Page 120: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-5 The Methods Dialog Box Check the OLF solution method as is shown in the dialog box above and then click on the OK and the following results window will appear.

Figure 9-6 Results for the MacRae Model with the Kalman Filter The results above replicate those for the state and control variables in Section 3 of Chapter 7 of Kendrick (1981) page 59.

118

Page 121: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Next we want to look at the parameter estimates. To use a format like that used in the table in Kendrick (1981) pull down the Preferences menu and select the Results item to obtain the following dialog box.

Figure 9-7 Preferences for Results Make three changes from the default settings here – (1) change the “Time periods as” selection from Rows to Columns, (2) check the Parameters box, and (3) change the format to show three significant figures. Then click OK and when the main window returns pull down the Results menu and select the Display option in order to obtain the following window.

119

Page 122: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-8 Display Options Notice that the Parameter item at the top is already checked. This is because we just selected this option in the previous dialog box. Also the method in use is the OLF method and that radio button is correctly checked. Then click on the OK button and the results will appear as follows.

120

Page 123: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-9 Results for the MacRae Model including Parameter Estimates Look at the bottom of the window above to see the parameter estimates. These correspond to the values of theθ parameter for the period 0|0, 1|1 and 2|2 respectively, i.e. they are the parameter estimates in each of the three time periods after the new state variables are observed and the Kalman filter is used to update the estimates. This completes our use of the MacRae model here and opens the way to begin work with the considerably more complicated Abel model that includes measurement error. 2. Measurement Error In the Stochastic Terms dialog box there are four categories. We have already considered three of these, namely, deterministic, stochastic with additive noises, stochastic with parameter uncertainty. Consider here the fourth of these categories, namely stochastic with measurement error. The term "measurement error" is used here in broad terms to cover both measurement error and time varying parameters, i.e. to represent the stochastic terms in two sets of equations that are sometimes used in optimal control models. The first of these is the "observation relationship" which provides a noisy measurement of the state variables and the second is the equations that define the motion of time varying parameters.

121

Page 124: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The first of these two equations (observation relationship) is written as kkk Hxy ζ+= (9-1)

where

)1()(

)1(

rxnoisetmeasuremenrxnmatrixknownaH

rxvectornobservatioy

===

ζ

Also the noise terms in this equation are normally distributed as ),0(~ kk RNζ (9-2)

Thus for the case where the states are observed without measurement error one can set the H matrix to the identity matrix. If the error terms are being generated internally by the Monte Carlo routine the measurement error covariance matrix R should also be set to zero and in the Specifications: Source of Error Terms menu item should be selected and the Noise Terms for All Periods: Measurement Equations should not be checked. If, on the other hand you want to include measurement error you would most likely still make the H matrix the identity matrix but would make the R matrix non-zero and would be sure to check the Noise Terms for All Periods: Measurement Equations item in the Source of Random Terms dialog box. If you wanted to use measurement errors that were read-in you should check “Read In” at the top of the Specifications: Source of Error Terms dialog box and uncheck all of the remaining items below in that dialog box. Earlier we used a deterministic version of the Abel model in file abelQLP.dui and a “stochastic with additive noises” version in file abeladd.dui. Now we turn to the version that includes additive errors, parameter uncertainty and measurement error. This version is in file abel.dui. Start Duali and open this file with “File: Open: abel.dui”. First look at the Name and Description items and then select Specification: Stochastic Terms to obtain the dialog box below.

122

Page 125: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-10 Stochastic Terms Dialog Box for the abel.dui Model Keep in mind that the categories in the dialog box are inclusive in a progressive fashion. Thus the “measurement error” specification means that additive noises and parameter uncertainty are also included. Also, time varying parameter specifications are permitted under the “measurement error” category. Next pull down the Specification menu and select the Source of Random Terms items to see the following dialog box.

123

Page 126: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-11 Source of Random Terms Dialog Box Thus in the Abel model the random terms are generated internally and all of them except the noises for the time-varying parameters (to be discussed below) are used in the model. The item “Certain But Different From Mean” will be explained in the next chapter. The data entry that corresponds to the “measurement error” specification is done via the Data: Measurement Error menu item the selection of which results in the following dialog box.

124

Page 127: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-12 Measurement Error Selection Dialog Box The inputs that correspond to the observation equation are in the upper left hand corner of the dialog box, namely the H matrix, the set of measurement noise terms ZETAS and the covariance matrix R for the measurement noise terms. If you examine these three data entries you will find that the H matrix is set to identity and that both the ZETAS and the R entry are nonzero. Thus the abel.dui model is set up to be used in either of two modes - with the measurement error terms read-in or with these terms generated internally by using the R covariance matrix. Which of these two modes is used is of course determined by the setting at the top of the Source of Random Terms dialog box. As shown in Fig. 9-10 above the current model setting is for internal generation. Thus the R matrix is used but the ZETAS are not used and have no affect on the solution.

125

Page 128: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The second of the two equations that are covered by the category of “measurement error” in Duali is the parameter evolution equation that is written as

kktkt D ηθθ +=+1 (9-3)

where

)1()(

)1(

sxvectorrandomasxsmatrixknownaD

sxvectorparameter

===

η

θ

This vectorθ was discussed first in Chapter 5 as the vector of uncertain parameters. This vector may include all of the parameters in the A and matrices and the vector or some subset of these parameters.

B c

The noise terms in Eq. (9-3) is normally distributed as ),0(~ kk N Γη (9-4)

The data input items for this equation are in the upper right-hand corner of Fig. 9-11, i.e. the D parameter evolution matrix, the ETAS (η ) noise terms for these equations and the

GAM ( ) covariance matrix for the additive noise terms for the parameter evolution equations. A notational problems needs to be discussed here. The alphabet is woefully short when one is developing mathematical models and sometime for historical reasons the similar symbol may be used to represent two different things that are not similar. In Duali the

Γ

D̂ matrices are used for the forward variable representations in the system equations and they are distinguished from the matrix in the parameter evolution equation through the use of the hat. There is no relationship between these two matrices even though the notation is similar.

D

If you examine the data inputs for the parameter evolution equations for the abel.dui model you will find that D is set to the identity matrix and that both ETAS and GAM are set to zero. The reason for this is that the true values of the parameters in the abel.dui model are treated as constant rather than as time varying. In the next chapter we will introduce the use of time varying parameters in Duali.

126

Page 129: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The initial deviations, X0DEV and TH0DEV, shown in the bottom left hand corner of Fig. 9-11 represent the deviations from mean values of the initial state vector, , and of the initial parameter vector,

0x

0θ . These values like the XSIS, ETAS and ZETAS

discussed above are used when the noise terms are read-in rather than generated internally by the Monte Carlo routines. If, on the other hand, these values are generated internally the covariance shown in the bottom right-hand corner of Fig. 9-11 are used. The first of these, namely SIXX0 - sigma-x-x-zero - ( ) is used to generate X0DEV.

The SIXX0 matrix provides an indication of the degree of uncertainty about the initial state variables. If there is no measurement error it will be zero.

xx0|0Σ

The second covariance matrix is SITT0 - sigma-theta-theta-zero - ( ). This matrix,

which was first discussed in the Chapter 5, is used to generate the initial parameter deviation, TH0DEV. The SITT0 matrix is a measure of the degree of uncertainty in the parameter vector. Also SITX0 - sigma-theta-x-zero - in the bottom right corner of Fig. 9-5 is the covariance, , between the initial state and parameter vectors. It was usually

be zero.

θθ0|0Σ

xθ0|0Σ

127

Page 130: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

3. Optimization Options and Stochastic Terms Specification The table below shows the optimization options that can be used with the various stochastic terms specification. The entries in Table 9-1 show the types of stochastic terms that are included in each model.

Stochastic Terms Specification Solution Method – use the command Solve …

Deterministic Additive Noise

Parameter Uncertainty

Measurement Error

QLP Yes Yes Yes Yes

OLF (w/o update) No No Yes Yes

Compare - HCFR No Yes Yes Yes

Compare - CEWO No Yes Yes Yes

Compare - CE No Yes Yes Yes

Compare - OLF No No Yes Yes

Compare - OLIN No No Yes Yes

Table 9-1 Optimization Options and Stochastic Terms Specification Table 9-1 is simpler than it first appears. It says that if your model has the Deterministic specification you should solve it with the command Solve: QLP. If your model has the Additive Noise specification you can solve it with QLP, Compare-HCFR, Compare-CEWO or Compare-CE. If your model has the Parameter Uncertainty specification you can use any of the solution methods and the same is true if your model has the Measurement Error specification. Of course it may not be very interesting to solve a model containing parameter uncertainty or measurement error with a deterministic method, but there may be an occasion in which that is exactly what you want to do.

128

Page 131: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

For example, one can take the abel.dui model which includes all the types of uncertainties and is therefore classified as Measurement Error and solve it with the Solve: QLP method to observe the deterministic solution. Then it can be solved with “Solve: OLF (w/o update)” to study the effects of uncertainty in the parameters but without parameter updating. Then parameter updating can be obtained by using “Solve: Compare: OLF”. Then one can compare CE and OLF solutions by using Solve: Compare and selecting both CE and OLF methods. 4. Size and Data for the Abel Model

For the model at hand, namely the abel.dui example model, pull down the Data menu and select the Size item to see the following dialog box.

Figure 9-13 Size Dialog Box for the abel.dui Model

129

Page 132: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

What is strikingly different about the Size dialog box from those for previous models in the number of uncertain parameters. Since there are two states and two controls all of the parameters in the A and matrices and the c vector are treated as uncertain. Look at this in more detail by pulling down the Data menu and selecting the Parameter Uncertainty option and then the TH0 option to see the following window.

B

Figure 9-14 Mean Values for the Uncertain Parameters, TH0

These are the mean values for the estimated parameters. To see the covariance elements close this window and then select the SITT0 option to get the window that follows.

130

Page 133: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-15 Top Segment of the Parameter Covariance Matrix, SITT0

Only the first four columns of the SITT0 matrix are shown in this figure. To see more of the matrix scroll down. Since the elements in covariance matrices vary from large to rather small it is sometime necessary to use exponential notation in inputting the data for this matrix as has been done in this case with the abel.dui model. Close this window and then click on the ITHN option to see the following window.

131

Page 134: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-16 Mapping of Uncertain Parameter Position from TH0 to System

Equation Matrices, ITHN

Recall that the ITHN matrix is used to provide a mapping from the position of the uncertain parameters in the θ vector to their position in the system equation matrices.

There are as many rows in this matrix as there are uncertain parameters in the model. Also there are three columns. The first column indicates the matrix and the second and third columns indicate the element in that matrix. For example the a12 element above has a zero in the first column to indicate the A matrix and then a (1,2) pair in the second and third column to indicate the location of that element in the A matrix. 5. Solving the Abel Model Before solving the model select the Preferences: Results option and set the format for the results to three significant digits. Solve the model by pulling down the Solve menu and

132

Page 135: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

selecting the Compare: Print option. Alternatively you could have solved the model by selecting the Compare option without the Print. However, in this section we will illustrate the print, so select that option. With either choice the Methods dialog box will appear as shown below.

Figure 9-17 Methods Dialog Box

Check only the OLF option. Later we will check two or three of the methods in order to do comparisons. The Adaptive method is also shown in the dialog box but that option is not available yet in Duali. Click on the OK button. If in the Solve menu above you selected the Compare option the results will appear as are discussed below. If you selected the Compare: Print option a dialog box will appear telling you that the next dialog box will request the name of the file to use for debugging and printing. Click OK and the Save As Dialog Box will appear. Duali employs the convention of using the extension *.dbg for the debug file, but you may prefer some other. So for the example at hand you might use the file name

abel.dbg

If you using Windows NT 3.51 or earlier you should supply the filename and the extension just as shown above; however, be careful that you do not leave a blank

133

Page 136: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

character in the first position in the dialog box as is easy to do. If you do leave a blank in the first position you will mistakenly name the file " abel.dbg" rather than "abel.dbg" and that leading blank character in the first of the two items above will make the debug file hard to find. As has been discussed above for other cases, if you are using Windows 95, Windows 98 or Windows NT 4.0 or later be careful to provide only the filename and not the extension. Thus in the "File name" window you would type abel and the system will then add the extension shown in the "Save type" window, which in the case at hand is .dbg. If you are using Windows 95, Windows 98 or Windows NT 4.0 or later and forget this by typing abel.dbg the system will still add the .dbg extension and the file will be named abel.dbg.dbg making it difficult to find later. Close the Save As Dialog Box and the Debug Print Options Property Sheet will appear as shown below. Select the Inputs tab and the property sheet will appear as follows:

134

Page 137: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-18 Debug Print Options for OLF Dialog Box

Figure 9-18 shows the Inputs page of the property sheet. Only the system equations and criterion elements of the model input are selected for the sake of simplicity. You may want to experiment with other selections. Next select the Intermediates property page of the Debug Print property sheet so that it appears as is shown below.

135

Page 138: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-19 Intermediate Property Page of the Debug Print Property Sheet

In stochastic control problems with the Kalman filter the original state vector, , is augmented with the parameter vector,

xθ . In each time period this augmented state

vector is projected forward based on the previous values, the selection of the control variables and the effects of the additive noise terms. The box labeled "Projection k+1/k" enables printing of the calculations that are used to make the projections from period k for the values in period k+1 of the original state vector and the parameter vector x θ .

The user can elect to print these results for either the mean of the vectors, the covariances or both. Also notice that one may select the final results and/or the intermediate results. For most purposes - as above - the final results will suffice.

136

Page 139: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The box in the lower right corner labeled "Kalman Filter k+1/k+1" can be used to enable printing for the update estimates for andx θ in period k+1 made with data through

period k+1. These estimates are made after the augmented state is observed in period k+1 and the Kalman filter is used to make new estimates of the means and covariances of the and x θ vectors.

Next select the Results tab of the property sheet. The property page shown below will appear.

Figure 9-20 Results Property Page of the Debug Print Property Sheet

With the settings shown, the estimated values of the uncertain parameters as well as the states and controls and the criterion value will be written to disk so that they can be printed.

137

Page 140: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Click on OK in order to close the Debug Print property sheet, then after a brief wait the results will appear as shown below.

Figure 9-21 Results for the OLF Problem with Monte Carlo and the Kalman Filter

These results reflect the effects of the additive noises and the parameter uncertainty as well as the Kalman filter updating of the parameter estimates. In order to see the parameter estimate, close the window above. Then select the Preference: Results option and the following dialog box will appear.

138

Page 141: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-22 Preferences for Results Dialog Box

Select the Columns, Parameters and three significant digits format option as shown above and the click on the OK button. Next pull down the Results menu and select the Display option. Be sure that the OLF radio button is selected. Then click on the OK button and the following results window will appear once you scroll down somewhat in the window.

139

Page 142: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-23 Uncertain Parameter Estimates For the First Few Time Periods

The parameters estimates change from one period to the next as the Kalman filter is used to update these estimates after each new observation of the state vector. Only the values for the first few time periods are shown above so scroll to the right to see the rest of the values as shown in the window below.

140

Page 143: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-24 Uncertain Parameter Estimates for the Last Few Time Periods and the True Values

In the display above the true values of the parameter are shown in the rightmost column. This permits the user to compare the estimated value of the parameter in the last period with the true value. Some of the parameter estimates are converging nicely while others are not doing so well. Recall that the Monte Carlo routines create samples of estimates of the uncertain parameters for the initial period in each Monte Carlo run using the means and covariance matrix of the parameter estimates. Thus in each Monte Carlo run the parameters estimates begin in the neighborhood of the true values, but not at the true values. Then in each time period after the new state variables are observed the parameter estimates are updated with the Kalman - filter resulting in tables of numbers like those shown above. It is also useful to look at this kind of results from the model using the plots. To do this return to the Duali main window and then select Results: Plot: Single Run and the following dialog box will appear.

141

Page 144: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-25 Options to Plot Uncertain Parameters

Select the Parameters radio button at the top of the dialog box and then a list of the parameters will appear in the Variable Selection box. Also select the “Est and True” radio button in the Parameters column of the “Show Path(s) For” group. Then click on the OK button and the following plot will appear. A common problem here is that the user forgets to select “Est and True” or one of the other radio buttons in on the Parameters side of the “Show Path(s) For” group. If later on you are plotting parameters and get confusing results, the first thing to check is to be sure that one of the radio button under the Parameters heading is checked rather than one of the radio buttons under the Variables heading.

142

Page 145: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-26 Plot of the a11 Uncertain Parameter Estimated and True Values

In this particular Monte Carlo run the a11 parameter estimates begins at 0.925 that is substantially above the true value at 0.914, converges to the true values but then overshoots somewhat. You can return to the Plot Options dialog box and select other parameters to plot. When you are finished with this, select Exit in Plot Options dialog box and return to the Duali main window. You may recall that when we solved the abel.dui model we used the command “Solve: Compare: Print” rather than the command “Solve: Compare”. Then we selected a number of input, intermediate and final results from the calculations that we wanted to have printed on the abel.dbg file. We turn next to an examination of this file.

143

Page 146: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

6. Examining the Debug Print File

First be sure that you have exited from Duali so that the debug file is closed and can be accessed by an editor. Then use any editor, viz. Microsoft Word, to open the abel.dbg file or the file with the name you selected in the Save As dialog box. The top of this file will look something like the following if you elected to print the system equation matrices like A and B and the criterion matrices like W and WN.

144

Page 147: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Debug File for OLF Abel Model from Kendrick (1982) JEDC abel State Variables, n 2 Control Variables, m 2 Exogenous Variables, l 1 Observation Variables, ny 2 Uncertain Parameters, np 10 Time Periods, nt 7 Maximum Forward Variable Lead 0 Iteration Limit 0 Monte Carlo Runs, nmc 1 a 0.914 -0.016 0.097 0.424 b 0.305 0.424 -0.101 1.459 capc -59.437 -184.766 zs 1.000 1.000 1.000 1.000 1.000 zs 1.000 1.000

The “a” and “b” are the A and B matrices from the system equations and the capc is the C matrix from the same set of equations. The "zs" are the exogenous variables, z, for all time periods. cs -59.437 -59.437 -59.437 -59.437 -59.437 -184.766 -184.766 -184.766 -184.766 -184.766 cs -59.437 -59.437 -184.766 -184.766 w 0.063 1.000 wn 6.250 100.000 lam

145

Page 148: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

1.000 0.444

The cs are the values of the c vector in all time periods after the Cz calculation is done. The w and wn are the W and WN matrices from the criterion function and the lam is the LAMBDA matrix. Also a sample of the results from the Kalman filter is shown below. These are results for the covariance matrices and mean values of the states and parameters after the optimal controls have been computed and applied in the zero time period and the state variables have been observed and used in the Kalman filter to update the estimates. sixxk1k1 in Sigk1k1 1.935 0.696 0.696 2.186

The (sixxk1k1) is nonzero because there is measurement error in the model. xxkk 1|1 ++Σ

Compare this to the initial SIXX0 matrix that is 2.710 1.120 1.120 2.780 and you will see that the uncertainty associated with the state variables has decreased relative to the values in period zero. Next consider the (sitxhik1) matrix. x

kkθ

1|1 ++Σ sitxk1k1 in Sigk1k1 0.010 0.004 -0.007 -0.003 -0.021 -0.009 0.018 0.008 -3.024 -1.231 0.004 0.008 -0.003 -0.001 -0.009 -0.016 0.008 0.011 -1.194 -2.277

It is also nonzero because there is measurement error in the model. Then consider the (sittk1k1) matrix that is the covariance of the parameters. θθ

1|1 ++Σ kk

146

Page 149: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

sittk1k1 in Sigk1k1 0.002 -0.003 -0.005 0.003 -0.312 -0.003 0.007 0.007 -0.009 1.018 -0.005 0.007 0.017 -0.008 0.720 0.003 -0.009 -0.008 0.030 -3.721 -0.312 1.018 0.720 -3.721 481.623 0.000 -0.000 -0.000 0.000 -0.022 -0.000 0.000 0.000 -0.000 0.029 -0.000 0.000 0.000 -0.000 0.052 0.000 -0.000 -0.000 0.000 -0.054 -0.021 0.032 0.052 -0.056 7.041 sittk1k1 in Sigk1k1 0.000 -0.000 -0.000 0.000 -0.021 -0.000 0.000 0.000 -0.000 0.032 -0.000 0.000 0.000 -0.000 0.052 0.000 -0.000 -0.000 0.000 -0.056 -0.022 0.029 0.052 -0.054 7.041 0.004 -0.006 -0.012 0.007 -0.643 -0.006 0.015 0.015 -0.020 2.226 -0.012 0.015 0.036 -0.017 1.449 0.007 -0.020 -0.017 0.067 -8.349 -0.643 2.226 1.449 -8.349 1085.717

The (sittk1k1) is a ten by ten matrix because there are ten uncertain parameters in

the model. This matrix is printed in two segments with the last five columns being in the lower segment. You can compare these values to those of the original SITT0 matrix. For example the item 481.623 in the fifth row and column above is the variance for the c1 element. In the original SITT0 matrix this value was 545.00. So across the first time period the uncertainty associated with this parameter was decreased substantially.

θθ1|1 ++Σ kk

The last two items shown below are (xhk1k1) and (thk1k1). 1|1ˆ ++ kkx 1|1

ˆ++ kkθ

xhk1k1 in Sigk1k1 392.082 91.408 thk1k1 in Sigk1k1 0.890 -0.017 0.346 0.668 -90.030 0.108 0.274 -0.145 1.534 -182.806

147

Page 150: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The estimated value of the state will be different from the observed value because there is measurement error. The updated values of the uncertain parameter have changed because of the Kalman filter estimation procedure discussed above. If you selected “state and controls – final” in the Debug Print Options for OLF property sheet, the results for the state and controls will appear at or near the bottom of the abel.dbg file. They are shown below. xs in CompareOlf 387.900 389.997 395.220 395.022 399.091 85.300 93.338 92.359 90.826 93.009 xs in CompareOlf 402.337 402.551 405.264 95.089 93.088 88.288 us in CompareOlf 112.394 114.635 115.608 116.685 117.413 145.826 145.057 145.101 146.097 145.795 us in CompareOlf 117.363 120.181 144.768 144.198 So far in this chapter we have been discussing models that do not have forward variables. Next we consider models with forward variables.

7. Models with Forward Variables The treatment of models with forward variables in Duali has already been discussed for QLP and OLF w/o models in previous chapters. Here we discuss the particular aspects of forward variables in the context of the Solve: Compare command. We use the model from Amman and Kendrick (1999a) that was used with OLF w/o models and that is in file akforwst.dui. Restart Duali and open this file. Pull down the Data menu and select the Size option so that the following dialog box appears.

148

Page 151: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-27 Size Dialog Box

Consider the two edit boxes in the middle and on the right just below the “Add for Forward Variables -----“ line. The Iteration Limit is set at 6 and the Convergence Tolerance is set at 0.001. With these settings the model solution procedure will converge. However, we want to discuss a situation where convergence does not occur, so change the Iteration Limit from 6 to 4 as is shown above. Also we want to use multiple Monte Carlo runs, so change the Monte Carlo Runs edit box from 1 to 2. Then click on the OK button. Next select Solve: Compare and then check the CE and OLF options and click on the OK button. The following warning will appear.

149

Page 152: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-28 Warning That Convergence Has Not Been Achieved

When parameter updating is used in model solutions with forward variables the check for convergence is not done for all time periods at one time. Rather the check is done in each time period for the remaining time periods just before the parameter estimates are updated. Thus convergence may fail at one time period or in a number of different time periods. Also, since multiple methods are frequently used with the Solve: Compare command, the convergence failure may occur in the solution procedure for one or more of these methods. Finally, the convergence problem or problems may have occurred in some but not all of the Monte Carlo runs. The warning above, which is issued after all the Monte Carlo runs are completed, does not tell the user exactly where the convergence problem occurred. Rather it is an indication that further work is needed to track down the location of the problem by using the command Solve: Compare Print and then examining the debug file. The command Solve: Compare Print should however, not be given immediately. Rather the user should exit from Duali and then restart the program. The reason for this is to assure that the Monte Carlo generator starts from the same seed in the subsequent solution as it did in the solution described above. So after starting Duali again, open the akforwst.dui file and use the Data: Size command to access and change the Iteration Limit from 6 to 4 and the number of Monte Carlo runs from 1 to 2, just as was done in the solution above. Then use the Preference: Results command to change the output format to four significant digits. Next use the Solve: Compare Print command and check the CE and OLF methods as was done above. Name the debug file akforwst.dbg. Then the Debug Print Options property sheet will appear. Select the Intermediates tab and the property page below will appear.

150

Page 153: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-29 Intermediate Property Page

In the Forward Variable Iterations group on the top right of the property page check the “Each Iteration” item. This output will enable the user to track the progress of the forward variable iterations in the Fair-Taylor procedure. Then select the “Results” tab and on that property page check the box for the final results for states and controls and the final results for the criterion function. Then click on the OK for the property sheet. The non-convergence warning will appear in a dialog box just as it did in the Solve: Compare solution that was done above. Close this and also close the two dialog boxes that follow on the method count and the average criterion value. Then exit from Duali.

151

Page 154: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Next put the akforwst.dbg file in an editor. The top of the file will appear as follows.

Debug File for OLF Amman/Kendrick with Forw Var - stochastic akforwst State Variables, n 1 Control Variables, m 1 Exogenous Variables, l 1 Observation Variables, ny 1 Uncertain Parameters, np 1 Time Periods, nt 4 Maximum Forward Variable Lead 2 Iteration Limit 4 Monte Carlo Runs, nmc 2

This output permits the user to be sure that the Iteration Limit is set to 4 and the number of Monte Carlo runs is set to 2. Then scroll down in the file until you find the line

CompareCe - major time loop k = 0 CompareCe - forward variable loop iter = 1

These two lines are from the time period counter and the iteration counter in the forward variable loop – both in the CompareCe subroutine that is used for the CE method. Then continue to scroll down in the file, while watching the epsCurrent statement like those shown below.

epsCurrent in CheckConvergence 66.2829 epsCurrent in CheckConvergence 0.5080

The variable “epsCurrent” is the current value of epsilon, which is the sum of squares of the difference between the current control paths and the control paths from the previous iteration – for all future time periods. The rapid decrease in epsCurrent from iteration two at 66.2829 to 0.5080 at iteration three is good news – the solution is converging quickly. Then scroll down further until you find the following lines.

152

Page 155: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

CompareCe - forward variable loop iter = 4 CheckConvergence - iter = 4 epsCurrent in CheckConvergence 0.0092

Warning! Reached iteration limit before reaching convergence tolerance in CheckConvergence with method CE at time period 0 in Monte Carlo run 1

Now we are looking at the CE method, at the check of convergence at iteration 4 and can see that epsCurrent is down to 0.0092. This is close to, but not yet down to, the Convergence Tolerance that is 0.0010. Thus the Iteration Limit of 4 has been reached, but the Convergence Tolerance has not been reached; therefore, the code issued the warning shown above informing the user that the forward variable iteration process in time period 0 of Monte Carlo run 1 failed to converge. Thus by tracking through these results the user can see that raising the Iteration Limit from 4 to say 10 will most like be sufficient to guarantee convergence for time period 0 and Monte Carlo run 1. To proceed, use the Find command in the editor to search for the next occurrence of “Warning” which will be in a section that looks like the following.

CompareOlf - forward variable loop iter = 4 CheckConvergence - iter = 4 epsCurrent in CheckConvergence 0.0198 Warning! Reached iteration limit before reaching convergence tolerance in CheckConvergence with method OLF at time period 0 in Monte Carlo run 1

At first glance this appears to be the same as the first Warning message; however closer examination shows the first line comes from subroutine “CompareOlf”. Thus this time the problem is in the OLF method. The first problem above was at time period 0 in Monte Carlo run 1 for the CE solution. So that fact that we have now reached time period 0 in the OLF solution tells us that we achieved convergence in time periods 1, 2 and 3 in the CE method – see the “major time loop” statements. Also, the number 0.0198 above for “epsCurrent” tells us that we are not as close to the Convergence Toleration of

153

Page 156: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

0.0010 as we were in the CE method above at 0.0092. However, further examination of the results back up in the file shows that the solution is converging nicely and that the change in the iteration limit from 4 to 10 suggested above for the CE method will probably also take care of this case. Scroll down further in the file and you will find the following statements.

Warning! Reached iteration limit before reaching convergence tolerance in CheckConvergence with method CE at time period 0 in Monte Carlo run 2 Warning! Reached iteration limit before reaching convergence tolerance in CheckConvergence with method OLF at time period 0 in Monte Carlo run 2

These two warning messages both come from the second Monte Carlo run; however they do not appear in the context of other output. The reason for this is that the print of other items is turned off after the first Monte Carlo run in order to prevent the output from becoming too voluminous. However, these messages indicate that the convergence problem in the second Monte Carlo run is restricted to time period 0 in both the CE and the OLF method. Thus, as in the first Monte Carlo run convergence is occurring in time periods 1, 2 and 3 with both methods and a slight increase in the Iteration Limit in the Size dialog box will take care of the problem. At times the user may want to see detailed print output for a Monte Carlo run other than the first run in order to track down a non-convergence problem or for some other purpose. This can be accomplished by using Solve: Compare Print and then going to the Summary tab in the Debug Print Options property sheet as is shown below.

154

Page 157: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 9-30 Summary Property Page in the Debug Print Option Property Sheet

Click on the “Only run number y” check box and fill in the edit box with the number of the Monte Carlo run where you want the print turned on. Then go to the other tabs in the property page and make the same selections as were suggested above. After you solve the model and put the debug file “akforwst.dbg” in the editor you will find that most of the print statements now correspond to the second rather than to the first Monte Carlo run. So far in this chapter we have discussed an example model which was already available on a *.dui file. There are a number of other stochastic control models with parameter uncertainty that can be loaded and examined by using the File:Examples menu. Or you may prefer to create a new model using the File:New option and type in the elements of the model. However, if the model is one that has already been developed and solved on the mainframe software, Dual, or the personal computer software, Dualpc, the user may

155

Page 158: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

prefer to use the importation capability described below. This will permit you to take advantage of the graphical interface of Duali as well as the substantial control over debugging output. Unless you intend to import Dual or Dualpc files, please skip to the next chapter. 8. Importing Data via the Input Files for Dual and Dualpc Models that have already been solved with the Dualpc software (or its mainframe predecessor, Dual) can be imported to Duali by using the File: Import Dual option. Also, some users may prefer to use a spreadsheet like Excel to create the various matrices that are used in the input file. This is particularly convenient for matrices like those for the desired paths that may require extrapolations to create. The matrices for the model can then be imported directly with the File: Import Matrices option or assembled with an editor into the required Dualpc format and imported to Duali via the File: Import Dual option. Alternatively one may want to consider the use of File:Import QLP. The advantage of the QLP format is that matrices are read in as blocks. In contrast, the Dual format is to be preferred when one has sparse matrices because in this format it is only necessary to enter the non-zero entries in each matrix. The File: Import Dual option should be selected immediately after opening the Duali application. When this is done a dialog box will open in which the user can provide the name of the input file. For example, the Dual input file for Elizabeth Chase MacRae’s model that is used in Ch. 7 of Kendrick (1981) is contained in the file "chap7.dua". The extension “dua” has been used for the Dualpc input files, but the user may prefer another extension. After the input is selected and the dialog box is closed, a notice will appear informing the user that the next dialog box will permit the selection of the file on which the input can be echo printed so that it can be checked. The “dbg” extension has been for these files. Thus for the Chapter 7 model one might name the file chap7ech.dbg. Be careful here not to name the echo print debug file the same as the input file since this will result in overwriting the input file. A message box will appear to indicate when the importation is complete. It is useful to check the echo print debug file such as the chap7ech.dbg file to be sure that the

156

Page 159: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

importation proceeded as desired. This file contains an echo print of the list of nonzero elements in each matrix. It also contains a full matrix print of each matrix. This provides another level of checking for the user to be sure that the matrix entries have been entered and read properly. If the importation fails, check the input file to be sure that there are no tabs. This can be done by reading the input file into an editor and turning on the display of paragraph symbols and tabs. Since the importation code does not employ a fixed format like F5.2 but rather uses white space to separate elements, it may read a tab as an element. Also, check to be sure that the input file uses the model structural options that are specified by the asterisks in the Options QLP dialog box. If neither of these is the source of the problem try to export one of the existing *.dui files from Duali with the command File:Export Dual. Then see if you can re-import this file. If this works, then compare the file format and structure of the exported file to your own file to see if you can track down what is causing the error. Also, make use of the debug file as discussed above. This file may help you to locate the place at which the error is occurring during the importation. Once the data has been read, it can be checked by selecting the various options under the Data menu. There will not be a model name, but the model size parameters should be correct. Also, the Functional Forms and the Stochastic Terms should be correct. Acronyms will be assigned default values, i.e. numbers rather than names. The system equations and criterion function data matrices will be available. Once the data has been read, one can move immediately to solve the model by selecting the Solve: Compare option or the Solve: Compare Print option. The Solve: Compare Print option is preferred at this stage because it permits the user to obtain the desired level of intermediate output. Also, the format preferences for results as discussed above can be used to obtain both the printed and the displayed output in the desired format. Once the model has been imported, it can be save the File:Save As option. Then the user can proceed to modify the model by adding a model name, acronyms, etc. and treating the model like one that had been manually entered into Duali.

157

Page 160: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 10 Open Loop Feedback with Insight –

Policy to Parameter Effects

Robert Lucas of the University of Chicago has argued in Lucas (1976) that under certain circumstances changes in policies may cause changes in behavior of economics agents that would be reflected as changes in the behavioral parameters of econometric models. This provides one of the bases for his critique of the use of optimal control methods for determining macroeconomic policies. In a recent paper Amman and Kendrick (1999b) have argued that this critique can be mitigated through the use of the Kalman filter to update the parameter estimate of the model each time period. In that paper three methods for solving stochastic control models are compared. The first two are Certainty Equivalence without Updating (CEWO) that was introduced in Chapter 8 and Open Loop Feedback (OLF) that was discussed in Chapter 9. In this chapter we provide a description of the third method that is called “Open Loop Feedback with Insight” (OLIN). The OLIN method is used in models which include the “policy-to-parameter” effect discussed above, i.e. a specification which provides a relationship between changes in policy variables and changes in behavioral parameters. In order to do this, the model needs to include time-varying values of the true parameter. In the previous chapters we have discussed several methods in which the parameter “estimates” have changed from period to period, but in which the true value of the parameter remained constant. In this chapter we will introduce time-varying true parameter values in order to represent the “policy-to-parameter” effect. Against this background the “Open Loop Feedback with Insight” method is the same as the “Open Loop Feedback” method except that policy makers are assumed to have insight as to the exact effect of policy changes on the behavioral parameters of the model. This is not a realistic assumption but it provides a standard against which more realistic methods can be compared.

158

Page 161: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

One subtlety is important here. In the Amman and Kendrick paper cited above the true value of the parameters are assumed to change over time following a random walk with an additive noise as well as because of the policy-to-parameter affect. The “with insight” phrase does not mean that the policy makers are assumed to know the true values of the parameters, rather only that they know the portion of the movement of each parameter in each time period which can be attributed to the effect on policy changes on parameters. This may seem a little confusing at first, but the mathematical statement below will help to clarify the ideas. 1. Mathematics There are two aspects of the mathematics of the policy-to-parameter effect and the OLIN method. The first of these is the evolution of the true value of the parameters and the second is the updating of the parameter estimates each time period. Consider first the evolution of the true parameters. This is specified in Duali with the following equations:

kk Np µ= (10-1)

where an np element vector in which the ith element is the percent =kp ikp

change in the ith parameter at period k due to the policy-to- parameter effect

an np x m matrix with elements that are the number of =N ijn

percentage points change in the ith parameter per percentage point change in the jth control variable

=kµ an m element vector whose jth element at time k is

1,

1,

−−=

kj

kjjkjk u

uuµ

where jku is the value of the jth control variable in period k.

159

Page 162: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The elements from the vectors in Eq. (10-1) are placed as diagonal elements in matrices and used in the following parameter evolution equation that is a modification

of Eq. (9-3).

ikp

kP

kkkkk PD ηθθθ ++=+1 (10-2)

where

= a known matrix D = an np x np diagonal matrix with diagonal elements that kP ikp

are the percentage change in parameter i at period k due to the policy-to-parameter effect. kη = an np element vector of additive stochastic terms for the parameter

evolution equations, this random variable is distributed ( )kN Γ,0

The mathematics for parameter estimation updating in the OLIN method is somewhat more complicated. We begin with the updating relationships from Kendrick (1981), Appendix N and add an “insight” term that is the policy-to-parameter effect. This provides the equation that is used in Duali. Then we relate this to the updating equation used in the Amman and Kendrick paper by adopting the parameter values used in the case where there is no measurement error. So we begin with the parameter updating equation used in Kendrick (1981) Appendix N, Eq. (N-8) is ( )kkkkkk

xkkkkkk xHySH |111

111|1|11|1 ˆˆˆ

+++−++++++ −′Σ+= θθθ (10-3)

where the estimates of the means of the parameters in period =++ 1|1

ˆkkθ 1+k

using data through period 1+k the projection of the means of the parameters in period =+ kk |1θ̂ 1+k

using data through period k the projection of the covariance of the parameter vector =Σ +

xkk

θ|1

θ and the state vector x in period 1+k using data through period k

the measurement matrix from Eq. (9-1) in this guide =+1kH

160

Page 163: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

from Kendrick(1981) Eq. (N-6) kk

xxkkkk RHHS +′Σ= ++++ 1|111

the projection of the covariance of the state vector x in period =Σ +

xxkk |1

1+k using data through period k the covariance for the additive noise term in the measurement =kR

relationship – from Eq. (9-2) in this guide the observation vector from Eq. (9-1) in this guide =ky

the projected value of the state vector in period using =+ kkx |1ˆ 1+k

data through period k The Amman and Kendrick (1999b) paper uses Eq. (10-3) with two modifications. First the kkP θ term from Eq. (10-2) is added to provide the “insight” which is referred to in the

name of the method – Open Loop Feedback with Insight (OLIN). Then Eq. (10-3) becomes ( ) kkkkkkkk

xkkkkkk PxHySH θθθ θ +−′Σ+= +++

−++++++ |111111|1|11|1 ˆˆˆ (10-4)

Thus the policy maker modeled by OLIN behaves the same as the policy maker in OLF in that he or she must update parameter estimates in a noisy environment. However the policy maker in OLIN knows the part of the parameter movement that can be attributed to the policy-to-parameter effect. Thus Eq. (10-4) is the updating relationship that is used in the Duali code for the OLIN method. One can argue about whether or not it is better in Eq. (10-4) to use

kkP θ (10-5)

or (10-6) kkkP |1

ˆ+θ

The second of these is based on the argument that the policy makers who have insight know the mathematical rule for the policy-to-parameter effect but at time period they do not know the true value of the parameter as the rest of Eq. (10-4) indicates. The first of these is based on the argument that for the purpose of calculating the policy-to-parameter effect the policy makers’ insight includes not only the mathematical rule but

k

161

Page 164: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

also sees through to the true value of the parameter when computing that effect. It is the first of these two approaches that is used in the Amman and Kendrick (1999b) paper. Of course, the second expression above is closer to reality but the purpose of setting up the OLIN method is to provide a standard for comparison and not necessarily a realistic option. Next consider the relationship of Eq. (10-4) to the equivalent relationship used in the Amman and Kendrick paper. The expression used in the Amman and Kendrick paper is slightly different than the Eq. (10-4) above because of the assumption in that paper that there is no measurement error. This means that it is assumed that the H matrix is identity and there is no measurement noise so that (10-7) 11 ++ = kk xy

With these two changes Eq. (10-4) becomes ( ) kkkkkk

xkkkkkk PxxS θθθ θ +−Σ+= ++

−+++++ |1111|1|11|1 ˆˆˆ (10-8)

Also from Eq. (N-6) in Kendrick (1981) (10-9) kk

xxkkkk RHHS +′Σ= ++++ 1|111

So when the H matrix is identity and the R matrix is zero – as in the case of no measurement error Eq. (10-9) becomes (10-10) xx

kkkS |11 ++ Σ=

and the use of Eq. (10-10) in Eq. (10-8) yields ( ) ( )1

1| 1 1| 1| 1| 1 1|ˆ ˆ ˆx xxk k k k k k k k k k k k kx x Pθθ θ θ

+ + + + + + += + Σ Σ − + (10-11)

which - with the changes in the kkP θ term for the decreased generality of the version of

the equation in the paper - is the same as the Eq. (51) in the Amman and Kendrick paper.

162

Page 165: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

2. An Example Model The islmtvme.dui model (IS-LM time-varying measurement error model) is the Duali analog of the model used in the Amman and Kendrick paper. Start Duali and open this file. Use the Specification: Stochastic Terms command and the following dialog box will appear.

Figure 10-1 Stochastic Terms Dialog Box

The stochastic terms specification of “Stochastic with Measurement Error” is used in this model. Actually, measurement error is not used in this model; however, time varying parameters are an important part of this model and the specification “Stochastic with Measurement Error” includes time varying parameters. Next use the command Specification: Functional Forms to get the following dialog box.

163

Page 166: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-2 Functional Forms Dialog Box for the islmtvme.dui Model The first unusual aspect of the functional forms specification for this model is indicated in the Forward Variables group on the right hand side of the dialog box where the Yes radio button has been selected. We will return to this aspect of the specification shortly but first consider the other unusual element in the functional forms specification. The second unusual element in this dialog box is near the bottom right hand corner in the group labeled “Policy to Parameter”. This attribute is “No” in almost all of the sample models in Duali but is “Yes” for this model. Thus the specifications for this model include an N matrix of the type described above in Eq. (10-1). To see that equation use the command Data: Policy To Parameter Effect and then click on the radio button for the N matrix to observe the following window.

164

Page 167: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-3 Policy-to-Parameter Effect Matrix N Recall from Eq. (10-1) above how the matrix N is used in the model, i.e.

kk Np µ= (10-12)

where an np element vector in which the ith element is the percent =kp ikp

change in the ith parameter at period k due to the policy-to- parameter effect

an np x m matrix with elements that are the number of =N ijn

percentage points change in the ith parameter per percentage point change in the jth control variable

=kµ an m element vector whose jth element at time k is

1,

1,

−−=

kj

kjjkjk u

uuµ

where jku is the value of the jth control variable in period k.

Thus the specification in Fig. 10-3 indicates that changes in government expenditure have no effect on either parameter in the islmtvme.dui model. However, a one percent increase in the money supply causes a one percent increase in the first uncertain parameter (b21), i.e. money in the inflation equation. Also, a one percent increase in the money supply causes a one percent decrease of the second parameter (b22), i.e. money in the output equation.

165

Page 168: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

We have “the horse before the cart” here a little by discussing particulars of the model specification before indicating its size and more general specification. Use the command Data: Size to obtain the following dialog box.

Figure 10-4 Size Dialog Box for the islmtvme.dui Model The forward variables section of this dialog box indicates that the maximum lead is a single period so we know from an equation like Eq. (2-7) i.e.

(10-13) e

kke

kke

kkkkkk xDxDxDCzBuAxx |33|22|111 ++++ +++++=

that the matrix will be nonzero and the and matrices will be zero. Also the

iteration limit has been set to 20 and the convergence tolerance to 0.001. This means 1D̂ 2D̂ 3D̂

166

Page 169: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

that if the sum of squares of the difference between the control variables in the previous iteration and the current iteration is not less than 0.001 by the time that twenty iterations have been performed that the iterations should halt. As was discussed in the previous chapter, this will cause a warning message to be issued after the model solution is completed indicating that there was a lack of convergence in at least one time period. Then the debug print can be used to track down the time period or periods in which the solution did not converge. Next use the Data: Acronyms command to show the acronyms window below.

Figure 10-5 Acronyms Window The two state variables are inflation and unemployment and the two control variables are government expenditures and the money supply. Also, scroll down further in this window and you will see that the two uncertain parameters in this model are the b12 and

167

Page 170: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

the b22 coefficients, i.e. coefficients in the first and second equations (inflation and unemployment) which are multiplied by the second state variable (the money supply). Next use the Data: System Equations to look at the data in these matrices. This command yields the dialog box shown below.

Figure 10-6 Systems Equations Choice Dialog Box Since the maximum lead specified in the Size dialog box is one, only the D1 matrix appears in the list. Click on the radio button for D1 to see the following window.

Figure 10-7 The D1 Forward Variable Matrix

168

Page 171: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

From this D1 matrix one can see that expected inflation plays a role in the model but that expected output does not. If you later wanted to experiment with this model you might change the coefficients in the second column and you would be off and running. For now leave those coefficients as they are. Next look at an unusual aspect of the specification of the uncertain parameters in the model. Begin by using the Data: Parameter Uncertainty command to see the following dialog box.

Figure 10-8 Uncertain Parameters Choice Dialog Box The unusual aspect of this model is that we are going to make use of the Advanced Specification at the bottom of this dialog box. However, first click on the TH0 radio button at the top of the dialog box to see the following window.

169

Page 172: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-9 Mean Values of the Parameters in the Theta Vector

These are the true values of the uncertain parameter in the initial time period. Then return to the Uncertain Parameters Choice dialog box and this time click on the TH0DIFF radio button to see the following window.

Figure 10-10 Initial Thetas Which are Certain but Different from the Mean The true value of the b12 parameter is 0.0004 and the policy maker is correct about this value. In contrast, the initial value of the b22 parameter is 0.2083 but the policy maker incorrectly assumes at the start of each Monte Carlo run that the parameter value is 0.300.

170

Page 173: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This assumption is different from the usual assumption made in stochastic control models. In those models the Monte Carlo subroutines are used at the beginning of each run along with SITT0 matrix to generate the value of the parameter that the policy maker thinks is the correct value – but this value will differ from the true value. So in the usual models the policy maker begins the Monte Carlo runs with incorrect estimates of the parameters and these are different in each Monte Carlo run. In contrast, in this model the policy maker begin each Monte Carlo run with the same incorrect estimates of the parameter values. The window in Figure 10-10 above permits the user to enter the incorrect values. Next look at the parameters that are used to specify the time varying parameters in this model. To see them use the Data: Measurement Error Terms command to get the following dialog box.

Figure 10-11 Measurement Error Terms Choice Dialog Box

171

Page 174: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The upper right hand corner of this dialog box contains the matrices that are used to specify the time varying parameter relationships. Keeping in mind that the D matrix used here is not related to the D1, D2 and D3 matrices used for forward variables, click on the radio button for the D matrix to see the following window.

Figure 10-12 Time Varying Parameter Matrix, D Recall from Eq.(10-2) that the parameter evolution in the OLIN case is governed by the equation

kkkkk PD ηθθθ ++=+1 (10-14)

So from Fig. 10-12 the D matrix in this relationship is an identity matrix. Also we discussed earlier in the chapter how the N matrix is used to compute the diagonal elements of the P matrix in Eq. (10-14). As with all the other stochastic terms used in Duali one has a choice. The user can enter a sample from a previous Monte Carlo run in the ETAS (η ) and use the “Read In”

specification in the Specification: Source of Random Terms dialog box. Alternatively the user can enter the data from the GAM (Γ ) matrix and use the “Generate internally” specification in the Specification: Source of Random Terms dialog box. The current model uses the latter alternative so the ETAS will all be zeroes and the GAM matrix will be nonzero as is shown below.

172

Page 175: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-13 The GAM (Γ ) Matrix for Time Varying Parameters From this matrix one can see that the b22 parameters will be varying more than the b12 parameters under the influence of the additive term in the parameter evolution equations. This model has a rather primitive treatment of time varying parameters. For a more sophisticated treatment of time varying parameters in stochastic control models including a modification of the DUAL software to accommodate this treatment see Tucci (1989). Two recent studies using that software are Tucci (1997) and (1998). In summary, the islmtvme.dui model works in the following way. The user chooses a set of initial parameter values that are different from the mean and inputs these to TH0DIFF. Thus each Monte Carlo run is begun with these same incorrect parameter estimates. Then the optimal controls are computed for period zero using the Open Loop Feedback method. Recall that this method uses the covariance matrix of the parameters, SITT0, to take account of the uncertainty in the unknown parameters. Also, because there are forward variables in the model this solution method is used in the iterative fashion proposed by Fair and Taylor until the solution converges. The optimal control is then applied in the system equations along with an additive noise term generated by the Monte Carlo routines using the covariance of the additive noise terms, Q. This process yields values for the state variables in the next time period. Also the control variables are applied to parameter evolution equations with the policy-to-

173

Page 176: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

parameter effect using the matrix N that is supplied by the user. This yields the true values of the parameters for the next time period. If there is measurement noise in the model – and there is not in the islmtvme.dui model – that noise is added to the state variable and the H matrix is used in order to compute the value of the observation variables. The observation variables are then used in the Kalman filter to obtain updated estimates of the means and covariances of the states and the unknown parameters. However, the Kalman filter is modified in the OLIN method to make use of “insight” which means that it is assumed that the policy maker knows perfectly the effect of policy changes on the parameter changes. At the same time it is not assumed that the policy maker can predict the additive noise terms in the parameter evolution equations. Thus the parameter estimates which evolve from the this process with the OLIN solution methods would be expected, on average, to yield better parameter estimates than the OLF method, which lacks the “insight”, but still does not know the parameter values perfectly. Then the entire process describe above is repeated for the next time period, and the next, until the final time period for the model is reached. Following this a new set of random variables are generated by the Monte Carlo subroutines for all the stochastic values and the model is then solved again until all of the Monte Carlo runs have been completed. From this background let’s take a look at the solution comparing the OLIN method to the CEWO and OLF methods. 3. Results Since we want to compare the results for the three methods across a number of Monte Carlo runs pull down the Data menu and select the Size option. This will yield the dialog box shown below.

174

Page 177: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-14 Size Dialog Box As is shown above, change the Monte Carlo Runs edit box from 1 to 3. It would require a much larger number of Monte Carlo runs to generate statistically interesting results; however, our purpose here is only to demonstrate the use of Monte Carlo runs to compare the three methods. Next use the command Preferences: Results to display the dialog box which follows.

175

Page 178: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-15 Preferences for Results Dialog Box In the Format group select the “Floating or Exponential” radio button. This is a wise option to use when one does not know whether the results will be large or small numbers since each number will be examined and either a floating point or an exponential format will be used as is most appropriate. Next proceed to solve the model by using the Solve: Compare Print command to obtain the following dialog box.

176

Page 179: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-16 Method Selection Dialog Box The three methods CEWO, OLF and OLIN are chosen here because that is the comparison used in the Amman and Kendrick (1999b) paper. After this dialog box is closed provide the name of the debug file in the manner described earlier. Here we will use the name islmtvme.dbg. After this the Debug Print Options dialog box will appear. Tab to the Inputs property page of that dialog box and select All Inputs. Then tab to the Results property sheet and select the “Final” values for the criterion function and select the “Monte Carlo Summary”. Then click on the OK button to close the print options dialog box. Then the following dialog box will appear.

Figure 10-17 Method Count

177

Page 180: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This dialog box shows that the OLF method had the lowest criterion value for all three of the Monte Carlo runs. This is surprising since one would have expected the OLIN method to do better than the OLF method; however, a sample of three is too small to enable one to draw any conclusions. Then click on the OK button and the following dialog box will appear.

Figure 10-18 Average Criterion Values

Careful examination of the first four digits in this dialog box yields CEWO = 0.0099 OLF = 0.0003 OLIN = 0.0004 So, consistent with the result in Figure 10-17 that OLF was performing better than OLIN we see here that the two methods are close but the OLF has done better on average across these three Monte Carlo runs and that that CEWO has done much worse than OLF and OLIN. Click on the OK button and you will return to the Duali main window. A Results window does not appear when Monte Carlo runs are performed. Rather it is necessary to exit from Duali and then use an editor to open the debug file, islmtvme.dbg. The top of the file will look as follows.

178

Page 181: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Debug File for OLF islmtvp model with meas error spec islmtvme State Variables, n 2 Control Variables, m 2 Exogenous Variables, l 1 Observation Variables, ny 2 Uncertain Parameters, np 2 Time Periods, nt 12 Maximum Forward Variable Lead 1 Iteration Limit 20 Monte Carlo Runs, nmc 3

Check the last item here to be sure that three Monte Carlo runs were performed. If this is number is only one, then you may need to return to the Size dialog box, change the number of Monte Carlo runs and then give the Solve: Compare Print command again. Then scroll to the bottom of this file in order to see the following results.

HCFR CE CEWO OLF OLIN mcResults 0 0 0.001422 0.000310 0.000381 0 0 0.003759 0.000176 0.000276 0 0 0.015890 0.000579 0.000669 Average Criterion Value for HCFR 0 Average Criterion Value for CE 0 Average Criterion Value for CEWO 0.0070250 Average Criterion Value for OLF 0.0003550 Average Criterion Value for OLIN 0.0004425 Runs with Lowest Criterion in HCFR 0 Runs with Lowest Criterion in CE 0 Runs with Lowest Criterion in CEWO 0 Runs with Lowest Criterion in OLF 3 Runs with Lowest Criterion in OLIN 0

179

Page 182: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This output provides a comparison of the criterion values in each of the three Monte Carlo runs as well as a summary of the average criterion values across the Monte Carlo runs and a count of which method has the lowest criterion value on each of the runs. The average criterion values shown above are only one of many kinds of averages that can be computed in Duali for the Monte Carlo runs. The following chapter provides a more detailed account of these averages and the methods for accessing them. Plot comparison of the results for the run above by using the command Results: Plot Single Run. These results will be for the last of the three Monte Carlo runs since the arrays that store the plotting arrays for the states, controls and parameters are overwritten during each of the Monte Carlo runs. When the Plot Options dialog box comes up click the radio button for CEWO-OLF-OLIN with the line for the “pi” state variable and the following plot will appear.

180

Page 183: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-19 Plot of the Inflation Rate (Times Ten)

This plot shows clearly how the OLF and OLIN solutions are close to one another and somewhat distant from the CEWO solution. Click on the OK button in the Continue Plotting dialog box and you will return to the Plot Options dialog box as shown below.

181

Page 184: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-20 Plot Options Dialog Box

In the “Variables and Parameters” group select the Parameters option and in the Variables Selection choice box select the b22 parameter. Also, in the “Show Path(s) For” group select “Est and True” and in the Solution Method group select CEWO-OLF-OLIN. Then click on OK and the following graph will appear.

182

Page 185: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 10-21

There are almost too many lines in this figure to make the results easy to follow. Also, the black and white print in this User’s Guide does not enable one to see the color differences that are important to understand the graph. However, if you are sitting at your terminal you will be able to see the colors. Compare first the CEWO Est and the CEWO True lines. The CEWO Est line is the straight line near the bottom of the graph at a value of 0.3000. This is the value in the vector TH0DIFF for the b22 parameter. Recall that this is not equal to the true value that is 0.2083. Also, recall that in the CEWO method parameter estimates are not updated since the method is “without” the Kalman filter. Next follow the CEWO True value that is the other solid line in the graph. Notice that this value changes over time due to the policy-to-parameter effect, i.e. the

183

Page 186: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

policy variables are changing over time and as they change the behavioral parameters (the true parameters) change in response. Next compare the OLF Est and OLF True lines which are the long dashes. These two lines are close together and thus illustrate one of the points of the Amman and Kendrick paper – that the Kalman filter can do a pretty good job of tracking changes in the true values of the parameters in this model. Notice that the time path of true values of the parameters in the CEWO and the OLF methods are different. The reason for this is that the policy variable paths are different for the two methods and through the policy-to-parameter effect this results in different true parameter paths. Finally, compare the OLIN Est and OLIN True paths and notice that they also are rather close to one another, but not necessarily much closer together than the two OLF paths. Thus, in this particular Monte Carlo run, the “insight” in the OLIN method does not give it much advantage over the OLF method. This result will vary from one Monte Carlo run to the next and there will be runs where “insight” offers a substantial advantage to the OLIN method over the OLF method. If you want to see results for other Monte Carlo runs return to the Data: Size box and change the 3 to 2 and then solve the model again. Then the second run (which is now the last) will be retained in the plotting arrays and can be viewed in the plots. It is most worthwhile to view the results from a number of Monte Carlo runs and to examine the states, controls and parameters for these runs in order to obtain a feeling for the character of the results. Once this is done then one should proceed to runs in which many Monte Carlo runs are done and then analyze those results with the tools described in the next chapter. Known Bug We have recently (Jan 2000) found a bug that can sometimes cause a crash when the OLIN solution procedure is used. It occurs only rarely – maybe two or three times in one hundred Monte Carlo runs and the location will shift if the seed for the Monte Carlo run is altered. We have not yet been able to track down this bug, but hopefully will have done so by the time you encounter difficulties, so that we can provide you with a corrected version of the code.

184

Page 187: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 11

Monte Carlo Runs

Monte Carlo runs permit the user to compare the performance of the various methods such as certainty equivalence and open loop feedback. We have already provided in previous chapters some preliminary discussion of the Monte Carlo capabilities in Duali. In this chapter we will provide a more comprehensive discussion of these capabilities. We will begin with a single method and a few Monte Carlo runs in order to provide a description of the various kinds of averages and variances that can be computed in Duali. Then we will move to a comparison of two methods using more Monte Carlo runs in order to show how one should manage the output from the Monte Carlo routines when the volumes of output become large. 1. A Single Method Consider only the Certainty Equivalence method and use the abel.dui model for demonstration purposes. Restart Duali and open the abel.dui model. Then select the Data: Size option and the dialog box shown below will appear.

185

Page 188: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-1 The Size Dialog Box

Change the number of Monte Carlo runs from 1 to 3 as shown above and then click on the OK button. Then select Specification: Source of Random Terms so that dialog box will appear as shown below.

186

Page 189: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-2 Source of Random Terms

Check to be sure that the items are checked as indicated above. For the Certainty Equivalence methods we will not need all the sources of stochastic terms shown above but it is best to leave them all checked as shown. The next step is to solve the model with the command Solve: Compare Print. The Method Dialog box will appear as is shown below.

187

Page 190: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-3 The Method Dialog Box

Check only the Certainty Equivalence method as is shown above. Next the user is asked to provide the name of the debug file. If you were following the conventions used in the previous chapter you would name this file abel.dbg. Then the user is asked to provide print options with the following property sheet. If the sheet opens to one of the other tabs then click on the Summary tab.

188

Page 191: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-4 The Debug Print Options – Summary Page

In the Summary page it is better to make a selection only in the Monte Carlo box in order to keep down the volume of output. The selection above is only for the first run but it is also possible in the next box down to select the output for some other run. This capability is handy is you have already done a Monte Carlo experiment with say 20 runs and noticed from the criterion values that run 16 is an outlier. To track down the reason this is occurring start the Monte Carlo run again and request that output be written to disk for later printing for run 16. Next select the Inputs tab and the property page below will come to the front.

189

Page 192: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-5 The Debug Print Options – Inputs Page

It is useful in most Monte Carlo experiments to echo print the input thus the All Model inputs item is checked. Among the stochastic elements only the last two are checked. However, if a large number of Monte Carlo runs are planned you may prefer to check only the last element. It provides a useful check on the random number generator because you can compare it to the original means and covariances to see how closely the generated sample comes to the original. Next select the Results tab on the property sheet and the page below will come to the front.

190

Page 193: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-6 The Debug Print Options – Results Page If you are doing only a few Monte Carlo runs – as we are here - then you might want to select the mean values of the theta and the final values of the states and controls. For a larger number of runs only the final value of the criterion is usually selected and for a still larger number of runs you might want to select only the Monte Carlo Summary item. Next select the Averages tab of the property sheet and the property page below will appear.

191

Page 194: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-7 Averages Property Page One of the key concerns in printing results from Monte Carlo runs is to keep down the volume of output because you may be using 100, 1000 or even 10,000 runs. Thus this property page provides the user the capability to precisely control the type of output desired. Ordinarily, you would want to check only one or two of the items on the page. However, we have checked many in this case since we have only 3 Monte Carlo runs and since we want to be able to shown the many types of output available. The two main groups of this property page are those on the left and right at the top. Most commonly users will be interested in moments over Monte Carlo runs that are on the left. One can select averages and/or variances for states and/or controls and can do this in either regular and/or transposed form. If you want to copy and paste some of the results from the debug file to a spreadsheet for plotting, you may find that the transpose form is more convenient than the regular form. Consider the element above for means for the

192

Page 195: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

state variables in the regular form. This provides and n x nt matrix that will be the mean value over the Monte Carlo runs for each of the state variables in each of the time periods. The other main group on this property page is on the top right and is the moments over time. In this group consider the element for the means of the states in the regular form. It is an n x nmc matrix that gives the average across time of each state variable in each of the Monte Carlo runs. This matrix may of course be very large if the number of Monte Carlo runs is large. We will return to a discussion of the other elements in this property page later; however, for now click on the OK at the bottom of the property sheet. After clicking OK there will be a wait while the models are solved. However, a progress indicator will appear in the bottom left corner of the window to inform you of the share of the runs which have been accomplished. When the runs are completed the dialog box below will appear.

Figure 11-7 The Method Count Dialog Box Since we used only a single method no comparison was made and the Method Count will be zero for all methods. Click OK and then the dialog box below will appear.

Figure 11-8 Average Criterion Values Dialog Box

193

Page 196: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This result also is of little interest when a single method is employed but will be of greater interest later when two or more methods are used. The user’s results may differ here and in other places in the remainder of this chapter due to differences in the operation of the random number generators on different machines. Click OK and you will be back at the main Duali window. No results will appear because multiple Monte Carlo runs were done. If a single Monte Carlo run had been done then the Results window would have appeared. However, the results from the last Monte Carlo run will have been stored in the arrays that are used to display tables of results and to do plots of the results. It is a good idea to take a look at these results so that you see the pattern of results in at least one Monte Carlo run. This can be done by pulling down the Results menu and selecting the Display option so that the following Results window appears.

Figure 11-9 Results of the Last Monte Carlo Run Later in this chapter we will examine a print out of the criterion value in each of the Monte Carlo runs and you can see that the value in the last run is 666.50 which confirms that the last run is the one stored for displaying of tables and for plotting when a number of Monte Carlo runs are done.

194

Page 197: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Also you can plot the results for the last Monte Carlo run by pulling down the Results menu and selecting the Plots: Single Run option. Next close the Duali application and examine the abel.dbg file in an editor. The portion of this file that is of particular interest here are (1) the random variables generation, (2) the optimal states and controls and (3) the moments from the Monte Carlo runs. Look first at the section on generation of random variables. At the top of this section you will find the statements.

Monte Carlo seed for DK generator = 27

Monte Carlo seed for Hans' generator = 0.500000

There are two Monte Carlo generators in Duali – one that is labeled “DK” for David Kendrick and one that is labeled “Hans” for Hans Amman. The one currently in use is “Hans”. If you want to replicate Monte Carlo runs you may want to alter the seed for this generator. You can do that by pulling down the Preferences menu and selecting the Seed for Monte Carlo Generator option. When you do so the following dialog box will appear.

Figure 11-10 Seed for Monte Carlo Generator Dialog Box

195

Page 198: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

If you want to change the seed for the “Hans” Monte Carlo generator from 0.50 to some other value type a floating-point number in the appropriate edit box and then click on the OK button. Next look slightly further down in the abel.dbg file and you will find the place where the random variables for the first Monte Carlo run are reported, viz.

xsis in GenerateRandomTerms

-0.21 -0.85 -3.05 1.65

-1.33

1.48 -1.60 2.29 -4.48

-1.64

xsis in GenerateRandomTerms

-3.90 1.42

2.97 -0.00

The values of the additive noises for the system equations in the GenerateRandomTerms subroutine for periods 0, 1, 2, …, 6 for each of the two state equations, viz. consumption and investment are shown in these lines.

196

Page 199: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Scroll down further in the file until you find the lines shown below.

xs in CompareCe

387.90 389.70 391.38 391.66

397.61

85.30 89.13 88.46 93.94

90.03

xs in CompareCe

399.97 400.43 405.85

91.58 98.00 92.59

us in CompareCe

115.01 116.67 117.96 120.75

120.48

144.10 144.63 145.89 146.44

146.27

us in CompareCe

122.34 126.21

147.03 143.73

criterion in CompareCe 701.67

These are the optimal control paths for the states, controls and criterion value respectively for the first Monte Carlo run. Recall that we requested on the Summary property page of the print options that the results be printed for only the first Monte Carlo run.

Following this is a table of the criterion values for each of the Monte Carlo runs for each method.

HCFR CE CEWO OLF OLIN

mcResults

0.00 701.67 0.00 0.00 0.00

0.00 310.28 0.00 0.00 0.00

0.00 666.50 0.00 0.00 0.00

This gives a quick indication of how much the criterion value changes from one run to the next.

197

Page 200: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This is followed by the averages and the number of runs in which each method had the lowest criterion value.

Average Criterion Value for HCFR 0.00

Average Criterion Value for CE 559.48

Average Criterion Value for CEWO 0.00

Average Criterion Value for OLF 0.00

Average Criterion Value for OLIN 0.00

Runs with Lowest Criterion in HCFR 0

Runs with Lowest Criterion in CE 0

Runs with Lowest Criterion in CEWO 0

Runs with Lowest Criterion in OLF 0

The results which follow are most easily understood with a series of tables which show only the results for a single state variable for the CE method, namely consumption for the time periods 0, 1, …, 7 and the three Monte Carlo runs. You will find these values in the array MonteCarloXsCe in the file abel.dbg.

198

Page 201: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Monte Carlo Run Period 1 2 3

0 387.90 387.90 387.90 1 389.70 390.17 390.07 2 391.39 395.19 390.52 3 391.66 394.84 392.57 4 397.61 398.82 392.67 5 399.97 402.09 399.28 6 400.43 402.85 400.75 7 405.85 406.42 404.07

Table 11-1 MonteCarloXsCe Array

These results are produced if you check the box which appears on the Averages property page in the middle on the left hand side below the section that begins “Arrays of Monte Carlo Results for x and u.” and ends “For debugging – May produce a large print file.” The dimensions of this array for the states are “n x nt x nmc” and are the same size for the controls, so these arrays will be very large if you are solving for many Monte Carlo runs. In the table below, the array from Table 11-1 above has been repeated and bordered with results that show the names of the various moments that can be computed and written to disk in Duali.

Monte Carlo Run

Period 1 2 3 AvgXsCe VarMcXsCe 1 387.90 387.90 387.90 387.90 0.00 2 389.70 390.17 390.07 389.98 0.06 3 391.39 395.19 390.52 392.36 6.17 4 391.66 394.84 392.57 393.02 2.69 5 397.61 398.82 392.67 396.36 10.62 6 399.97 402.09 399.28 400.45 2.15 7 400.43 402.85 400.75 401.34 1.73 8 405.85 406.42 404.07 405.45 1.50

AvgXsTimeCe 395.56 397.28 394.73 VarXsTimeCe 39.82 41.29 34.19

Table 11-2 Moments Over Time and Over Monte Carlo Runs for the Consumption State Variable

199

Page 202: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The results that will most likely be of interest are those in the column labeled “AvgXsCe”. As the table makes clear these are the averages across Monte Carlo runs for the consumption state variable in each time period. The corresponding variances are in the column labeled “VarMcXsCe”. Thus this is the variance in each time period for the consumption state variable across Monte Carlo runs. These two items are checked in the dialog below.

Figure 11-11 Averages Property Page Of course Table 11-2 does not show the results for both the consumption and investment state variables as would be elicited by the checks above, but rather only the consumption state variable.

For ease of access, Table 11-2 is repeated below.

200

Page 203: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Monte Carlo Run

Period 1 2 3 AvgXsCe VarMcXsCe 1 387.90 387.90 387.90 387.90 0.00 2 389.70 390.17 390.07 389.98 0.06 3 391.39 395.19 390.52 392.36 6.17 4 391.66 394.84 392.57 393.02 2.69 5 397.61 398.82 392.67 396.36 10.62 6 399.97 402.09 399.28 400.45 2.15 7 400.43 402.85 400.75 401.34 1.73 8 405.85 406.42 404.07 405.45 1.50

AvgXsTimeCe 395.56 397.28 394.73 VarXsTimeCe 39.82 41.29 34.19

Table 11-3 Moments Over Time and Over Monte Carlo Runs for the Consumption State

Variable

The results that are next in the order of interest are those in the next to last row, which are labeled “AvgXsTimeCe”. These are the mean values over time for the consumption state variable in each Monte Carlo run. The corresponding variance is in the last row that is labeled “VarXsTimeCe”. At times the volume of output from even the four types of output discussed above will be so great that you will only want to look at more aggregate results. These are shown in Table 11-4 below.

AvgAvgXsTimeCe AvgXsTimeCe 395.56 397.28 394.73 395.86

AvgVarXsTimeCe

VarXsTimeCe 39.82 41.29 34.19 38.43

Table 11-4 Moments of the Moments Over Time

The first row of this table repeats the material in the next to last row of Table 11-3 and then labels the average of the numbers in that row as “AvgAvgXsTimeCe”. So this is the average over Monte Carlo runs of the averages over time of the consumption state variable. The corresponding average of the variances is shown in the last line of Table 11-4.

201

Page 204: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

The check boxes to select these prints are shown below.

Figure 11-12 Selections for Moments Across Time of Moments Over Monte Carlo Runs

202

Page 205: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

There is one more statistic that can be computed in Duali. It is obtained by using the column labeled “AvgXsCe” from Table 11-3. This column has the means for the consumption state variable in each time period across Monte Carlo runs.

AvgXsCe 387.90 389.98 392.36 393.02 396.36 400.45 401.34 405.45VarAvgXsCe 37.37

Table 11-4 Variance of the Averages Over Monte Carlo Runs

This statistic is labeled “VarAvgXsCe” and is the variance across time periods of the averages in this column. This result is also (in addition to “VarXsTimeCe” as discussed above) obtained when you check the “Avg Var over MC Runs” option in the Averages property page shown in Figure 11-11. The value VarAvgXsCe for consumption is shown above but there will also be a value for the other state variable, investment. Also, there will be similar values for the two control variables, government expenditures and the money supply, in the array labeled “VarAvgUsCe”. These two sets of numbers provide a measure of the variance over both time and Monte Carlo runs for each state and control for the Certainty Equivalence method. If you are comparing two or more methods, say CE and OLF, these summary statistics will give an indication of which methods do a better job of stabilization of the state variables. Also they provide a measure of the variances of the control variables that are required to produce the stabilization results. This completes the discussion of the Monte Carlo results for a single method. Next consider a case where there are two or more methods to be compared.

203

Page 206: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

2. Comparison Across Several Methods

It is one thing to do a few Monte Carlo runs for a single method and another to do a large number of Monte Carlo runs for several methods. The main reason for the difference is the sheer volume of output and therefore the necessity to control carefully the arrays which are stored in the *.dbg file. In order to illustrate this, restart Duali and open the abel.dui file again. Then pull down the Data menu, select the Size option and change the number of Monte Carlo runs from 1 to 100. Then pull down the Solve menu, select the Compare: Print option and then choose the HCFR, CE and OLF methods so that the dialog looks like the following.

Figure 11-13 Methods Dialog Box

Then click on the OK button and, when asked, type “abel” in the dialog box so that the debug file will be called “abel.dbg”.

When the Debug Print Options property sheet appears leave all the options in the Summary tab blank and select the Inputs tab so that the following property page appears.

204

Page 207: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-14 Inputs Property Page

Even when one is doing large numbers of Monte Carlo runs there is no harm in checking “All Model” on the Inputs property page since this material is printed only one time and is not repeated for each Monte Carlo run. Also the item “Means of Ran Vars Across Monte Carlo Runs” has been selected. This enables the print of the means and covariance matrix that is computed from the Monte Carlo samples that are created by the Monte Carlo generator. It is useful to compare these values to the input mean and covariance matrices as a check on the quality of the random number generation. We will make this kind of comparison below when we examine some of the results in the debug file. Next select the Results tab on the Debug Print Options and the following property page will appear.

205

Page 208: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-15 The Results Property Page

Only the Monte Carlo summary item is checked here. This is useful when one is doing 100 Monte Carlo runs since it permits an examination of the criterion values for all of the methods on each Monte Carlo run. This output can be most useful when one is perusing the results to check for outliers. This output will be shown later. Next select the Averages tab on the Debug Print Options property sheet so that the following property page appears.

206

Page 209: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-16 Averages Property Page

Even when one is doing many Monte Carlo runs it is useful to select items from the “Average” and “Variance” section of the “Moments Over Monte Carlo Runs” group as has been done above. These arrays have dimensions that include n, m and nt but do not include nmc, i.e. the number of states, controls and time periods but not the number of Monte Carlo runs. In contrast, the arrays on the “Moments Over Time” group have dimensions, which include nmc so they can be very large.

Also, the item “For debugging – May produce a large print file” has not been selected. This should be used only when you are doing a small number of Monte Carlo runs and want to check the results with spreadsheet calculations as was done in the first part of this chapter or when you want to transfer the basic Monte Carlo results to a spreadsheet or some other program in order to calculate some statistics other than those provided in Duali.

207

Page 210: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Finally the items in the bottom left group, “Moments Across Time of Moments Over Mc Runs” have been checked. These are summary statistics which are small arrays and which can be most useful in comparing the methods across Monte Carlo runs. We will examine these types of results below. Next click on the OK button at the bottom of the Debug Print Options property sheet and then be prepared to wait for a time while the Monte Carlo runs are done. This will take only a few seconds when 100 Monte Carlo runs are being done and when the model does not have forward variables. However, if the model has forward variables and requires many iterations to converge or if you are doing thousands rather than hundreds of Monte Carlo runs you may find yourself having plenty of time to get a cup of coffee while the progress bar inches its way across the bottom of the Duali main window. Once the calculations have been completed the following dialog box will appear.

Figure 11-17 Method Count Dialog Box

This dialog box shows that the Handcrafted Feedback Rule method had the lowest criterion values among the three methods in 18 of the runs, the Certainty Equivalence methods had the lowest in 37 runs and the Open Loop Feedback method has the lowest in 45 runs. The results are in line with the expectations for this model, i.e. the OLF method is superior to the CE method and dominates the HCFR method. This kind of result will vary with the choice of the HCFR feedback matrices and will vary from model to model; however they are representative, viz. Amman and Kendrick (1997). Click OK on the Method Count dialog box and the following dialog box will appear.

208

Page 211: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-18 Average Criterion Values Dialog Box These results are consistent with those from the Method Count with OLF having the lowest criterion value, CE next and HCFR being considerably worse. Click OK on this dialog box and you will return to the Duali main window. Then exit from Duali and use an editor to examine the abel.dbg file. First notice that this file, which is only about eleven pages long, is easily manageable. Then look at the table that shows the criterion value for each Monte Carlo run for all the methods. Results for the first eleven Monte Carlo runs are printed below. HCFR CE CEWO OLF OLIN mcResults 867.60 701.67 0.00 515.60 0.00 2406.40 310.28 0.00 353.94 0.00 979.73 666.50 0.00 443.55 0.00 1098.44 1106.96 0.00 892.68 0.00 2123.67 2431.04 0.00 2351.95 0.00 908.42 626.98 0.00 569.90 0.00 2268.34 553.30 0.00 519.44 0.00 1366.35 418.02 0.00 509.64 0.00 900.55 1319.80 0.00 868.25 0.00 1264.79 250.45 0.00 222.85 0.00 1424.24 2289.25 0.00 1441.83 0.00

A quick perusal of these results shows that the HCFR method is seriously worse than the CE and OLF methods in the second, seventh, eighth and tenth Monte Carlo runs, but is superior to the CE method in a number of the other runs and even to the OLF methods in two of the runs. When you examine this type of list for your own models you may find some runs that deserve special examination. If so, you can repeat the experiment and input the number of this run to the Summary property page of the Debug Print Options property sheet. If you do this be careful to exit from Duali after the first experiment and restart it so that the Monte Carlo runs begin with the same seed in the second of experiment as in the first. Then in the second experiment you can examine both intermediate and final results for the Monte Carlo run of interest and track down the cause of the strange or interesting results.

209

Page 212: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Next scroll down in the abel.dbg file into you find the section shown below.

AvgAvgXsTimeHcfr 403.56 87.72 AvgAvgXsTimeCe 395.47 89.50 AvgAvgXsTimeOlf 395.62 89.11

This shows the average over time of the average over the Monte Carlo runs for the two state variables (consumption in the first column and investment in the second column). These numbers show the close similarity of the CE and OLF methods and the substantial difference with the HCFR method. Also, it shows that the HCFR method keeps consumption at a relatively higher level and investment at a relatively lower average than the other two methods. Next consider the corresponding data for the control variables.

AvgAvgUsTimeHcfr 123.82 143.27 AvgAvgUsTimeCe 118.19 144.36 AvgAvgUsTimeOlf 118.33 144.18

210

Page 213: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

This shows that the HCFR method uses, on average, higher levels of government expenditures and lower levels of the money supply than do the other two methods. Next consider the equivalent variances for the state variables.

AvgVarXsTimeHcfr 56.93 8.84 AvgVarXsTimeCe 42.81 15.43 AvgVarXsTimeOlf 42.11 13.53

These data are the average across time of the variances across Monte Carlo runs for the state variables. This shows that the OLF and CE methods do a considerably better job of stabilizing consumption and a worst job of stabilizing investment than the HCFR method. Also it shows that OLF is superior to CE on both counts. Then look at the control variables to see how they are used.

AvgVarUsTimeHcfr 67.83 2.65 AvgVarUsTimeCe 14.89 2.05 AvgVarUsTimeOlf 11.54 1.65

Clearly the OLF has much smaller fluctuations in the control variables than does either HCFR or CE. Also, it shows that the particular handcrafted rule used here makes very substantial use of the government expenditure control (67.83) in attempting to stabilize the model economy. Consider next the variance across Monte Carlo runs of the state variables as shown below.

211

Page 214: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

VarMcXsHcfr 0.00 3.80 5.12 4.77 6.30 0.00 9.57 10.30 7.59 7.78 VarMcXsHcfr 5.40 6.76 5.75 10.45 9.01 8.49 VarMcXsCe 0.00 3.93 6.15 7.08 8.59 0.00 13.84 13.51 11.57 10.94 VarMcXsCe 8.33 9.73 7.65 14.14 12.51 11.88 VarMcXsOlf 0.00 4.17 6.57 7.62 8.95 0.00 13.49 13.65 11.75 11.49 VarMcXsOlf 8.11 9.55 10.50 14.51 11.93 10.55

These series enable the user to look at the variance in different time periods of the state variables under the different methods. From a first examination it does not appear that stabilization is more difficult in some periods than others (after the first period or two). Then look at the equivalent control variable paths. VarMcUsHcfr 2.40 4.71 6.16 5.51 6.48 0.47 1.11 1.00 0.65 0.78 VarMcUsHcfr 7.27 8.00 0.95 0.72 VarMcUsCe 3.04 2.65 3.15 2.84 3.45 1.90 2.04 2.06 1.52 1.45 VarMcUsCe 5.65 13.60 1.33 2.20 VarMcUsOlf 4.42 3.73 4.44 4.04 5.45 1.83 1.94 2.02 1.53 1.48 VarMcUsOlf 8.72 3.10 1.84 1.35

Here again there does not appear to be a notably higher variance in some periods than in others.

212

Page 215: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Next consider the variance across time periods of the means values over time for the states and controls.

VarAvgXsHcfr 53.26 1.03 VarAvgXsCe 38.72 5.42 VarAvgXsOlf 37.78 3.73

Here we see the same pattern as above – namely higher variance in the consumption and lower variance in investment for the HCFR method than the CE and OLF methods and with OLF better than CE on both counts. Then look at the equivalent control variable statistics

VarAvgUsHcfr 62.69 1.82 VarAvgUsCe 11.30 0.57 VarAvgUsOlf 8.58 0.25

Here again we see that OLF dominates CE that dominates HCFR when it comes to compare the variance in the use of the control variables.

213

Page 216: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Finally, look at the statistics that can be used to check the Monte Carlo generator. The average values of TH0, the initial parameter values, for these 100 Monte Carlo runs are shown below. thetamean in maincompare 0.91 -0.01 0.31 0.42 -59.12 0.10 0.41 -0.10 1.52 -193.87

Compare this to the theta0 that is the input mean for the unknown parameter vector that is shown below. theta0 0.91 -0.02 0.30 0.42 -59.44 0.10 0.42 -0.10 1.46 -184.77

From a quick first glance it appears that the Monte Carlo routines are doing a reasonably good job. Then take a look at the last five rows and columns of the SITT0 matrix, the covariance matrix for the unknown parameters. The values calculated from the sample produced by the random number generator are as follows.

214

Page 217: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

thetacovar in maincompare 0.01 -0.01 -0.02 0.01 -1.13 -0.01 0.02 0.02 -0.03 2.86 -0.02 0.02 0.05 -0.03 2.40 0.01 -0.03 -0.03 0.07 -8.81 -1.13 2.86 2.40 -8.81 1158.14

And the input values for the last five rows and columns of this matrix are sitt0 0.01 -0.01 -0.02 0.01 -1.17 -0.01 0.02 0.02 -0.03 2.90 -0.02 0.02 0.05 -0.03 2.71 0.01 -0.03 -0.03 0.08 -9.64 -1.17 2.90 2.71 -9.64 1256.00

Once again, a quick examination suggests that the values in the two matrices are comparable – this for 100 Monte Carlo runs. The Monte Carlo results that have been discussed so far focus on means and variances. These statistics provide a useful way to compare the various methods for solving stochastic control models; however they are not the only way to make such comparisons. Consider next an alternative. 3. Sum of Squared Differences

The means and variances focus on the level and variability of different series. In contrast the sum of squared differences provides a measure of the separation of the time path in each Monte Carlo run between the optimal and desired variables. Thus they are like the criterion value but they provide a breakdown between states and controls and within this, a breakdown for the individual state and control variables. To see these types of results continue in Duali with the example from above, or if you have exited, then restart Duali and open abel.dui. Change the number of Monte Carlo runs to 100 and then give the command Solve: Compare Print. Select HCFR, CE and OLF just as you did in the example above and give the debug file the name abel.dbg. The debug options property sheet will appear as shown below.

215

Page 218: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 11-19 Debug Print Options Dialog Box First select the Input tab and check All Inputs and then select the Results tab and check Monte Carlo Summary. Finally select the Averages tab and check All for “Sum of Squared Differences”. Then click on the OK button for the property sheet. It will take a little time to solve the model one hundred times but you can follow this in the progress bar at the bottom of the Duali main window. When the Monte Carlo runs are completed exit from Duali and put the abel.dui file in an editor.

216

Page 219: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Scroll down in the editor until you find the following section. SumSqDiffXsHcfr 181.30 536.74 309.45 320.44 386.39 43.77 74.25 61.75 40.17 142.26 SumSqDiffXsHcfr 382.12 320.20 267.74 217.66 597.43 55.40 85.17 146.84 33.95 82.62

We have shown above the results for the state variables from the first 10 of the 100 Monte Carlo runs for the HCFR method. So these calculations provide the sum of square differences for each state and control variable across time periods in each Monte Carlo run. Thus 181.30 is the sum of squared differences for the first state variable (consumption) in the first Monte Carlo run, 43.77 is the equivalent number for the second state variable (investment) in the first Monte Carlo run, 536.74 is the sum of squared difference for the first state variable, consumption, in the second Monte Carlo run, etc. Scroll down in the file past the equivalent results for the other methods until you come to the section shown below.

SumSqDiffXsHcfrT 181.30 43.77 536.74 74.25 309.45 61.75 320.44 40.17 386.39 142.26 382.12 55.40 320.20 85.17 267.74 146.84 217.66 33.95 597.43 82.62

These are the same results as shown above – i.e. values for the two state variables for the HCFR method for the first ten of the one hundred Monte Carlo runs. The only difference is that this array is the transpose of the one shown above. The transpose is provided because it may be easier to copy and past to a spreadsheet or statistical package for plotting.

217

Page 220: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Scroll down further and you will find the summary results that are shown below.

AvgSumSqDiffXsHcfr 369.08 77.53 AvgSumSqDiffXsCe 124.72 126.76 AvgSumSqDiffXsOlf 121.33 112.39

These results are the averages across the Monte Carlo runs of the sum of squared differences between the optimal and desired paths for each of the methods. The results here are consistent with those which were discussed above for the means and variances, namely that the particular handcrafted rule used in these solutions does a better job of stabilizing the consumption path and an inferior job of stabilizing the investment path than does either of the other two methods. Also the OLF method is superior to the CE method on both counts. Scroll down further in the file and you will find the results for the state variables, which were discussed above, repeated for the control variables.

218

Page 221: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 12 Stochastic Control Models: Active Learning with Dualpc

Duali does not yet have the capability to solve active learning models internally; therefore it is necessary to write an ascii file from Duali which can be used as the input to Dualpc. The Dualpc software has the capability to solve not only active learning but also passive learning and deterministic models.

1. Writing the Input File for the Dualpc Code Once all of the elements of the model are in place it is only necessary to write the input file for the Dualpc code. However, before doing so it is important to save the model if you have made any changes that you want to keep. To do this pull down the File menu and select the Save As item if you have not save it before or the Save item if you have saved it before. Before attempting to write the file check the Specification: Functional Forms dialog box to be sure that all of the options checked there are those with an asterisk. These are the options required by Dualpc and the file will not write properly if those options are not selected. Make the necessary transformations of the model to get in into the form required by the Dualpc software. In order to write the input file for the Dualpc code pull down the File menu and select the "Export: DUAL" item. Dialog boxes will appear which allow you to write the file to disk. If you are using Win 95, Win 98 or Windows NT 4.0 or later be very careful that you do not overwrite the *.dui input file for Duali. For example if you are working on the Chapter 12 model which is called ch12.dui and are not careful you might type ch12 into this dialog box and Win 95, Win 98 or Win NT would provide the .dui extension and you would overwrite you input file. To avoid this type ch12.dua and then if Win 95, Win 98 or Win NT provides a *.dui extension you will end up with a file named ch12.dua.dui which will not overwrite your input file. Then you can rename the file to ch12.dua.

219

Page 222: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

As you can see from the above, the default name for the file extension is ".dua" but you can use any other extension which you prefer so long as you consistently use that extension when running the file with the Dual code as is described below. For now exit from Duali by double clicking on the control box in the upper left hand corner of the main window. This will return you to Windows.

2. Solving the Model with Dualpc Dualpc is the version of the Dual code, which has been modified to run on personal computers. It will run under Windows through in a somewhat restricted fashion. To use the present version of the code it is necessary to copy your dual input file to the directory where the Dualpc code is stored, change the name of the input file, solve the model and then copy the results back to your own directory. These steps are accomplished as follows. First copy the input file from its present directory to the directory in which dualpc.exe is stored. In the process copy the file to the file name “cinput” or else rename the file to “cinput” after you have copied it. The reason for this is that Dualpc looks for its input in the file “cinput”. Once you have finished copying the file you are ready to run Dualpc. Do this by double clicking on the Dualpc icon. You will see the operating system transfer into DOS mode to read the input file, solve the model and write the results to the file “coutput”. Once this is completed you can put the “coutput” file into the editor of your choice in order to examine it.

220

Page 223: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Part IV

The Rest

221

Page 224: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 13

Common Problems The following is a list of common problems that occur in the use of Duali. 1. Be careful that you save the *.dui file with “File/Save” before you close the main window. The main window is closed by double clicking in the window control box. If you forget to save these files before you close the window you will lose the information in them. 2. Attempting the scroll too quickly in the Acronym or any of the various data or results windows can cause Duali to crash on machines with slower microprocessors. 3. Be careful when you are importing a file to Duali that it is an ASCII file without any tab marks. Also, be sure that none of the numbers are so large that they run together with an adjacent number. 4. When you want to develop a new model use the File: New menu selection. 5. If you have trouble saving your *.dui file check to be sure that you are not trying to write it to a directory under Win NT that has the “read only” security set. 6. Be sure when you attempt to write a file to disk for use with the Dualpc software by using the File: Export DUAL menu option that the options for the model as indicated in the Specification: Functional Forms dialog box are those indicated by the asterisks for the Dualpc software.

222

Page 225: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Chapter 14

The Model Library Duali comes with a substantial number of example models that provide a most useful way to learn the use of the application and the variety of economic models that can be developed with it. The files in this model library can be accessed by using the “File: Example: …” command. This shows that the Examples Library is categorized five ways: Author Country Functional Form Stochastic Terms Subject Thus, to see the examples which were created from models developed by Andrew Abel use the command “File: Example: By Author: Abel” and to reach his two control variable deterministic model use the command “File: Example: By Author: Abel: Two Control: Deterministic”. When you do this the following dialog box will appear.

Figure 14-1 Message Box for Example Model This informs the user that the file “abelQLP.dui” has been opened and that this file contains the example model “Abel: Two Controls: Deterministic”. Clicking on OK will then result in the appearance of a description of this version of the Abel model as follows.

223

Page 226: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Figure 14-2 Model Description Window Scrolling down in the description window will provide information about the equations and the references for the model. Then selecting first “Data: Size” and then “Data: Acronyms” will provide a quick overview of the model. Next give the command Solve: QLP to solve the model followed by the command “Results: Plot: Single Run” to plot the results. When you are finished with the model use the command File: Clear to remove it from Duali. In order to move on to another example use the command “File: Example: By Country: US: Pindyck: Time Varying Penalties” to see a model of the U.S. economy which was developed by Robert Pindyck. Once again use the Specifications and Data menu items to examine the model, the “Solve: QLP” command to solve it and the “Results: Plot: Single Run” command to view the results. Then use the File: Clear command to remove the model from Duali. This is a quick way to view a number of the example models. However, please exercise care when using the “Clear” command. It is a relatively new command in Duali and has not been thoroughly debugged. Therefore after you have used the procedure above to find a model that is of interest to you, it would be wise to exit from Duali and then use either the File: Examples or the File: Open command to reopen the model.

224

Page 227: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

At times when using the File: Examples command the following dialog box may appear.

Figure 14-3 Warning Message Box When an Example Model Cannot Be Found This indicates that the desired example model – in this case abelQLP.dui – could not be found in the default directory. This message most commonly occurs when the dualivc4.exe file and the *.dui example files are not in the same directory. Therefore, the remedy is to move either the dualivc4.exe file or the *.dui example files so that they will be in the same directory. A workaround to use until the files are moved is to take actions which change the default directory to the one containing the *.dui example files. To do this select the File: Open command and navigate to the directory which contains the *.dui example files. However, do not open an example file. Rather close the “Open” dialog box by clicking on the x in the upper right hand corner. Then try again to use the File: Example command. If the message box above still appears it could be that the particular example is not in the directory with the other *.dui example files and the model file needs to be found and moved.

225

Page 228: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

1. List The following is a list of the models currently in the examples library - organized by the specification of the stochastic terms. (If you prefer an alphabetical list of the example models, see Appendix C.) a. Deterministic

abelQLP This model is a small macroeconomic model with consumption and investment for state variables and government expenditure and the money supply for control variables. It is like the Ch. 12 model from Kendrick (1981) except that it has two control variables rather than one. Also this is a restricted version of the Ch. 12 model that does not contain either additive noise terms nor parameter uncertainty. The original model was developed by Andrew Abel and Gregory Chow – see Abel (1975) and Chow (1967).

akforw This is a simple model with a forward variable. It was developed by Amman and Kendrick (1997) and has a single state and a single control. It is a small macroeconomic model. The forward variable capability has only recently been installed in Duali and should be treated with caution and replicated, where possible, in other software such as GAMS. ch04 A one control variable version of Andrew Abel's (1975) small macroeconomic model of the U.S. economy. Taken from Chapter 4 of Kendrick (1981). fair13 This is a version of Ray Fair’s (1984) small linear model which was converted to a deterministic quadratic-linear control model by Hyung Jin Park (1997). This version has 23 state variables and 3 control variables. Also, it has an innovative time-varying set of weights in the criterion function which are a refinement of the penalty normalization scheme used by Pindyck (1973).

226

Page 229: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

htdua01 This is a linearized version of the macroeconomic model developed in Hall and Taylor (1993). A GAMS version of this model is discussed in Mercado, Kendrick and Amman (1998). The Duali version used here was created by Mercado and Kendrick (1999). klein1 This is version of the famous Klein macroeconometric model of the U.S. economy developed in a control theory format by Hyung Jin Park (1997). park This is a version of Ray Fair’s (1984) small linear model which was converted to a deterministic quadratic-linear control model by Hyung Jin Park (1997). This model has twenty four state variables and one control variable. It is like the fair13 model above except that it has only a single control variable. parks-1 This is a four equation model of the U.S. economy which was developed by Hyung-Jin Park (1997) to combine later into a three country model for the U.S., Japan and Korea. parks-2 This model is a two country model for the U.S. and Japan developed by Hyung-Jin Park (1997). The original model has four state variables for each country, i.e. consumption, investment, imports and exports. The augmented model has seventeen state equations including those for both countries.

227

Page 230: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

pindyck This is Robert Pindyck’s (1973) twenty-eight state variable and three control variable quadratic-linear deterministic control model of the U.S. economy. pindcons This is model is the same as the pindyck.dui model except that the penalty weights are constant rather than time varying. This change makes the model simpler to use for experiments in undergraduate courses. raogrow This is a small growth model of the Indian economy developed by Manohar Rao and modified for solution in Duali by David Kendrick. The modified version has not yet been checked by Rao so Kendrick alone can be held responsible for any errors in the current version. For the source of the model see Rao (1989). ricislm This is a macroeconomic model developed by Ric Herbert (1998) in Australia. It has three states (GNP, the interest rate and the price level) and two controls (fiscal and monetary policy) and is like an IS-LM model. sarwal This is a version of Thomas Sargent and Neil Wallace’s (1975) rational expectations model developed by Amman and Kendrick (1996). This model makes use of the Fair-Taylor procedure for solving models which include forward variables. shih This is a model of the Taiwanese economy developed by Pai-Ta Shih(1997). The model focuses on income distribution and growth. It has four state variables, five control variables and four exogenous variables.

228

Page 231: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

taydua01 This and the file taydua02.dui are versions of one of the models in Taylor (1993). They was developed by P. Ruben Mercado in work with David Kendrick. taydua02 This version of the Taylor (1993) models has forward variables and thus rational expectations. It was developed by P. Ruben Mercado in work with David Kendrick. thrift0 This model was created by Michel Evanchik (1998) as a term project in an undergraduate computational economics course in the spring term of 1998. The model has state variables for both the assets (bonds, equities and checking account) and the liabilities (credit card debt and student loan debt) of a student. Exogenous variables for wages and living expenses are used to represent the fact that the student has greater living expenses than wages and thus must either cash in some of his assets or borrow from his credit card or from student loans in order to pay for his education. wieland This is a deterministic version of Volker Wieland’s (1997a) adaptive control model with one state, one control and two uncertain parameters.

229

Page 232: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

b. Stochastic with Additive Noise Terms

abeladd This model is like the Ch. 12 model from Kendrick (1981) except that it has two control variables rather than one. Also this is a restricted version of that model which is simpler and does not contain parameter uncertainty. Also this model is like the abelQLP model with the addition of additive noise terms. The original model was developed by Andrew Abel and Gregory Chow – see Abel (1975) and Chow (1967).

ch04add This model is the same as the Chapter 4 model from Kendrick (1981) but with additive noise terms included as well. college This is a simple one-state and one-control financial planning model for a family accumulating a fund of $10,000 over a period of years to be used for the college education of one of the children. There is an additive noise term which represents the fact that returns on the accumulated investment yield higher returns in some years than others and the family is constantly readjusting their contribution to the fund to get back on track after being knocked off track by higher or lower than expected returns.

c. Stochastic with Parameter Uncertainty

akforwst This model is the same as akforw.dui except that it has some stochastic elements so that it could be used to test the forward variable capability of Duali to solve Certainty Equivalence models.

230

Page 233: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

BrOlf This is a global warming model by Joe Breedlove. It has three state variables (tempeature, CO2 concentration and capital stock) and a single control variable (carbon tax). The model is in an early stage of development. cautionH1 This model has a single state variable and two control variables and was used by Mercado and Kendrick (1999) to study the effects of uncertainty in the control variable parameters on the relative intensity of use of the two policy variables. This version of the model has ten time periods. cautionH2 This model is the same as cautionH1 except that it has has three time periods and non-zero weights on the control variables in the criterion function. ch04stpu This is a version of the ch04 model with both additive noise and with parameter uncertainty. ch07 This is an OLF version of Elizabeth Chase MacRae's (1972) passive learning stochastic control model with a single state variable and a single control variable (see Kendrick(1981) Chapter 7).

ch11 This is a version of Elizabeth Chase MacRae's (1972) active learning stochastic control model with a single state variable and a single control variable (see Kendrick(1981) Chapter 11).

231

Page 234: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

htdua02 This is an OLF version of the Hall and Taylor(1993) model from their textbook on macroeconomics. It was created by P. Ruben Mercado and David Kendrick (1999).

htdua03 The is a Monte Carlo version of the Hall and Taylor model in which certainty equivalence (CE) solutions are compared to open loop feedback (OLF) solutions. It was created by P. Ruben Mercado and David Kendrick (1999).

islmtvp This is a simpler version of the islmtvme model in that is has only uncertain parameters while the more complex islmtvme model has the measurement error specification and thus has time varying parameters as well as measurment error. See Amman and Kendrick (1999b).

leech4-2

This model by Myong-Hwal Lee (1998) is an optimal monetary control model converted from the general equilibrium model of liquidity effect based on Christiano and Eichenbaum (1992, 1995). The equilibrium decision rules are derived from the liquidity model and then used as the system equations for control experiments. It has thirteen state variables, one control variable and 20 time periods. The model uses the “Stochastic with Parameter Uncertainty” specification for the stochastic terms but does not have any uncertain parameters. Therefore it should be solved with the Solve: Compare: CE command rather than the Solve: Compare: OLF command. pperturb This is a model by Pedro Paez (1999) for the analysis of alternative macroeconomic policies in Ecuador. It has twenty-eight state variables and eight control variables. It also has forward variables.

232

Page 235: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

rmolfarg This is a two state variable and two control variable model of the Argentine economy which was developed by Ruben Mercado (1997). This version does not include parameter updating and is therefore setup to be solved with the Solve: OLF command but not with the Solve: Compare command. thrift1 A version of the thrift0 model with a single uncertain parameter. The thrift0 model is a deterministic model of student finances by Evanchik (see above). thrift2 A version of the thrift0 model with five uncertain parameters. uncema This is a two-country model of Mexico and the U.S. which was developed by Alejandro Fonseca (1999). There are five state variables for each country (income, consumption, investment, imports and exports). With lags this econometric model becomes a control theory model with 15 states, 2 controls and 2 exogenous variables. wieghan This is a generic version of Volker Wieland’s (1997) adaptive control model which was modified for Hans Amman so that he could export a wieghan.dua file from Duali which could then be used as input for Dualpc software.

233

Page 236: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

wiestoch This is an OLF without updating version of Volker Wieland’s (1997a) adaptive control model with one state, one control and two uncertain parameters. It is designed to be solved with the Solve:OLF command but not the Solve: Compare command.

d. Stochastic with Measurement Error

abel

This model is like the Ch. 12 model except that it has two control variables rather than one and has ten unknown parameters rather than eight. It is the model which is used for the adaptive control experiments in Kendrick (1982).

ch12 A one control variable version of Andrew Abel's (1975) small macroeconomic model of the U.S. economy. The model is taken from Chapter 12 of Kendrick (1981). This model has eight uncertain parameters. islmtvme This is a simple IS-LM macroeconomic model from Amman and Kendrick (1999b) that is used for the “policy-to-parameter” effect in which changes in policy result in changes in the parameters of the model as suggested in Lucas (1976). The model has forward variables. islm3per This model is a smaller, i.e. three period version, of the islmtvme model.

234

Page 237: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

lee This is an OLF model of the Korean economy which was developed by Myong Hwal Lee (1998). It has five state variables, three control variables and 32 uncertain parameters. mjbsdk2 This is a model developed by Manohar J. Rao and Balwant Singh at the Reserve Bank of India in the Dualpc software. It was imported into Duali and modified somewhat for this purpose by David Kendrick. See Rao and Singh (1999). It has three state variables and two control variables. shih6 This is a model on intellectual property rights which was developed by Pa-Tai Shih (1997). This version treats the six coefficients in the B matrix as unknown parameters. shih18 This is a model on intellectual property rights which was developed by Pa-Tai Shih (1997). This version treats all of the 18 coefficients in the A and B matrices and the c vector as unknown parameters.

singh This is a two-state and two-control variable model of the Indian economy which was developed by Balwant Singh of the Reserve Bank of India. See Singh (1996).

wiemeas This is an OLF with updating version of Volker Wieland’s (1997a) adaptive control model with one state, one control and two uncertain parameters. It employs the Kalman filter and Monte Carlo runs and can be solved with the Solve:Compare command.

The following table is a list of the models currently in the library organized by the specification of the stochastic terms and including measures of the size of the models.

235

Page 238: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Table 14-1 Example Models by Stochastic Terms and Size

File Name States Controls Exog Term Uncer Vars Period Para Deterministic abelQLP 2 2 1 7 0 akforw 1 1 1 4 0

ch04 2 1 1 7 0

fair13 23 3 5 22 0

htdua01 12 2 2 15 0

klein1 9 2 3 11 0

park 24 1 4 23 0

parks-1 4 1 2 9 0

parks-2 17 2 3 9 0

pindcons 28 3 2 20 0

pindyck 28 3 2 20 0

raogrow 2 2 1 7 0

ricislm 3 2 1 12 0

sarwal 3 2 1 5 0

shih 4 5 4 8 0

taydua01 7 2 1 10 0

taydua02 7 2 1 10 0

thrift0 5 10 2 4 0

wieland 1 1 1 60 0

Additive Noise abeladd 2 2 1 7 0 ch04add 2 1 1 7 0

college 1 1 1 10 0

236

Page 239: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

File Name States Controls Exog V Term P Uncer P

Parameter Uncertainty akforwst 1 1 1 4 1 BrOlf 3 1 1 5 1

cautionH1 1 2 0 10 3

cautionH2 1 2 0 3 3

ch04stpu 2 1 1 7 2

ch07 1 1 1 2 1

ch11 1 1 1 2 1

htdua02 12 2 2 15 6

htdua03 12 2 2 15 6

islmtvp 2 2 1 12 2

leech4-2 13 1 0 20 0

pperturb 28 8 8 20 1

rmolfarg 2 2 1 7 10

thrift1 5 10 2 4 1

thrift2 5 10 2 4 5

uncema 15 2 2 10 2

wieghan 1 1 1 5 2

wiestoch 1 1 1 60 2

237

Page 240: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

File Name States Controls Exog V Term P Uncer P

Measurement Error abel 2 2 1 7 10

ch12 2 1 1 7 8

islm3per 2 2 1 3 2

islmtvme 2 2 1 12 2

lee 5 3 1 7 32

mjbsdk2 2 3 2 4 6

shih18 3 2 1 9 18

shih6 3 2 1 9 6

singh 2 3 1 5 10

wiemeas 1 1 1 60 2

238

Page 241: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Table 13-2 Functional Form Specifications File Sy Eq W Lambda xdes udes z Forward Deterministic abelQLP reg te dif con tv tv tv No akforw reg con con con con con Yes

ch04 reg te dif con tv tv con No

fair13 pin tv tv tv tv tv No

htdua01 reg con con con con con No

klein1 pin tv tv tv tv tv No

park pin tv tv tv tv tv No

parks-1 pin tv tv tv tv tv No

parks-2 pin tv tv tv tv tv No

pindcons pin con con tv tv tv No

pindyck pin tv tv tv tv tv No

raogrow reg te dif con tv tv tv No

ricislm reg con con tv tv con No

sarwal pin tv tv tv tv con Yes

shih reg tv tv tv tv tv No

taydua01 pin con con con con con Yes

taydua02 pin con con con con tv Yes

thrift0 reg te dif con tv tv con No

wieland reg con con con con con No

Stochastic with Additive Noise Terms abeladd reg te dif con tv tv tv No ch04add reg te dif con tv tv con No

college reg te dif con tv tv con No con = constant tv = time varying reg = regular pin = pindyck te dif = terminal different File Sy Eq W Lambda xdes udes z Forward

239

Page 242: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Stochastic with Uncertain Parameters akforwst reg con con con con con Yes BrOlf tv tv tv tv con No

cautionH1 reg con con con con con No

cautionH2 reg con con con con con No

ch04stpu reg te dif con tv tv con No

ch07 reg te dif con tv tv tv No

ch11 reg te dif con tv tv tv No

htdua02 reg con con con con con No

htdua03 reg con con con con con No

islmtvp reg con con con con con Yes

leech4-2 pin te dif con con con con No

pperturb reg con con con con con Yes

rmolfarg reg te dif con tv tv tv No

thrift1 reg te dif con tv tv con No

thrift2 reg te dif con tv tv con No

uncema reg tv tv tv tv tv No

wieghan reg te dif con tv tv tv No

wiestoch reg con con con con con No

240

Page 243: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

File Sy Eq W Lambda xdes udes z Forward

Stochastic with Measurement Error abel reg te dif con tv tv tv No

ch12 reg te dif con tv tv tv No

islm3per reg con con con con con Yes

islmtvme reg con con con con con Yes

lee reg te dif con tv tv tv No

mjbsdk2 reg te dif con tv tv tv No shih18 reg te dif con tv tv tv No

shih6 reg te dif con tv tv tv No

singh reg te dif con tv tv tv No

wiemeas reg te dif con tv tv tv No

241

Page 244: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Appendix A

Default Setting for Some Elements for the OLF Models with Monte Carlo and the Kalman Filter

The section of the Duali code that does comparisons among methods is in a file called compare.c. The main routine in this file is maincompare. When comparisons are done across methods the code for the mathematics for the “measurement error” is used for all methods. Therefore it is necessary to create some elements for the deterministic, additive error and uncertain parameter specifications that are then set to default values. This appendix outlines these elements and their default settings. The first element is the number of variables in the observation vector, y. This parameter is called ny in the code and is set equal to the number of state variables. Therefore the code contains a statement ny = n ; where n is the number of state variables in the model. Thus this statement assumes that the observation vector contains the same number of elements as the state vector. The notation used below follows that in pp. 92-93 in Ch. 10 of Kendrick (1981) except where noted. All of the elements below are set to zero by default. The elements from the observation equations are H the matrix which multiplies x in the observation equation R the covariance of the additive noise term in the observation equations ζ these zetas are random additive noise terms that are created by

the Monte Carlo routines using the R covariance matrix. These elements are called w’s in Ch. 10 of Kendrick (1981) The elements from the parameter evolution equations are D the matrix which multiplies the parameter vectorθ from the

previous period G the covariance of the additive noise in the parameter evolution equations

242

Page 245: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

η these etas are random additive noise terms that are created by

the Monte Carlo routines using the G covariance matrix. The elements from the augmented state vector covariance matrix initial conditions are the initial covariance of the state vector Σ 0|0

xx

the initial covariance between the state vector x and the parameter Σ 0|0θx

vector θ The difference between the mean initial state vector and the vector generated by the Monte Carlo routines using , i.e. Σ 0|0

xx

xodev the initial state vector difference

243

Page 246: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Appendix B Duali Source Code Files

The first portions of the Duali program were developed using the poppad example in Ch. 10 of Petzold (1992), Programming Windows 3.1. This example still provides some of the basic structure to the program and vestiges of the poppad example remain in the code - notably in the miscellaneous files list below. In understanding the Duali source code it is useful to divide the source files into a number of groups. 1. Main File duali.c contains the WinMain function but not much else 2. Windows Files winmain.c main window for Duali - a key file – it manages all menu

selection calls winarc.c acronym window windesc.c model description window winplot.c plots wintrans.c transfers matrix data from display input to storage as strings winresult.c displays results as tables of numbers These files outline the structure of Duali. The main window is the center of the program. Menu selections in this main window call other windows, dialog boxes, solution routines and disk input and output routines. This list above includes the acronym window which is used to input and modify these elements, the description window which is used to input and modify the model description, the plot window which is used for both single run and scenario plots, the transfer window which is used to input and modify matrix data and the

244

Page 247: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

results window which is used to display the solutions to the models as tables of numbers. The next most important set of files is the dialog box files. 3. Dialog Box Files Major dlgdatin.c controls matrix selection for inputs and modification

which is done in the wintrans.c file dlgdebug.c selection of matrices and vectors to print during QLP debug runs dlgdeops.c debug print for OLF and other methods using a property sheet dlgdisplay.c display of results options dlgname.c model name dialog box dlgopt.c functional forms options dlgplot.c plotting dlgpres.c preferences for results in display dlgsize.c model size Minor dlgabout.c about Duali dlgcauex.c caution example dlgdel.c used to specify the element to delete in some transformations dlgexam.c examples dlgimcol.c number of columns in an imported matrix dlgmc.c Monte Carlo options dlgnasce.c specify scenario names for plots dlgseed.c seeds for Monte Carlo runs 4. Solution Files qlp.c QLP solution olf.c OLF solution without updating and the Kalman filter compare.c manage the comparison of solutions across various methods, such as HCFR, CEWO, CE, OLF and OLIN fkandup.c subroutines for the fstep, kstep, sipro and update steps in model solutions

245

Page 248: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

invert.c matrix inversion matop.c matrix operations such as addition, multiplication, etc The routines in the qlp.c, olf.c and compare.c files first convert the matrix elements from character strings to floating point numbers. Then the model is solved and in some cases the results are converted back to character strings before the results are displayed. 5. Disk Input and Output Files dufile.c reads and writes the *.dui files - these files are used to store the models in a Duali format as character strings iomod.c input and output routines for reading and writing floating point

matrix data such as in the routines to import QLP and DUAL files to Duali

wrtdisk.c writes files to disk in the DUAL format so that they can be used as input for Dualpc

6. Plotting and Display of Results scenario.c manages plot scenarios plot.c manages single-run plots winresult.c window for results displayed as tables winplot.c window for plots 7. Utility Files init.c initialization of variables for Duali alloc.c allocates storage for matrices 7. Popfile Example Files The following files were copied from the poppad example in Ch. 10 of Petzold (1992) , Programming Windows 3.1., Third Edition, Microsoft Press and have not yet been fully developed but are available to add features in the future.

246

Page 249: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

dufind.c search and replace dufont.c font selection duprnt.c print management 8. Resource Files duali.rc main resource file for Duali 9. Header Files duali.h main header file for Duali dim.h sets maximums for some program elements such as some character

strings The rest of the header file correspond to a *.c file, viz. alloc.h is the header file for the allocation file alloc.c and invert.h is the header file for the inversion routines in file invert.c.

247

Page 250: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Appendix C Example Files in the Duali Model Library

This appendix provides an alphabetical list of the example files and the Message Box text that appears when they are loaded. filename Message Box text abel Abel: Two Controls: Meas Error abeladd Abel: Two Controls: Additive Noise abelQLP Abel: Two Controls: Deterministic akforw Am-Kend: Forw Vars: Deter akforwst Am-Kend: Forw Vars: Stoch BrOlf Breedlove Global Warming OLF CautionH1 Mercado Caution 10 Period CautionH2 Mercado Caution 3 Period ch04 Abel: One Control: Deterministic ch04add Abel: One Control: Additive Noise ch04stpu Abel: One Control: Parameter Uncertainty ch07 MacRae/Kendrick Ch 7 OLF ch11 MacRae/Kendrick Ch 11 Meas Er ch12 Abel: One Control: Meas Error college Save for College – Add Noise fair13 Fair/Park 3 Controls htdua01 Hall/Taylor QLP htdua02 Hall/Taylor OLF htdua03 Hall/Taylor Monte Carlo islm3per IS-LM Policy-to-Param 3 Per islmtvme IS-LM Policy-to-Param 10 Per islmtvp IS-LM Forward Variable klein1 Klein Model One lee Lee: Korea: 32 Uncer Params leech4-2 Lee: Korea: Liquidity Effect

248

Page 251: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

mjbsdk2 Rao/Singh: Macro: India park Fair/Park 1 Control parks-1 Park: U.S. Model parks-2 Park: U.S.- Japan pindcons Pindyck w Constant Penalties pindyck Pindyck w Time Var Penalties pperturb Paez: Ecuador raogrow Rao: Growth: India ricislm Ric Herbert - IS-LM rmolfarg Ruben Mercado OLF Argentina sarwal Sargent/Wallace shih Shih: Taiwan shih18 Shih: Intellect Prop 18 Coef shih6 Shih: Intellect Prop 6 Coef singh Singh: India taydua01 Taylor: Simulation taydua02 Taylor: Deter: RE thrift0 Evanchik: Student Fin: Deter thrift1 Evanchik: Stu Fin: OLF 1 Coef thrift2 Evanchik: Stu Fin: OLF 5 Coef uncema Fonseca: Mexico-US wieghan Wieland: Export to DUALPC wieland Wieland: Deterministic wiemeas Wieland: Meas Error wiestoch Wieland: OLF w/o Update

249

Page 252: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Appendix D Importing Data from Other Applications

Chapter 2 contains a discussion of the procedures for importing one matrix at a time into Duali. In contrast this appendix provides a description of methods for importing entire input files from other applications, namely a. QLP files for deterministic models b. DUAL files for deterministic and stochastic models. This chapter contains a discussion of the ability to import input files that were originally created to be used with the C/C++ version of the QLP software. Note here that “QLP” is used in two different ways in this book. To this point it has been used to mean a method in Duali for solving deterministic models. In contrast, in this appendix “QLP” is being used to refer to a software package that was one of the precursors of Duali, name the QLP software that was limited to solving deterministic models. The QLP software is only for deterministic models so this import option is limited to that class of models. The manual that describes the QLP input form is Kendrick (1992). In the following chapter there is a discussion of the facility to import deterministic control files that are in the format used by Dual and by Dualpc. The QLP option is reached via the File menu and is called “Import:QLP”. This option should be selected immediately after opening the Duali application. When this is done a dialog box will open in which the user can provide the name of the input file. For example the QLP input file for Hyung Jin Park’s version of Ray Fair’s linear model has the file name park.qlp. After the input file is selected and the dialog box is closed a notice will appear informing the user that the next dialog box will permit the selection of the file on which the input can be echo printed so that it can be checked. The extension “dbg” has been used for these files. Thus for the Park model one might name the file parkecho.dbg.

250

Page 253: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Be careful here not to name the echo print debug file the same as the input file since this will result in overwriting the input file. A dialog box will appear to inform the user when the importation has been completed; however, no debugging data will appear in the main window of Duali during this operation. If the importation does not proceed smoothly, look at the debug file to see if a partial output has been produced. This may provide an indication of where the error is occurring. Importation can be difficult. If you have problems, one option is to try importing some of the *.qlp files which are provided with the Duali system. If that works, then study carefully the format and style of the *.qlp file and be sure your input follows closely that format and style. Also, check to be sure that none of the numbers in your input run together. This will cause problems because the importation routine does not use a fixed format like F5.2 but rather looks for white space to separate numbers. Be careful of tabs. They can cause problems in the importation. If you are uncertain about tabs put your input file in an editor and turn on the “Show” option of paragraph returns and tabs. Then when you write the file back to the disk from the editor be careful that you write it as an ASCII files and not as a formatted file. Once the data has been read, it can be checked by selecting the various options under the Data menu. There will not be a model name, but the model size parameters should be correct. Also the Functional Form specifications should be correct. Acronyms will be assigned default values, i.e. numbers rather than names will be assigned. The user should replace these numbers with acronym character strings in order to facilitate the process of checking to be sure that the data has been imported properly for the matrices and vectors of the systems equations and the criterion function. When checking these elements there may be a slight delay between the selection of a matrix and its display if the matrices are large. Once the data has been read one can move immediately to solve the model by selecting the Solve: QLP option or Solve:QLP Print option. The Solve:QLP Print option is preferred at this stage because it permits the user to obtain the desired level of intermediate output. Also, the format preferences for results as discussed above can be used to obtain the display output in the form desired.

251

Page 254: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Once the model has been imported it can be saved with the File:Save As option. Then the user can proceed to modify the model by adding a model name, a description, any additional acronyms, etc. and then treating the model like one that had been manually entered into Duali. Two options that are not described in the QLP manual can be used in importing files to Duali, i.e. one can edit the input file before importation if it is desirable to make use of these options. These two options are in the pgc parameters that are used as option parameters in the QLP input file. The manual list only pgc[1] thru pgc[3]. However, two new options have been added to the Duali import capability. They are

pgc[4] = 1 is used to input the penalty matrices for the states in the form W and WN. In this form the penalty matrices for the states are the constant matrix W in all the periods before the terminal period and the matrix WN in the terminal period. Since the W and WN matrices are diagonal only a vector of these diagonal elements for each matrix is input. Thus the matrix

3 00 7⎡

⎣⎢

⎦⎥

is input as

37⎡

⎣⎢⎤

⎦⎥

pgc[4] = 0 is used to input the time varying state penalty matrix, WT. Here

again only the diagonal elements are input. So the time varying penalty matrices

3 00 7

4 00 9

8 00 5

⎣⎢

⎦⎥

⎣⎢

⎦⎥

⎣⎢

⎦⎥

are input as

3 4 87 9 5⎡

⎣⎢

⎦⎥

252

Page 255: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

pgc[5] = 1 is used to input a constant control penalty matrix, LAMBDA. As above only the diagonal elements are entered.

pgc[5] = 0 is used to input the usual time-varying control penalty matrix,

LAMBDAT. One use of the File:Import QLP capability is to prepare the QLP input matrices in a spreadsheet and then to import them to Duali. This facilitates ordinary data entry as well as the creation of the extrapolations that are frequently used for desired paths for state and control variables. Then the various matrices can be assembled into a QLP input file using an editor before being imported into Duali. An example of this is the work of Hyung Jin Park on a model of the U.S. economy of the type developed by Ray Fair. This model has 24 state variables, one control variable and 23 time periods and is thus about the same size and complexity as Pindyck’s model. However, the use of the QLP importation capability was more important with past version of Duali than with the present version because now there are single matrix importation capabilities as discussed in Chapter 2 and extensive model transformation capabilities as is discussed in Chapter 3. Finally, be aware that you can export a file in the QLP format by using the command File:Export QLP. Then you can modify the file in an editor and then import it again as described above.

253

Page 256: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

References

Abel, Andrew B. (1975), "A Comparison of Three Control Algorithms to the Monetarist-Fiscalist Debate," Annals of Economic and Social Measurement, Vol. 4, No. 2, pp. 239-252. Amman, Hans M. and David A. Kendrick (1992a), "A User's Guide for DUAL, A Program for Quadratic-Linear Stochastic Control Problems", Technical Paper 90-4 (Revised August 1992), Center for Economic Research, The University of Texas, Austin, Texas 78712. Amman, Hans M. and David A. Kendrick (1996), "Forward Looking Variables in Deterministic Control", Annals of Operations Research, Vol. 68, pp. 141-159. Amman, Hans M. and David A. Kendrick (1997), “Erratum – Active Learning: A Correction”, Journal of Economic Dynamics and Control, Vol. 21, No. 10, pp. 1613-1614. Amman, Hans M. and David A. Kendrick (1999a), “Linear Quadratic Optimization for Models with Rational Expectations”, forthcoming in Macroeconomic Dynamics. Amman, Hans M. and David A. Kendrick (1999b), “Mitigation of the Lucas Critique with Stochastic Control Methods”, working paper, Center for Applied Research in Economics, The University of Texas, Austin, Texas 78712. Chow, Gregory C. (1967), “Multiplier, Accelerator and Liquidity Preference in the Determination of National Income in the United States”, Review of Economics and Statistics, Vol. 49, No. 1, pp 1-15. Christiano, Lawrence J. and Martin Eichenbaum (1992), “Liquidity Effects and the Monetary Transmission Mechanism”, American Economic Review, Vol. 82, No. 2, pp. 346-353.

254

Page 257: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Christiano, Lawrence J. and Martin Eichenbaum (1995), “Liquidity Effect, Monetary Policy and the Business Cycle”, Journal of Money Credit and Banking, Vol. 27, pp. 1113-1136. Evanchik, Michel (1998), “Student Finance Model in Duali”, term paper in computational economics course in the Department of Economics, University of Texas, Austin, Texas, May, 1998. Fair, Ray C. (1984), Specification, Estimation, and Analysis of Macroeconometric Models, Harvard University Press, Cambridge, Mass. Fonseca, Alejandro (1999), “Macroeconomic Policy Coordination Between the US and Mexico, A Control Theory Analysis”, Ph.D. Dissertation, Department of Economics, The University of Texas, Austin, Texas. Hall, Robert E. and John B. Taylor (1993), Macroeconomics, 4th edition, W. W. Norton & Company, New York. Herbert, Ric D. (1998), Observers and Macroeconomic Systems, Kluwer Academic Publishers, Boston/Dordrecht/London. Hughes-Hallett, Andrew and Peter McAdam (eds) (1999), Analyses in Macroeconomic Modeling, Kluwer Academic Publishers, Boston/Dordrecht/London. Kendrick, David A. (1981), Stochastic Control for Economic Models, McGraw-Hill Book Company, New York. Kendrick, David A. (1982), “Caution and Probing in a Macroeconomic Model”, Journal of Economic Dynamics and Control, Vol. 4, No. 2, May 1982. Kendrick, David A. (1992), "QLP: A Program for Deterministic Quadratic-Linear Control Problems - C/C++ Version", Technical Paper 92-?, Center for Economic Research, The University of Texas, Austin, Texas 78712. Lee, Myong Hwal (1998), “Analysis of Optimal Macroeconomic Policy Design”, Ph.D. Dissertation, Department of Economics, The University of Texas, Austin, Texas 78712.

255

Page 258: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Lucas, Robert (1976), “Econometric Policy Evaluation: A critique”, In K. Brunner and A. H. Meltzer (editors), The Phillips Curve and the Labor Markets, 19-46, Supplemental series to the Journal of Monetary Economics. MacRae, Elizabeth Chase (1972), "Linear Decision with Experimentation", Annals of Economic and Social Measurement, Vol. 1, pp. 437-447. Mercado, Pedro Ruben (1997), Essays in Applied Macroeconomics: Computational and Econometric Model for Latin American Countries, Ph.D. Dissertation, Department of Economics, The University of Texas, Austin, Texas, 78712. Mercado, P. Ruben and David A. Kendrick (1998), "Caution in Macroeconomic Policy: Uncertainty and Relative Intensity of Policy", working paper, Center for Applied Research in Economics, The University of Texas, Austin, Texas. Mercado, P. Ruben and David A. Kendrick (1999), “Computational Methods for Macro Policy Analysis: Hall and Taylor’s Model in Duali”, Chapter 8 in Hughes-Hallett and McAdam (1999), pp. 179-206. Mercado, P. Ruben, David A. Kendrick and Hans M. Amman (1998), “Teaching Macroeconomics with GAMS”, Computational Economics, Vol. 12, No. 2, pp. 125-149. Paez, Pedro Francisco (1999), “An Optimal Control Framework for Alternative Economic Policies in Ecuador”, Ph.D. Dissertation, Department of Economics, The University of Texas, Austin, Texas 78712. Park, Hyung-Jin (1997), “A Control Theory Analysis of Macroeconomic Policy Coordination by the US, Japan and Korea”, Ph.D. Dissertation, Department of Economics, The University of Texas, Austin, Texas 78712. Pindyck, Robert S. (1973), Optimal Planning for Economic Stabilization, North Holland Publishing Co., Amsterdam. Rao, M. J. Manohar (1989), “Optimal Control of State-Space Models: Some Guideposts for Policy Formulations,” paper presented as a conference on Methods of Planning and

256

Page 259: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Policy Analysis for Mixed Economies, Indira Ghandi Institute of Development Research, Gen. Vaidya Marg, Goreganon (E), Bombay-400 065, India. Rao, M. J. Manohar and Balwant Singh (1999), “Some Empirical Results Relating to the Indian Economy”, Reserve Bank of India, Mumbai (Bombay), India. Sargent, Thomas J. and Neil Wallace (1975), "'Rational' Expectations, the Optimal Monetary Instruments, and the Optimal Money Supply Rule," Journal of Political Economy, Vol. 83, No. 2, pp. 241-254. Shih, Pai-Ta (1997), "Computational Analysis of Macroeconomic Policies on Income Inequality, Growth and Intellectual Property Rights", Ph.D. Dissertation, Department of Economics, The University of Texas, Austin, Texas 78712. Singh, Balwant (1996), “Design of Stabilization Policies for the Indian Economy in the Stochastic Control Framework,” working paper from the Reserve Bank of India, Bombay, India. See also his Ph.D. dissertation, Stabilization Policy and the Optimal Design of Macroeconometric Control Systems, Department of Economics, University of Bombay, Bombay 400 098, India. Taylor, John B. (1993), Macroeconomic Policy in a World Economy, W. W. Norton & Company, New York. Tucci, Marco (1989), Time Varying Parameters in Adaptive Control, Ph.D. Dissertation, Dept. of Economics, University of Texas, Austin, Texas, 78712. Tucci, Marco (1997), "Adaptive Control in the Presence of Time-Varying Parameters", Journal of Economic Dynamics and Control, Vol. 22, pp. 39-47. Tucci, Marco (1998), "The Nonconvexities Problem in Adaptive Control Models: A Simple Computational Solution", Computational Economics, Vol. 12, No. 3, pp. 203-222. Wieland, Volker (1997a) "Learning by Doing and the Value of Optimal Experimentation", working paper, Board of Governors of the Federal Reserve System, Washington, D.C. 20551.

257

Page 260: The Duali/Dualpc Software for Optimal Control Models… · The Duali/Dualpc Software for Optimal Control Models: User's ... Economics The University of Texas TP 92 ... and compiled

Wieland, Volker (1997b), "Monetary Policy and Uncertainty about the Natural Unemployment Rate", working paper, Board of Governors of the Federal Reserve System, April 13, 1997.

258