17.0 TRANSPROB Command The TRANSPROB command supports estimation of transfer probability models (Markov Probability Models) for up to 20 sates using alternative estimators of the transition probabilities. The possible alternative restricted and unrestricted estimators include classical, weighted, generalized inverse (first stage biased), two stage minumum absolute deviation by linear programing, maximul likelihood and Bayesian posterior estimators. Basic references for the methods and the underlying code are: - Lee, Judge, Zellner, "Estimating the Parameters of the Markov Probability Model from Aggregate Time Series Data," North Holland 1970. - Theil, H., "Statistical Decomposition Analysis" Chapter 5, North Holland 1972. General form of TRANSPROB command. B34SEXEC TRANSPROB parameters $ VAR Xvar1 Xvar2 $ HEADING =(' any text here ' ) $ WEIGHT VAL=(n1,n2,r1)(n1,n2,r1) $ PRIORI KALT=keyword PARM=(n1,n2,r1,r2)(n1,n2,r1,r2) $ RECURSIVE parameters $ DITTO $ DIT $ CLEAR $ SUMMARY TPRAM=(r1,r2,r3)$ FINISH $ B34SEEND$ The VAR and FINISH sentences are required. There can be more than one WEIGHT, PRIORI, RECURSIVE, DITTO, DIT, CLEAR and SUMMARY sentences. The second and optionally the third sentence must be either VAR or HEADING sentences. The last sentence must be the FINISH sentence. Sentences listed after the FINISH sentence will not be parsed. TRANSPROB sentence parameters. NT1 = n1 Sets number of time periods. Default = NOOB - IKILL where NOOB is number of observations in data and IKILL is set below. NT1 must be LE NOOB - IKILL. SS = n2 Sets either sample size or b34S variable where sample Vark size is read in. If ss = n2, then the sample size is n2 in all periods, otherwise the sample size is in variable Vark. SS is a required parameter. TOL=r1 Sets tolerence for matrix inversion. Default = 1.D-06. A max of 6 digits can be used. Format E6.1. KDROP=Vark Sets column (variable) to drop. ML and Byesian estimators require deletion of one column. If KDROP is not set, ML estimation will not be performed unless the recursive sentence has been supplied. KW = key Control assingment of weights. The default is CLASSICAL. key = CLASSICAL for classical least squares. key = ML for ML estimator. key = WEIGHTEDSS for weighted by SS(t)/Wj(t) key = USER User weights supplied on WEIGHT sentence. key = MEANW for weighted by mean proportions. key = MEANPROD for weight by products of mean proportions. key = DERIV for weighting by the derived weight from generalized inverse method. key = MSS for weighted by SS(t)/ SST(t) where SST(t)=Wj(t)*(1-Wj(t)) key = TWOSTAGEW for two stage weighting by estimated disturbance variance. KV = key Print control for dispersion matrix (X'MX)**-1. Default = NOPRINT. key = NOPRINT Skip printing. key = PRINTALL Print matrix at all stages. key = PRINT1 Print first stage (unrestricted). key = PRINT2 Print second stage (restricted). key = PRINTRF Print when restrictions are all fulfilled in the unrestricted estimator. KP = key Prediction and hypothesis testing. Default = NOPREDICT. key = NOPREDICT Do not predict. key = PREDICT Predict. key = PREDICT1 Predict first stage. key = PREDICT2 Predict second stage. key = PREDICTA Predict for the acceptable estimator. KEY1 = key Data listing control. Default = RAW. key = RAW Will print observed units and square of the sample size. key = TRANS Will print observed proportions and sample sizes. Observational data converted such that for each observation, sum equals one. KEY2 = key Weight matrix print control. Default = NOPRINT. key = NOPRINT Do not print weight matrix. key = PRINT Print weight matrix. key = PRINT2 Print weight matrix for second stage (estimated covariance matrix) only. KEY3 = key Cross product matrix (X'MX X'MY) printing. Default=NOPRINT. key = NOPRINT Do not print cross product matrices. key = PRINT Print at all stages. key = PRINT1 Print for the first stage only. key = PRINT2 Print for the second stage only. KEY4 = key Control for Printing Simplex tableau. Default=NOPRINT. key = NOPRINT Do not print. key = PRINTF Print first tableau for LP/QP model. key = PRINTL Print last tableau for LP/QP model. key = PRINTP Print if their is a problem such as linear dependency, degeneracy, looping etc for QP model. key = PRINTA Print all tableaus. Makes alot of output. KEY5 = n3 Option for printing determinant, interaction steps and right hand side of the simplex tableau. Default n3=0. n3 Determinant Iteration right side 0 no no no 1 no no yes 2 no yes yes 3 yes no no 4 yes no yes 5 yes yes yes KEY6 = n4 Scaling factor for weight matrix. Default n4=0. Max for n4 = 9. n4 = 0 Scaling factor = 1.0 . n4 = 1 Scaling factor = 10.0 . n4 = 2 Scaling factor = 100.0 . n4 = n Scaling factor = 10** n . KEY7 = key Option for computing restricted estimator. Default= NORES. key = NORES Do not compute restricted estimator. key = RES1 Compute for first stage only. key = RES2 Compute for second stage only. key = RESA Compute for all stages but invalid for KW=TWOSTAGEW. key = RESAPR1 Compute in all stages, print restricted by KEY4 in stage one. key = RESAPR2 Compute in all stages, print restricted by KEY4 in stage two. KEY8 = key Choice of iteration procedure. Default = LPSQRT. Note options LPSQRT and LPSUM take a great deal of space. key = LPSQRT Solve by LP weighted by the square root of column sum of M. key = LPSUM Solve by LP weighted by column sum of M. key = QP Solve by QP. key = QPBAYES Solve by QP for the Bayesian Estimator. KEY9 = key Output control. Default = NOSTORE. key = NOSTORE Output of model not stored for later use with SUMMARY option. key = STORE Output saved on unit 7. S matrix in format 9F8.4. For further information see Lee, Zellner and Judge. IKILL = n5 Delete n5 observations from sample. VAR sentence. VAR Xvar1 Xvar2 Xvar3 $ The VAR sentence specifies the number of states in the markov transition matrix. A Maximum of 20 states can be supplied. For work array size considerations, see below. If the data is in raw form, set KEY1=TRANS and B34S will convent the data so that it sums to 1. The VAR sentence is required and must be placed second. HEADING sentence. HEADING=('Any text up to 72 cols') $ The HEADING sentence optionally allows the user of specify a title. The HEADING and VAR sentences sentences should be specified as the 3rd and 2nd sentences respectively. WEIGHT sentence. WEIGHT VAL=(n1,n2,r1)(n1,n2,r1)$ If KW=USER, the WEIGHT sentence must be supplied to specify the weight matrix M in the objective function (y-Xp)'M(y-Xp). The WEIGHT sentence must come after the VAR or HEADING sentences. WEIGHT sentence parameters. VAL=(n1,n2,r1)(n1,n2,r1) $ n1 = row element, n2 = column element and r1 = weighting element M. PRIORI sentence. PRIORI KALT=keyword PARM=(n1,n2,r1,r2)(n1,n2,r1,r2) $ If prior knowledge is going to be incorporated to obtain the Bayesian estimator, the PRIORI sentence must be used. If the multivariate beta prior (KALT=MBETA) or the independent univariate prior (KALT=UPRIOR) is used, the paramaters n1 and n2 refer to the row and column in the transition matrix , r1 the transition matrix element a(n1,n2) and r2 the parameters of the beta distribution. The format for r1 and r2 is F15.4 or 15 digits. If the normal prior (KALT=NPRIOR) is used, r1 equals the prior mean and r2 is the prior variance. If the PRIORI sentence is used, it must come after the WEIGHT sentence. A max of 10 is allowed. (Note: In this release the NPRIOR option has been turned off) PRIORI sentence parameters. KALT=key key = MBETA for multivariate beta distribution. key = UPRIOR for independent univariate beta distribution. key = NPRIOR for normal prior distribution PARM=(n1,n2,r1,r2)(n1,n2,r1,r2) sets row (n1), column (n2), a(n1,n2) (r1) and a(n1) - a(n1,n2) (r2) values. For further detail see above. RECURSIVE sentence. The exact numerical solution for the ML and the Bayesian estimators may be obtained by a feedback procedure of recursive quadratic programing. If this is desired, the RECURSIVE sentence must follow the WEIGHT sentence, if present, and or the PRIORI sentence depending in whether the recursive solution is an ML or Bayesian estimator. Many of the RECRUSIVE sence options are the same as on the TRANSPROB sentence. RECURSIVE parameters $ NREC = n1 Sets the number of recursive iterations. This parameter is required. NST = n2 Sets tolerence limit. The tolerence limit is defined as the sum of all previous iterations of the absolute difference between two successive solutions. Note that the recursive option is terminated when either the NST or NREC limit is met. Other parameters allowed on the RECURSIVE sentence are coded the same as on the TRANSPROB sentence. These are KV, KP, KEY1, KEY2, KEY3, KEY4, KEY5, KEY6, KEY7, KEY8, KEY9. It is interesting to note that the initial solution for the exact ML estimate may not be necessary from the first approximated ML solutions. It is possible to use the classical estimate with no column deleted as an initial solution. The recursive solutions will converge to the same final exact estimate. It is recommended that the first approximate ML solution be used as the initial solution to reduce the number of recursive iterations. The user also should note that the last column of the transition matrix will be deleted automatically when the RECURSIVE sentence is used. DITTO and DIT sentences. For the Bayesian esimation, if a sequence of problems is to be computed with the same prior knowledge, the prior information must be provided on the PRIORI sentence. The second problem may use the DITTO or DIT sentences instead of another PRIORI sentence. If the DITTO sentence is used, the list of prior parameters will not be printed while the DIT sentence will print the parameters. CLEAR and SUMMARY sentences. If a set of problems is computed at one time in a sequence and the user wishes to summarize the estimates in terms of means, variances, standard deviations and true parameters, this is possible by using the CLEAR and SUMMARY sentences. The CLEAR sentence should be used at the beginning of the problems to be summarized. In the TRANSPROB sentence, the user must set KEY9 =STORE. The SUMMARY sentence must be placed after the sequence of problems. The true parameters are specified in the SUMMARY sentence, column by column in the parameter TPARM=( ). The number of parameters to be specified = NS * NS where NS is the number of variables specified in the VAR sentence. Usage notes: Transfer Probability analysis can only be run if the final number of states NS is LE NOOB where NOOB is the number of observations. When running close to the minimil limit it is important to check the eigenvalues to see if the largest characteristic root is in fact one. The usual setup for the TRANSPROB command is the TRANSPROB sentence, the VAR sentence and the FINISH sentence. Other sentences are optional. Space requirements for this program go up substantially if KEY8=LPSQRT or KEY8=LPSUM options are set. Total space, NSPACE, is calculated from the formula: 2*((((2*N96)+(3*N30))*N30) + (N96*(N96+2)) + N16 + 1 +(3*N30)=NSPACE where: N16=NS*NS N30=MAX0((NS+1), NOOB, N16) N96=(2*NS*NOOB) + N16 if KEY8 is QP or QPBAYES, then N96=NS*NOOB While the DITTO, CLEAR, SUMMARY and DIT sentences have been implemented for completeness, it is strongly recommended that the TRANSPROB sentence be called for each problem estimated. In this mode of operation there is only one each of each of the supported sentences supplied. For further detail on the TRANSPROB command, see Lee-Judge- Zellner. The control words used in the TRANSPROB command follow closely the key words discussed in Zellner, Lee and Judge. Sample problem from Zellner, Lee and Judge. b34sexec data heading=('test data from lee-judge-zellner')$ input var1 var2 sampsize $ pgmcards$ .50 .50 10.0 .75 .25 10.0 .88 .12 10.0 .94 .06 10.0 .97 .03 10.0 b34sreturn b34seend$ b34sexec transprob kdrop=var2 kw=ml kv=print1 kp=predict key1=trans ss=sampsize key3=print key4=printp key5=2 key7=resa key8=qp$ heading=('Test data from text')$ var var1 var2 $ priori kalt=mbeta parm= (1,1,99.0, 1.0) (1,2, 1.0, 99.0) (2,1,50.0, 50.0) (2,2,50.0, 50.0) $ recursive nrec=6 nst=3 kp=predicta key1=trans key4=printp key5=2 key7=resa key8=qp$ finish $ b34seend $