Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Random and Exogenous Variation

FormulaDistribution

The netWorks application provides a general function writing capability with the FormulaDistribution selection, shown in the combo box in Figure B.1. If you select FormulaDistribution and then click the  {Parameters}
button, a Formula Manager window (as shown in Figure B.4) is displayed.


formulapal.gif (72115 bytes)

Figure B.4: FormulaDistribution Manager and Palette

From this window, you can write a function that returns a number that is used as the sample from the FormulaDistribution. For example, suppose you wanted a mixture distribution with density function

f(x)=.5 f1(x) + .5 f2(x)
where f1(x) is exponential with parameter \lambda and f2(x) is a user-defined formula. Figure B.5 shows a portion of the four windows needed to express this.


cpformuladist.gif (114004 bytes)

Figure B.5: An Example of a Mixture Distribution

The bottom-most window is the FormulaDistribution Formula window, and it contains the conditional element condexp.gif (184 bytes). Editing this element provides you with the capability to specify the condition condition.gif (407 bytes).

If the condition evaluates to TRUE, it returns a value from the formula in the True Expression window randvar.gif (190 bytes), which is the appropriate exponential random variable. If it evaluates to FALSE, it returns a value from the user-defined formula in the False Expression window formula.gif (229 bytes).

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.