1. Trang chủ
  2. » Tài Chính - Ngân Hàng

SAS/ETS 9.22 User''''s Guide 120 pptx

10 289 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 293,91 KB

Nội dung

1182 ✦ Chapter 18: The MODEL Procedure Figure 18.75 Solve Step Summary Output The MODEL Procedure Model Summary Model Variables 1 Parameters 3 Equations 1 Number of Statements 1 Program Lag Length 1 Model Variables LHUR Parameters(Value) a(0.010708) b(-0.478849) c(0.929304) Equations LHUR The second page of output, shown in Figure 18.76, gives more information on the failed observation. Figure 18.76 Solve Step Error Message The MODEL Procedure Dynamic Single-Equation Forecast ERROR: Solution values are missing because of missing input values for observation 144 at NEWTON iteration 0. NOTE: Additional information on the values of the variables at this observation, which may be helpful in determining the cause of the failure of the solution process, is printed below. Observation 144 Iteration 0 CC -1.000000 Missing 1 Iteration Errors - Missing. The MODEL Procedure Dynamic Single-Equation Forecast Listing of Program Data Vector _N_: 144 ACTUAL.LHUR: . ERROR.LHUR: . IP: . LHUR: 7.10000 PRED.LHUR: . a: 0.01071 b: -0.47885 c: 0.92930 NOTE: Simulation aborted. From the program data vector, you can see the variable IP is missing for observation 144. LHUR could not be computed, so the simulation aborted. The solution summary table is shown in Figure 18.77. Solution Mode Output ✦ 1183 Figure 18.77 Solution Summary Report The MODEL Procedure Dynamic Single-Equation Forecast Data Set Options DATA= SASHELP.CITIMON OUT= SIM Solution Summary Variables Solved 1 Forecast Lag Length 1 Solution Method NEWTON CONVERGE= 1E-8 Maximum CC 0 Maximum Iterations 1 Total Iterations 143 Average Iterations 1 Observations Processed Read 145 Lagged 1 Solved 143 First 2 Last 145 Failed 1 Variables Solved For LHUR This solution summary table includes the names of the input data set and the output data set followed by a description of the model. The table also indicates that the solution method defaulted to Newton’s method. The remaining output is defined as follows. Maximum CC is the maximum convergence value accepted by the Newton procedure. This number is always less than the value for the CONVERGE= option. Maximum Iterations is the maximum number of Newton iterations performed at each observation and each replication of Monte Carlo simulations. Total Iterations is the sum of the number of iterations required for each observation and each Monte Carlo simulation. Average Iterations is the average number of Newton iterations required to solve the system at each step. Solved is the number of observations used times the number of random replications selected plus one, for Monte Carlo simulations. The one additional simulation is the original unperturbed solution. For simulations that do not involve Monte Carlo, this number is the number of observations used. 1184 ✦ Chapter 18: The MODEL Procedure Summary Statistics The STATS and THEIL options are used to select goodness-of-fit statistics. Actual values must be provided in the input data set for these statistics to be printed. When the RANDOM= option is specified, the statistics do not include the unperturbed (_REP_=0) solution. STATS Option Output The following statements show the addition of the STATS and THEIL options to the model in the previous section: proc model data=sashelp.citimon; parameters a 0.010708 b -0.478849 c 0.929304; lhur= 1/(a * ip) + b + c * lag(lhur) ; solve lhur / out=sim dynamic stats theil; range date to '01nov91'd; run; The STATS output in Figure 18.78 and the THEIL output in Figure 18.79 are generated. Figure 18.78 STATS Output The MODEL Procedure Dynamic Single-Equation Simulation Solution Range DATE = FEB1980 To NOV1991 Descriptive Statistics Actual Predicted Variable N Obs N Mean Std Dev Mean Std Dev LHUR 142 142 7.0887 1.4509 7.2473 1.1465 Statistics of fit Mean Mean % Mean Abs Mean Abs RMS RMS % Variable N Error Error Error % Error Error Error LHUR 142 0.1585 3.5289 0.6937 10.0001 0.7854 11.2452 Statistics of fit Variable R-Square Label LHUR 0.7049 UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS The number of observations (Nobs), the number of observations with both predicted and actual values nonmissing (N), and the mean and standard deviation of the actual and predicted values of the determined variables are printed first. The next set of columns in the output are defined as follows: Solution Mode Output ✦ 1185 Mean Error 1 N P N j D1 . Oy j  y j / Mean % Error 100 N P N j D1 . Oy j  y j /=y j Mean Abs Error 1 N P N j D1 j Oy j  y j j Mean Abs % Error 100 N P N j D1 j. Oy j  y j /=y j j RMS Error q 1 N P N j D1 . Oy j  y j / 2 RMS % Error 100 q 1 N P N j D1 Oy j  y j /=y j / 2 R-square 1  SSE=CSSA SSE P N j D1 . Oy j  y j / 2 SSA P N j D1 .y j / 2 CSSA SSA   P N j D1 y j Á 2 Oy predicted value y actual value When the RANDOM= option is specified, the statistics do not include the unperturbed (_REP_=0) solution. THEIL Option Output The THEIL option specifies that Theil forecast error statistics be computed for the actual and predicted values and for the relative changes from lagged values. Mathematically, the quantities are Oyc D . Oy  lag.y//=lag.y/ yc D .y  lag.y//=lag.y/ where Oyc is the relative change for the predicted value and yc is the relative change for the actual value. 1186 ✦ Chapter 18: The MODEL Procedure Figure 18.79 THEIL Output Theil Forecast Error Statistics MSE Decomposition Proportions Corr Bias Reg Dist Var Covar Variable N MSE (R) (UM) (UR) (UD) (US) (UC) LHUR 142 0.6168 0.85 0.04 0.01 0.95 0.15 0.81 Theil Forecast Error Statistics Inequality Coef Variable U1 U Label LHUR 0.1086 0.0539 UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS Theil Relative Change Forecast Error Statistics Relative Change MSE Decomposition Proportions Corr Bias Reg Dist Var Covar Variable N MSE (R) (UM) (UR) (UD) (US) (UC) LHUR 142 0.0126 -0.08 0.09 0.85 0.06 0.43 0.47 Theil Relative Change Forecast Error Statistics Inequality Coef Variable U1 U Label LHUR 4.1226 0.8348 UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS The columns have the following meaning: Corr (R) is the correlation coefficient, , between the actual and predicted values.  D cov.y; Oy/  a  p where  p and  a are the standard deviations of the predicted and actual values. Bias (UM) is an indication of systematic error and measures the extent to which the average values of the actual and predicted deviate from each other. .E.y/  E. Oy// 2 1 N P N tD1 .y t  Oy t / 2 Reg (UR) is defined as . p     a / 2 =MSE. Consider the regression y D ˛ C ˇ Oy If O ˇ D 1, UR will equal zero. Goal Seeking: Solving for Right-Hand-Side Variables ✦ 1187 Dist (UD) is defined as .1   2 / a  a =MSE and represents the variance of the residuals obtained by regressing yc on Oyc. Var (US) is the variance proportion. US indicates the ability of the model to replicate the degree of variability in the endogenous variable. US D . p   a / 2 MSE Covar (UC) represents the remaining error after deviations from average values and average variabilities have been accounted for. UC D 2.1  / p  a MSE U1 is a statistic that measures the accuracy of a forecast defined as follows: U1 D p MSE q 1 N P N tD1 .y t / 2 U is the Theil’s inequality coefficient defined as follows: U D p MSE q 1 N P N tD1 .y t / 2 C q 1 N P N tD1 . Oy t / 2 MSE is the mean square error. In the case of the relative change Theil statistics, the MSE is computed as follows: MSE D 1 N N X tD1 . Oyc t  yc t / 2 More information about these statistics can be found in the references Maddala (1977, 344–347) and Pindyck and Rubinfeld (1981, 364–365). Goal Seeking: Solving for Right-Hand-Side Variables The process of computing input values that are needed to produce target results is often called goal seeking. To compute a goal-seeking solution, use a SOLVE statement that lists the variables you want to solve for and provide a data set that contains values for the remaining variables. Consider the following demand model for packaged rice quantity demanded D ˛ 1 C ˛ 2 price 2=3 C ˛ 3 i ncome where price is the price of the package and income is disposable personal income. The only variable the company has control over is the price it charges for rice. This model is estimated by using the following simulated data and PROC MODEL statements: 1188 ✦ Chapter 18: The MODEL Procedure data demand; do t=1 to 40; price = (rannor(10) +5) * 10; income = 8000 * t ** (1/8); demand = 7200 - 1054 * price ** (2/3) + 7 * income + 100 * rannor(1); output; end; run; data goal; demand = 85000; income = 12686; run; The goal is to find the price the company would have to charge to meet a sales target of 85,000 units. To do this, a data set is created with a DEMAND variable set to 85000 and with an INCOME variable set to 12686, the last income value. The desired price is then determined by using the following PROC MODEL statements: proc model data=demand outmodel=demandModel; demand = a1 - a2 * price ** (2/3) + a3 * income; fit demand / outest=demest; solve price / estdata=demest data=goal solveprint; run; The SOLVEPRINT option prints the solution values, number of iterations, and final residuals at each observation. The SOLVEPRINT output from this solve is shown in Figure 18.80. Figure 18.80 Goal Seeking, SOLVEPRINT Output The MODEL Procedure Single-Equation Simulation Observation 1 Iterations 6 CC 0.000000 ERROR.demand 0.000000 Solution Values price 33.59016 The output indicates that it took six Newton iterations to determine the PRICE of 33.5902, which makes the DEMAND value within 16E–11 of the goal of 85,000 units. Consider a more ambitious goal of 100,000 units. The output shown in Figure 18.81 indicates that the sales target of 100,000 units is not attainable according to this model. data goal; demand = 100000; Numerical Solution Methods ✦ 1189 income = 12686; run; proc model model=demandModel; solve price / estdata=demest data=goal solveprint; run; Figure 18.81 Goal Seeking, Convergence Failure The MODEL Procedure Single-Equation Simulation ERROR: Could not reduce norm of residuals in 10 subiterations. ERROR: The solution failed because 1 equations are missing or have extreme values for observation 1 at NEWTON iteration 1. Observation 1 Iteration 1 CC -1.000000 Missing 1 The MODEL Procedure Single-Equation Simulation Listing of Program Data Vector _N_: 12 ACTUAL.demand: 100000 ERROR.demand: . PRED.demand: . a1: 7126.437997 a2: 1040.841492 a3: 6.992694 demand: 100000 income: 12686 price: -0.000172 @PRED.demand/@pri: . The program data vector with the error note indicates that even after 10 subiterations, the norm of the residuals could not be reduced. The sales target of 100,000 units are unattainable with the given model. You might need to reformulate your model or collect more data to more accurately reflect the market response. Numerical Solution Methods If the SINGLE option is not used, PROC MODEL computes values that simultaneously satisfy the model equations for the variables named in the SOLVE statement. PROC MODEL provides three iterative methods, Newton, Jacobi, and Seidel, for computing a simultaneous solution of the system of nonlinear equations. Single-Equation Solution For normalized form equation systems, the solution either can simultaneously satisfy all the equations or can be computed for each equation separately, by using the actual values of the solution variables in the current period to compute each predicted value. By default, PROC MODEL computes 1190 ✦ Chapter 18: The MODEL Procedure a simultaneous solution. The SINGLE option in the SOLVE statement selects single-equation solutions. Single-equation simulations are often made to produce residuals (which estimate the random terms of the stochastic equations) rather than the predicted values themselves. If the input data and range are the same as that used for parameter estimation, a static single-equation simulation reproduces the residuals of the estimation. Newton’s Method The NEWTON option in the SOLVE statement requests Newton’s method to simultaneously solve the equations for each observation. Newton’s method is the default solution method. Newton’s method is an iterative scheme that uses the derivatives of the equations with respect to the solution variables, J, to compute a change vector as y i D J 1 q.y i ; x; Â/ PROC MODEL builds and solves J by using efficient sparse matrix techniques. The solution variables y i at the ith iteration are then updated as y iC1 D y i C d  y i where d is a damping factor between 0 and 1 chosen iteratively so that kq.y iC1 ; x; Â/k < kq.y i ; x; Â/k The number of subiterations allowed for finding a suitable d is controlled by the MAXSUBITER= option. The number of iterations of Newton’s method allowed for each observation is controlled by MAXITER= option. See Ortega and Rheinbolt (1970) for more details. Jacobi Method The JACOBI option in the SOLVE statement selects a matrix-free alternative to Newton’s method. This method is the traditional nonlinear Jacobi method found in the literature. The Jacobi method as implemented in PROC MODEL substitutes predicted values for the endogenous variables and iterates until a fixed point is reached. Then necessary derivatives are computed only for the diagonal elements of the jacobian, J. If the normalized form equation is y D f.y; x; Â/ the Jacobi iteration has the form y iC1 D f.y i ; x; Â/ Numerical Solution Methods ✦ 1191 Seidel Method The Seidel method is an order-dependent alternative to the Jacobi method. The Seidel method is selected by the SEIDEL option in the SOLVE statement. The Seidel method is like the Jacobi method except that in the Seidel method the model is further edited to substitute the predicted values into the solution variables immediately after they are computed. Seidel thus differs from the other methods in that the values of the solution variables are not fixed within an iteration. With the other methods, the order of the equations in the model program makes no difference, but the Seidel method might work much differently when the equations are specified in a different sequence. Note that this fixed point method is the traditional nonlinear Seidel method found in the literature. The iteration has the form y iC1 j D f. O y i ; x; Â/ where y iC1 j is the jth equation variable at the ith iteration and O y i D .y iC1 1 ; y iC1 2 ; y iC1 3 ; : : :; y iC1 j 1 ; y i j ; y i j C1 ; : : :; y i g / 0 If the model is recursive, and if the equations are in recursive order, the Seidel method converges at once. If the model is block-recursive, the Seidel method might converge faster if the equations are grouped by block and the blocks are placed in block-recursive order. The BLOCK option can be used to determine the block-recursive form. Jacobi and Seidel Methods with General Form Equations Jacobi and Seidel solution methods support general form equations. There are two cases where derivatives are (automatically) computed. The first case is for equations with the solution variable on the right-hand side and on the left-hand side of the equation y i D f .x; y i / In this case the derivative of ERROR. y with respect to y is computed, and the new y approximation is computed as y iC1 D y i  f .x; y i /  y i @.f .x; y i /  y i /=@y The second case is a system of equations that contains one or more EQ. var equations. In this case, a heuristic algorithm is used to make the assignment of a unique solution variable to each general form equation. Use the DETAILS option in the SOLVE statement to print a listing of the assigned variables. Once the assignment is made, the new y approximation is computed as y iC1 D y i  f .x; y i /  y i @.f .x; y i /  y i /=@y . Vector _N_: 12 ACTUAL.demand: 100000 ERROR.demand: . PRED.demand: . a1: 7126.43 799 7 a2: 1040.841 492 a3: 6 .99 2 694 demand: 100000 income: 12686 price: -0.000172 @PRED.demand/@pri: . The program. THEIL output in Figure 18. 79 are generated. Figure 18.78 STATS Output The MODEL Procedure Dynamic Single-Equation Simulation Solution Range DATE = FEB 198 0 To NOV 199 1 Descriptive Statistics Actual. data=sashelp.citimon; parameters a 0.010708 b -0.4788 49 c 0 .92 9304; lhur= 1/(a * ip) + b + c * lag(lhur) ; solve lhur / out=sim dynamic stats theil; range date to '01nov91'd; run; The STATS output in

Ngày đăng: 02/07/2014, 15:20

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN