Chapter Contents Previous Next
 The MODEL Procedure

## Goal Seeking: Solving for Right-Hand-Side Variables

The process of computing input values 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 containing values for the remaining variables.

Consider the following demand model for packaged rice

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 using the following simulated data and PROC MODEL statements:
   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.
   proc model data=demand ;
demand = a1 - a2 * price ** (2/3) + a3 * income;
fit demand / outest=demest;
run;

The desired price is then determined using the following PROC MODEL statement:
       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 14.68.

 The MODEL Procedure Single-Equation Simulation

 Observation 1 Iterations 6 CC 0 ERROR.demand 0

 Solution Values price 33.59016

Figure 14.68: Goal Seeking, SOLVEPRINT Output

The output indicates that it took 6 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 14.69 indicates that the sales target of 100,000 units is not attainable according to this model.

 The MODEL Procedure Single-Equation Simulation

 NOTE: 3 parameter estimates were read from the ESTDATA=DEMEST data set.

 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.

 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 1 Iteration 1 CC -1.000000 Missing 1

 Iteration Errors - Missing.

 Observation 1 Iteration 1 CC -1.000000 Missing 1

 ERROR: 2 execution errors for this observation

 NOTE: Check for missing input data or uninitialized lags.

 (Note that the LAG and DIF functions return missing values for the initial lag starting observations. This is a change from the 1982 and earlier versions of SAS/ETS which returned zero for uninitialized lags.)

 NOTE: Simulation aborted.

Figure 14.69: Goal Seeking, Convergence Failure

The program data vector indicates that even with PRICE nearly 0 (4.462312E-22) the demand is still 4,164 less than the goal. You may need to reformulate your model or collect more data to more accurately reflect the market response.

 Chapter Contents Previous Next Top