Example Models and Libraries
This chapter describes the example models and libraries that are provided with Analytica.
Congratulations on completing the Analytica Tutorial. You are now ready to begin creating your own models.
For more detailed information on Analytica, see the Analytica User Guide. It is a reference on all aspects of Analytica, including descriptions of all available functions.
Within the Analytica folder are folders titled Example Models and Libraries, which contain a variety of Analytica models, including the examples illustrated in the Analytica User Guide. These resources are useful to include when building your own models. Many of the example models were created by users just like you. These models contain a wealth of ideas on using Analytica for practical applications. You should investigate these examples to see some of the different ways in which models can be constructed.
If you create models that you feel would be helpful or interesting to others, please send them to us for inclusion in a future Example Models folder; see the end of this chapter.
To get to the Example Models folder, select File → Open, then press the Example Models button at the top left:
The Example Models folder is subdivided into these folders:
- Business Examples
- Data Analysis
- Decision Analysis
- Dynamic Models
- Engineering
- Function Examples
- Optimizer Examples
- Risk Analysis
- Tutorial Examples
- User Guide Examples
Business Examples
Bond Model: This model takes typical bond purchase inputs (purchase price, par value, interest rate, and life to maturity) and calculates bond cash flows, current yield, and yield to maturity.
Breakeven Analysis: This model is an example of a breakeven analysis of a set of revenue levels, when the fixed expenses are set at one amount and the variable expenses are a constant fraction of revenue.
Expected R&D Project Value: This model evaluates and compares the expected commercialization value of multiple proposed R&D projects.
Financial Statement Templates: This model contains a complete set of standard financial statements: a profit and loss statement, balance sheet, and cash flow statement. It provides a step-by-step guide to using these templates to generate your own financial statements. You can enter values into the existing template and modify the variable definitions to reflect your own accounting standards.
Market Model: This model explores a market for a new product, and the pricing and advertising budget decisions involved. This example also shows the use of “forms” for receiving input and presenting output for users of the model.
Plan_Schedule_ Control: This model takes input data for activity paths required to complete a project, and calculates vari- ous outputs describing the critical path, timing, and costs for project completion.
Project Portfolio Planner: This model evaluates and prioritizes a portfolio of projects based on either the estimated net present value or a multi-attribute score, based on strategy fit, staff development, the generation of public goodwill, and estimated net revenue.
Sales Effectiveness: This model evaluates the effects of unit price on salesmen head count and production capacity. The model contains an example of taking user estimates of uncertainty in a standard high- medium-low form, and transforming those inputs into a continuous distribution for propagation through the model. Derived from Principles of Systems by Jay W. Forrester, 1968, ISBN 0-915299-87-9.
Subscriber Pricing: This model determines the amount of revenue needed on a monthly basis from each subscriber of a service to just meet the weighted average cost of capital of the firm from the service release date to the end of the study horizon. In other words, it calculates the monthly unit revenue rate required from each subscriber of a service to give a return on investment at the end of the study horizon that is equal to the weighted average cost of capital of the firm.
Data Analysis
Bootstrapping: Bootstrapping is a technique for estimating the confidence in a statistical estimator. This model demonstrates how a distribution for an estimated statistic can be obtained by resampling repeat- edly.
Kmeans Clustering: This model shows an example of scatter plots in Analytica. A K-means clustering algorithm (where K is the number of clusters) is applied to some random data to partition points into groups (clusters) of similar points. This model also demonstrates the Iterate function.
Moving Average Example: This is a simple model that shows how to compute the moving average for a data stream. It defines a Moving Average function you can use.
Multidimensional Scaling: This model performs multidimensional scaling. It takes as input N, which is the dimensionality of the problem, and Distances, which is an NxN symmetric matrix of distances (or dissimilarities). It calculates and outputs a two-dimensional set of N points XY (or separately as Xcoord and Ycoord) that best approximates the spatial layout of points that could generate the input distances. Reference: Multivariate Analysis by K.V. Mardia, J.T. Kent, and J.M. Bibby, Academic Press, Lon- don, 1979, Section 14.2.2, page 400. Model supplied by Michael L. Thompson.
Principle Components : Principal components analysis (PCA) is a technique used to reduce multidimensional data sets to lower dimensions for analysis. PCA involves computing the eigenvalue decomposition or singular value decomposition of a data set. This model shows how to find the principle components in a uses an eigenvalue decomposition to compute the principle components of the covariance matrix of historical stock prices.
Regression Examples: This model demonstrates the use of generalized linear regression by best fit curves of various function forms to a set of (x,y) points. It includes:
- Linear regression
- Quadratic regression
- Polynomial regression
- Discrete Fourier series
- Regression with redundant basis
- Regression using a large arbitrary collection of terms (useful in the situation where you do not have any reason to prefer one functional form over another)
- An auto-regressive series
Decision Analysis
This folder includes models that illustrate the discipline of decision analysis.
Two Branch Party Tree: The author of this model wants to throw a party, and can’t decide where to throw it. This model shows how to model a two-branch decision tree in Analytica.
Beta Updating: This model uses the beta distribution for the Bayesian update of beliefs about the probability that a coin will come up heads.
Biotech R&D Portfolio: This multi-project R&D evaluation models a typical R&D decision problem that might be faced by a biogenetic company.
Diversification Illustration: This model is an example of a Blitzogram™, which is one way to display the effect of diversifying over a growing set of investments. The example from the model is taken from “Blizograms - Interactive Histograms” in Informs Transactions on Education, Vol. 1., No. 2 (Jan. 2001) by Sam Sav- age. For further information, consult:
- “Beat The Odds: Understand Uncertainty” at http://www.linuxriot.com/article/showArticle.jhtml?articleId=17700622
- Sam Savage’s web site: http://drsamsavage.com
Expected Value of Sampling Information (EVSI): The EVSI for further treatment trials model computes the EVSI, a measure of how much value would be obtained from a sample of observations prior to making a decision. In this model, a drug approval agency must decide whether to approve a certain new treatment. They have the option of requesting additional clinical trials before making the decision. The EVSI captures the expected value of the information that would be obtained from the additional trials.
Gibbs Sampling in Bayesian Network: This model solves a Bayesian network using the Gibbs sampling method, also referred to as Sto- chastic Simulation. It is an instance of Markov Chain Monte Carlo simulation. This implementation runs multiple simulations simultaneously. You can specify observations for any subset of variables in the model (using the pull-down menus), and compute the posterior probabilities for any of the other variables. For more on this technique, see S. L. Lauritzen and D. J. Spiegelhalter, “Local Computations with Probabilities on Graphical Structures and Their Application to Expert Systems,” Journal Royal Statistical Society Series B50:2, 1984, p. 157-224.
LEV R&D Strategy: This example models R&D decision analysis for investment strategy among several choices of powerplants for a low emissions vehicle (LEV).
Marginal Analysis for Control of SO2 Emissions: This model demonstrates a marginal benefit/cost analysis to determine the policy alternative that leads to the most economically efficient level of cleanup.
Multi-attribute Utility Analysis: This model is an example of a multi-attribute utility analysis for cars, showing how to analyze an array of cars across an array of attributes, where different drivers assign differing weights to the importance of each attribute.
Newton-Raphson Method: This model implements the Newton-Raphson (or simply Newton’s) method, one of the most pow- erful and well-known numerical methods for finding the root of f(x)=0.
Nonsymmetric Tree: This model uses decision tree terminology to provide an example asymmetric decision tree in Analytica.
Party With Forecast: This model presents a problem facing a party host. In the face of uncertain weather, what is the best location to hold a party? The value the host assigns to the party is a function of both the location chosen and the weather outcome. This model augments the basic party model in order to show the value of imperfect information — in this case, a weather forecast — using Bayesian updating.
Plane catching decision with EVIU: The Expected Value of Including Uncertainty (EVIU) expresses the improvement in decision quality obtained when we include uncertainty as probability distributions in our model, compared to using only deterministic estimates for parameters. This model illustrates how EVIU is computed using a model to assess what time I should leave my home to catch a flight at the airport.
Probability of Gaussian Region (Importance Sampling): This model demonstrates the technique of importance sampling. Importance sampling is a variant of Monte Carlo sampling that can be used for extremely rare event sampling. Straight Monte Carlo with finite sample sizes will provide very low coverage of regions with very low probability. This example demonstrates by estimating the probability of a very small region within a Gaussian distribution.
Supply and Demand: This model calculates the required supply level to maximize profit when the profit function is asymmetric around the average demand value.
Tornado Diagrams: A tornado diagram is a common tool used to depict the sensitivity of a result to changes in selected variables. The fundamental analysis behind a tornado diagram consists of varying only one input variable at a time, keeping all other variables at their nominal values. Typically, a low and a high value are selected for each input, and the output variable is computed while only one variable varies at a time. This example model shows two methods for selecting high and low values: 1. By varying all inputs by the same relative amount, e.g., low=90% of nominal, high=110% of nominal, or 2. By varying all inputs between two given fractiles. This only makes sense if your inputs are uncertain variables. Example: low=10% fractile, high=90% fractile, nominal=50% fractile.
Upgrade Decision: This model represents a decision often faced in today’s world: which technology to purchase now, in the face of uncertain future products and prices.
Dynamic Models
This folder includes models that use Analytica’s Dynamic() function for performing dynamic simulation (modeling with cyclic dependencies).
Disease establishment: This model forecasts the population of fish and the establishment of a contagious viral disease within the population over time.
Leveling: This example levels staff efforts over time according to staff available, computing both the work done over time and idle time.
Markov Chain: This model demonstrates how to simulate a Markov process using dynamic time. The example estimates the number of hospital patients over time, modeled as a Markov process.
Mass-Spring-Damper: This model simulates a typical free mass-spring-damper system. The term “free system” means that there is no time-dependent driving force or displacement acting on the mass. Ordinarily solutions to such a system are determined from a set of homogeneous second-order differential equations accompanied by the appropriate initial conditions. In this model, the kinematic variables (displacement, velocity, and acceleration) are related to the typical kinematic equations, and the dynamic variables (spring force and damper force) are related to the acceleration and the system mass by Newton’s second law. You input the various initial state conditions (spring constant, damper constant, mass, initial displacement, and initial velocity) and the run time of the model. The graphical solutions generated by this dynamic model are comparable to the solutions determined by the corresponding differential equations.
Optimal Path Dynamic Programming: This model demonstrates a simple dynamic programming solution to a sequential decision problem. It computes the optimal finite-time step path to take in a deterministic environment where a known reward payout is given in the final time step and each transition has a known cost.
Parking Space Selection: A simple dynamic programming example, illustrating the solution to a sequential decision problem with uncertainty. You are to find the best parking space to minimize the time needed to get to your restaurant. The example demonstrates the use of the Dynamic() function over an index other than Time and the use of a reverse-recurrence in which the dynamic recurrence is based on future (rather than past) values.
Projectile Motion: An example demonstrating how to use the system variable Time and the Dynamic() function to model time-variant behavior — in this case, the motion of a projectile.
Tunnel through earth: Imagine a tunnel passing through the earth, perfectly straight and directly through its center. If you step into it, how long will it take you to emerge on the other side? How fast will you be traveling as you pass the center of the earth? Find out with this simple dynamic simulation of the trip.
Unequal time steps: This model gives an example of a dynamic variable that calculates growth over time, where Time is defined with unequal time steps. It is an example of exponential or linear growth or decay — that is, a dynamic variable whose values in one time period are exponentially or linearly dependent on the values in the previous time period.
Engineering Examples
Adaptive Filter: This model curve fits noisy time-sequence data using an adaptive filter.
Antenna Gain: This model calculates the expected gain of an antenna looking at two different satellites.
Compression Post Load Capacity: Computes the load that a Douglas-Fir Large compression post can support.
Daylight Analyzer: A demonstration showing how to analyze lifecycle costs and savings from daylighting options in building design.
Failure Analysis: This model provides a system simulation demonstrating a failure analysis with both parallel (bulbs) and series (bulbs and switch) components. The model shows the use of a Determtable instead of nested if...then statements to assess the state of the system. Both the switch and the bulbs use an exponential function to assess the probability of failure. Ideal Gas Law: Uses the ideal gas law, PV = nRT , to solve for one unknown given the other three. Each quantity can be specified in any of a variety of possible units.
Power dispatch: Given a set of generating units using different fuels, computes how to dispatch power from the most economical first to meet a varying demand. Demonstrates the use of the Dispatch function.
Function Examples
This folder contains examples illustrating a variety of Analytica’s functions and modeling techniques.
Abstracted Subset: Since the Subset() function returns a list, it normally cannot be applied to a 2-D or higher array (i.e., it cannot be array abstracted). This model demonstrates how it can be utilized in a matter that does array-abstract.
Assignment from Button: This model demonstrates how you can use a button to copy a computed result from one node into the edit table in another node. Analytica Enterprise users can create buttons by dragging a button node from the tool bar onto the diagram. Autocorrelation This model calculates the auto-correlation coefficients of noisy time sequence data.
Choice and Determtables: This model shows that when Choice nodes are indexed by “self,” you can use Determtable functions to propagate the selected choice. This is cleaner than some other methods of using Choice outputs.
Correlated Distributions: This model reorders a group of probabilistic variables’ samples so that they mimic a desired correlation structure as closely as possible. For more information on this method see R.L. Iman and W.J. Conover, “A distribution free approach to inducing rank correlation among input variables,” Commun. Statist.-Simula. Com- puta. (Marcel Dekker, Inc.), 11(3), 1982, 311-334.
Correlated Normals: This model demonstrates a method for creating two normal distributions with a specified correlation between them. The two resulting unit normals can be transformed to have any mean and standard deviation. From E.M. Scheuer and D.S. Stoller, “On the generation of Normal Random Vectors,” Technometrics, 4:278-281, 1962.
DBWrite Example: This model demonstrates how you can write data from an Analytica model to a relational data- base using ODBC. This model requires Analytica Enterprise; refer to Chapter 22 of the Analytica User Guide.
Discrete Sampling: This model demonstrates how to generate a distribution from a discrete sample of numbers.
Extracting Diagonal This model demonstrates how to extract a diagonal from a matrix.
Lookup Reindexing: This model demonstrates a simple re-indexing operation, essentially how to look up a value from another table. This is shown by the Salary by person node, and demonstrates how Excel’s VLOOKUP function is performed in Analytica expressions.
Map images from internet: This flashy example reads and displays images of indicated areas from Google Maps in an image embedded in the model. Requires Analytica Enterprise, Optimizer, or Power Player.
Sample Size Input Node: On occasion, you might want to provide an input node on your form for the sample size system variable, so that a user can adjust the number of samples directly from your form, rather than having to bring up the Uncertainty Options dialog. Because you cannot select the sampleSize system variable, it is not possible to do this from the Analytica menus. This module provides a way to create this input node — just select Add Module and then Embed, and you can drag the input node in the module to the form where you would like it to appear. After you do that, you can delete this module, which will then be empty.
Sorting People by Height: This example sorts an index (People) by a table of values (Heights), and then uses the sorted index to created a sorted table of values (Sorted heights).
Subset of Array: This model creates a subset array out of a larger array based on a decision criterion.
Swapping y and x-index: This model swaps a computed or one-dimensional table value with its index, thereby making the computed value an index.
Use of MDTable: This model demonstrates the use of the MDTable function, which converts records in table form into multi-dimensional arrays. Multi-dimensional arrays are often useful for visualizing large sets of records. By allowing data to be viewed either as a graph or in a pivot table, the geometric relationship between records often becomes immediately evident.
Optimizer Examples
See Also
Sharing Models with Others <- | Example Models and Libraries | -> Glossary |
Enable comment auto-refresher