how to build a basic model with analytica
TRANSCRIPT
How to build a basic model with Analytica
Creating a new model
When you start up Analytica it shows an Object window for a new, untitled model.
Behind the Object window you see an empty Diagram window.
First you should enter a Title for your model...
Click in the Title field and give your model a decent name.
When you hit Alt + Enter or the Tab key or click somewhere outside...
...the Identifier field automatically changes to Car_cost_model based on the Title you keyed in.
...the Identifier field automatically changes to Car_cost_model based on the Title you keyed in.
The Identifier is automatically created to match the first 20 characters of the Title. You can change this manually if you want.
If you like, type in a description of your model...
...or add your name as the author. (If your computer does not auto-matically register your name)
When you're done, close the Object window...
...and start building your first model
Editing a diagram
But before we dive in let's first explore the tools you need in the tool bar.
When you create a new model the edit tool is selected by default.
You use the edit tool to create or change a model.
When you create a new model the edit tool is selected by default.
When the edit tool is selected, a menu of icons is displayed in the node palette.
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
Now you're going to create variables in the Car Cost model.
The first variable you will create is for the cost of fuel.
Drag the Variable Node icon to a position in the influence diagram.
Type Fuel cost for the variable title.
Type Fuel cost for the variable title.
As you build a model, you should choose descriptive titles for your variables. Descriptive variable titles remind you of the model’s logic and help others to under-stand how the model works.
Type Fuel cost for the variable title.
Since Fuel Cost doesn't yet have a valid definition it's filled with a diagonal line pattern around its text.
Now you can repeat this and create some more variables that affect fuel cost...
Price per gallon of gasoline...
Number of miles driven each year...
Miles per gallon of gasoline...
And finally the driver’s age.
Saving your model
After that it might be a good idea to save your model.
After that it might be a good idea to save your model.
After that it might be a good idea to save your model.
Analytica automatically saves each change you make to a backup file. If your computer should crash unexpectedly, you can recover your changes the next time you start Analytica. Even so, it’s a good idea to save your changes from time to time.
Deleting a variable
Sometimes you might want to delete a variable that you previously created.
In this example you realize that the driver’s age is not relevant to your understanding of the FuelCost variable.
When you hit Del or Backspace ⌫ after selec-ting the node, a confir-mation dialog pops up...
Click OK to confirm that you want to delete the selected object.
Moving nodes
When you create a model you should try to structure the layout to make the influence diagram easy to understand.
In this case you think that Fuel Cost will be derived from the other three variables. Therefore you want to re-arrange the diagram a little...
You move the Fuel Cost node to the right...
...and place the other variables to the left.
Editing variable titles
Now you decide that Mpg is still a little cryptic...
So you rename the node to Miles per gallon to make things clearer.
When you change the title of a node, Analytica asks you if you want the Identifier to be automatically changed as well.
When you change the title of a node, Analytica asks you if you want the Identifier to be automatically changed as well.
You can change this behavior, to either turn off automatic updating of the identifier or to make it fully automatic, so that you are not asked.
Drawing arrows between nodes
One of Analytica’s most powerful features is its ability to show relationships between variables in the influence diagram.
Influence arrows are used to specify the dependencies between variables.
Because Miles per gallon influences the Fuel Cost, you want to draw an arrow connecting the two nodes.
Select the arrow toolto begin drawing arrows.
Click on the node where you want the arrow to start...
...and drag a line to the other node.
When you release the mouse button, the two nodes are now connected by an arrow, indicating that Miles per gallon affects Fuel Cost.
When you release the mouse button, the two nodes are now connected by an arrow, indicating that Miles per gallon affects Fuel Cost.
When needed you can draw multiple arrows at once. Just hold down Control or Shift while selecting and drag the lines to the desired node.
Entering attributes into the Object window
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Identifier
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Title
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Units
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Description
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Definition
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Inputs
Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...
Outputs
If you want to enter attributes for Annual Miles, first select the node...
...then either click the Object window button or just double-click the selected node on the diagram.
In the Object window you see that Analytica has already assigned an Identifier based on the Title.
In the Object window you see that Analytica has already assigned an Identifier based on the Title.
Analytica assigns the identifier when the title is created. It uses the first 20 characters of the title except for spaces or punctuation, which are replaced by underscores (_).
You can directly edit both the identifier and the title.
First, you change the variable’s identifier to a short abbreviation so that it can easily be used later in the definitions of other variables.
Then you type in miles/year as the Unit of measurement.
Then you type in miles/year as the Unit of measurement.
Analytica uses the information from the Units field to label graphs or tables that use this variable; Analytica does not use it in any mathematical computations.
When you change the Title to Miles per year ...
...Analytica asks you if you want it to automatically change the identifier to match the new title.
...Analytica asks you if you want it to automatically change the identifier to match the new title.
In this case you click No to keep the Identifier as Mpy.
Finally you enter a description for this variable.
Defining a variable as an explicit value
Analytica uses a wide range of variable types. For now we simply enter an explicit value for the variable.
Analytica uses a wide range of variable types. For now we simply enter an explicit value for the variable.Functional expressions and lists, for example, are described later in this tutorial.
As a first guess you put in a single number.
Click the Check button to accept your input.
Miles per year is no longer filled with a diagonal line pattern around its title. The clear node indicates that this variable now has a valid definition.
Defining a variable as a function of other variables
When one variable dependes on another variable, you must provide an expression that describes the relationship between the variables.
Since you've drawn arrows from other variables to Fuel Cost, their identifiers and titles appear in the variable's Inputs field.
Before you're going to define the functional relationship you do a little housekeeping and enter the Units and a Description.
Because fuel cost is equal to fuel price times miles driven, divided by miles per gallon, you will enter something equivalent to this into the Definition field.
When you click into the Definition field you can choose the Inputs from a popup menu.
When you click into the Definition field you can choose the Inputs from a popup menu.
Variables that are not yet used in the definition are display in italics.
Alternatively, when you start typing a variable's name, Analytica's Expression Assist provides a list of Identifiers and Functions that start with the letters you typed.
Based on the definition you just entered, the value of Fuel Cost is calculated by multiplying the values of Fuel Price and Miles per year, and then dividing the result by the value of Miles per gallon.
Entering attributes using the Attribute panel
To calculate numerical results for Fuel Cost we still need to define the other remaining inputs.
Otherwise, if you would click the Result button, ...
...you would get an error message asking you if you want to edit the variables that are not yet defined.
When clicking YES the respective variable node will be selected on the diagram and you can edit its definition right in the Attribute panel below.
This is equivalent to opening the Object window and editing the Definition there.
If you find it more convenient to edit attributes using the Attribute panel, you can always click the Key icon to open or close the panel.
Defining a variable as a list
In Analytica it's easy to define an input not just as a single number but, for example, as a list of values.
This is especially useful when you want to perform WHAT-IF analyses.
Input
Output
In order to see how Fuel Cost is affected by Miles per gallon, you want to define this variable as a list.
Because it's alway good practice, you first enter a Description and the Units before you're going to define the variable...
Now you want to define it as a list of numbers between 20 and 50, by increments of 10.
From the Expression popup menu you choose List to enter a list of numbers.
Then type 20 in the first cell.
When you press Enter, Analytica automatically sets the next value using the default increment of 1.
Change the second cell to 30 and press Enter. Analytica automatically sets the next value using the increment implied by the first two values.
Now you have defined Miles per gallon as a range of values from 20 to 50.
Now you have defined Miles per gallon as a range of values from 20 to 50.
Although the auto-fill feature makes it convenient to enter a simple linear sequence, you are free to edit the values as you please.
Viewing results in the Result window
Now that you have entered attributes and definitions for all variables it is time to see the result.
To do so, select the variable...
...and click the Result button.
The Result window appears.
Icons in the upper left corner of the Result window control the view mode.
Icons in the upper left corner of the Result window control the view mode.
Graph view is the default. But you can change this in Preferences.