Tutorial: Create a model
This chapter shows you how to:
- Create a new model
- Create new variable nodes and enter attributes
- Move and delete variable nodes
- Draw influence arrows to define dependencies between variables
- Define variables as explicit values, functions and lists
- Invoke a built-in function to define a variable
- Do a simple Parametric Analysis
This chapter shows you how to create a new Analytica model.
In the process of building a model to analyze the costs of owning and operating an automobile, you will create variables, define dependencies, add documentary text, and compute results.
If Analytica is not open, start it by double-clicking its icon. If Analytica is already open with an active model go to the file menu, select close model, then select new model.
Creating a new model
When you start up a new Analytica session it shows an Object window for an untitled model. Behind the Object window you will see an empty Diagram window.
First you should enter a Title for your model:
- Click in the Title attribute field (to the right of Title). Type in Car cost model and press Alt- enter. In the space just above the Title you entered, you will see that the Identifier field automatically changes to Car_cost_model.
- Press Tab to go to the Description attribute and type in: A demonstration model to show how to calculate the cost of running a car
If this is not a first-time entry for Title information, a dialog box will appear to confirm an automatic change to the Identifier.
You can either press the Tab key or use the mouse to move between fields.
Editing a diagram
In most of the three previous chapters you were in the browse mode, with the browse tool highlighted in the tool palette. In browse mode you can view an existing model without changing its structure. When you create a new model the edit tool
is selected by default. You use the edit tool to create or change a model.
Be sure to note which tool is selected throughout the remainder of this tutorial.
When the edit tool is selected, a menu of icons is displayed in the node palette. These icons represent the different node types and allow you to add nodes to the diagram.
Creating variable nodes
In this chapter you will create variables in the Car Cost model.
Each variable is represented in the influence diagram as a shape that depicts the Class of Variable. These shapes are generally referred to as nodes. Select the node shape based on what you know about the variable. If you are not sure what kind of variable to use, choose a
General variable ().
See “Recognizing influence diagrams” on page 26 for a description of the node shapes.
As you build a model, you should select descriptive titles for your variables. Descriptive variable titles remind you of the model’s logic and help to inform others about how the model operates.
Fuel cost is filled with a diagonal line pattern around its text, indicating that it does not yet have a valid definition.
Repeat Steps 1 and 2 four times to create four more variables that affect fuel cost. Title these variables as follows:
- Fuel price (price per gallon of gasoline)
- Annual miles (number of miles driven each year)
- Mpg (miles per gallon of gasoline)
- Age (driver’s age)
Title text wraps to fit within the node as you type. You can manually create a new line in a title by pressing the Enter key at the desired break point(s). You can also expand the size of the node by dragging one of the corner handles.
Saving your model
Analytica automatically saves each change you make to a backup file. If your computer (or Analytica) should terminate unexpectedly, it will offer to recover your changes the next time you start Analytica. Even so, it’s a good idea to save your changes periodically.
- Select Save from the File menu (or press control-s). The first time you try to save a model, it shows a Save As dialog, offering to save the model in the My Documents folder using the model Title as the default file name. You can select another folder and modify the file name.
- Click Save or press Enter to save the model in the selected folder.
See Also
Tutorial Chapter 3 <- | Tutorial Chapter 4 | -> [[Tutorial Chapter 5] |
Enable comment auto-refresher