how to build a basic model with analytica

121
How to build a basic model with Analytica

Upload: torsten-roehner

Post on 17-Jul-2015

63 views

Category:

Economy & Finance


5 download

TRANSCRIPT

Page 1: How to Build a Basic Model with Analytica

How to build a basic model with Analytica

Page 2: How to Build a Basic Model with Analytica

Creating a new model

Page 3: How to Build a Basic Model with Analytica

When you start up Analytica it shows an Object window for a new, untitled model.

Page 4: How to Build a Basic Model with Analytica

Behind the Object window you see an empty Diagram window.

Page 5: How to Build a Basic Model with Analytica

First you should enter a Title for your model...

Page 6: How to Build a Basic Model with Analytica

Click in the Title field and give your model a decent name.

Page 7: How to Build a Basic Model with Analytica

When you hit Alt + Enter or the Tab key or click somewhere outside...

Page 8: How to Build a Basic Model with Analytica

...the Identifier field automatically changes to Car_cost_model based on the Title you keyed in.

Page 9: How to Build a Basic Model with Analytica

...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.

Page 10: How to Build a Basic Model with Analytica

If you like, type in a description of your model...

Page 11: How to Build a Basic Model with Analytica

...or add your name as the author. (If your computer does not auto-matically register your name)

Page 12: How to Build a Basic Model with Analytica

When you're done, close the Object window...

Page 13: How to Build a Basic Model with Analytica

...and start building your first model

Page 14: How to Build a Basic Model with Analytica

Editing a diagram

Page 15: How to Build a Basic Model with Analytica

But before we dive in let's first explore the tools you need in the tool bar.

Page 16: How to Build a Basic Model with Analytica

When you create a new model the edit tool is selected by default.

Page 17: How to Build a Basic Model with Analytica

You use the edit tool to create or change a model.

When you create a new model the edit tool is selected by default.

Page 18: How to Build a Basic Model with Analytica

When the edit tool is selected, a menu of icons is displayed in the node palette.

Page 19: How to Build a Basic Model with Analytica

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.

Page 20: How to Build a Basic Model with Analytica

Creating variable nodes

Page 21: How to Build a Basic Model with Analytica

Now you're going to create variables in the Car Cost model.

Page 22: How to Build a Basic Model with Analytica

The first variable you will create is for the cost of fuel.

Page 23: How to Build a Basic Model with Analytica

Drag the Variable Node icon to a position in the influence diagram.

Page 24: How to Build a Basic Model with Analytica

Type Fuel cost for the variable title.

Page 25: How to Build a Basic Model with Analytica

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.

Page 26: How to Build a Basic Model with Analytica

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.

Page 27: How to Build a Basic Model with Analytica

Now you can repeat this and create some more variables that affect fuel cost...

Page 28: How to Build a Basic Model with Analytica

Price per gallon of gasoline...

Page 29: How to Build a Basic Model with Analytica

Number of miles driven each year...

Page 30: How to Build a Basic Model with Analytica

Miles per gallon of gasoline...

Page 31: How to Build a Basic Model with Analytica

And finally the driver’s age.

Page 32: How to Build a Basic Model with Analytica

Saving your model

Page 33: How to Build a Basic Model with Analytica

After that it might be a good idea to save your model.

Page 34: How to Build a Basic Model with Analytica

After that it might be a good idea to save your model.

Page 35: How to Build a Basic Model with Analytica

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.

Page 36: How to Build a Basic Model with Analytica

Deleting a variable

Page 37: How to Build a Basic Model with Analytica

Sometimes you might want to delete a variable that you previously created.

Page 38: How to Build a Basic Model with Analytica

In this example you realize that the driver’s age is not relevant to your understanding of the FuelCost variable.

Page 39: How to Build a Basic Model with Analytica

When you hit Del or Backspace ⌫ after selec-ting the node, a confir-mation dialog pops up...

Page 40: How to Build a Basic Model with Analytica

Click OK to confirm that you want to delete the selected object.

Page 41: How to Build a Basic Model with Analytica

Moving nodes

Page 42: How to Build a Basic Model with Analytica

When you create a model you should try to structure the layout to make the influence diagram easy to understand.

Page 43: How to Build a Basic Model with Analytica

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...

Page 44: How to Build a Basic Model with Analytica

You move the Fuel Cost node to the right...

Page 45: How to Build a Basic Model with Analytica

...and place the other variables to the left.

Page 46: How to Build a Basic Model with Analytica

Editing variable titles

Page 47: How to Build a Basic Model with Analytica

Now you decide that Mpg is still a little cryptic...

Page 48: How to Build a Basic Model with Analytica

So you rename the node to Miles per gallon to make things clearer.

Page 49: How to Build a Basic Model with Analytica

When you change the title of a node, Analytica asks you if you want the Identifier to be automatically changed as well.

Page 50: How to Build a Basic Model with Analytica

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.

Page 51: How to Build a Basic Model with Analytica

Drawing arrows between nodes

Page 52: How to Build a Basic Model with Analytica

One of Analytica’s most powerful features is its ability to show relationships between variables in the influence diagram.

Page 53: How to Build a Basic Model with Analytica

Influence arrows are used to specify the dependencies between variables.

Page 54: How to Build a Basic Model with Analytica

Because Miles per gallon influences the Fuel Cost, you want to draw an arrow connecting the two nodes.

Page 55: How to Build a Basic Model with Analytica

Select the arrow toolto begin drawing arrows.

Page 56: How to Build a Basic Model with Analytica

Click on the node where you want the arrow to start...

Page 57: How to Build a Basic Model with Analytica

...and drag a line to the other node.

Page 58: How to Build a Basic Model with Analytica

When you release the mouse button, the two nodes are now connected by an arrow, indicating that Miles per gallon affects Fuel Cost.

Page 59: How to Build a Basic Model with Analytica

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.

Page 60: How to Build a Basic Model with Analytica

Entering attributes into the Object window

Page 61: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Page 62: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Identifier

Page 63: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Title

Page 64: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Units

Page 65: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Description

Page 66: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Definition

Page 67: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Inputs

Page 68: How to Build a Basic Model with Analytica

Each variable (or other Object) has an Object window that lets you see and edit its Attributes, like its...

Outputs

Page 69: How to Build a Basic Model with Analytica

If you want to enter attributes for Annual Miles, first select the node...

Page 70: How to Build a Basic Model with Analytica

...then either click the Object window button or just double-click the selected node on the diagram.

Page 71: How to Build a Basic Model with Analytica

In the Object window you see that Analytica has already assigned an Identifier based on the Title.

Page 72: How to Build a Basic Model with Analytica

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 (_).

Page 73: How to Build a Basic Model with Analytica

You can directly edit both the identifier and the title.

Page 74: How to Build a Basic Model with Analytica

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.

Page 75: How to Build a Basic Model with Analytica

Then you type in miles/year as the Unit of measurement.

Page 76: How to Build a Basic Model with Analytica

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.

Page 77: How to Build a Basic Model with Analytica

When you change the Title to Miles per year ...

Page 78: How to Build a Basic Model with Analytica

...Analytica asks you if you want it to automatically change the identifier to match the new title.

Page 79: How to Build a Basic Model with Analytica

...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.

Page 80: How to Build a Basic Model with Analytica

Finally you enter a description for this variable.

Page 81: How to Build a Basic Model with Analytica

Defining a variable as an explicit value

Page 82: How to Build a Basic Model with Analytica

Analytica uses a wide range of variable types. For now we simply enter an explicit value for the variable.

Page 83: How to Build a Basic Model with Analytica

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.

Page 84: How to Build a Basic Model with Analytica

As a first guess you put in a single number.

Page 85: How to Build a Basic Model with Analytica

Click the Check button to accept your input.

Page 86: How to Build a Basic Model with Analytica

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.

Page 87: How to Build a Basic Model with Analytica

Defining a variable as a function of other variables

Page 88: How to Build a Basic Model with Analytica

When one variable dependes on another variable, you must provide an expression that describes the relationship between the variables.

Page 89: How to Build a Basic Model with Analytica

Since you've drawn arrows from other variables to Fuel Cost, their identifiers and titles appear in the variable's Inputs field.

Page 90: How to Build a Basic Model with Analytica

Before you're going to define the functional relationship you do a little housekeeping and enter the Units and a Description.

Page 91: How to Build a Basic Model with Analytica

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.

Page 92: How to Build a Basic Model with Analytica

When you click into the Definition field you can choose the Inputs from a popup menu.

Page 93: How to Build a Basic Model with Analytica

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.

Page 94: How to Build a Basic Model with Analytica

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.

Page 95: How to Build a Basic Model with Analytica

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.

Page 96: How to Build a Basic Model with Analytica

Entering attributes using the Attribute panel

Page 97: How to Build a Basic Model with Analytica

To calculate numerical results for Fuel Cost we still need to define the other remaining inputs.

Page 98: How to Build a Basic Model with Analytica

Otherwise, if you would click the Result button, ...

Page 99: How to Build a Basic Model with Analytica

...you would get an error message asking you if you want to edit the variables that are not yet defined.

Page 100: How to Build a Basic Model with Analytica

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.

Page 101: How to Build a Basic Model with Analytica

This is equivalent to opening the Object window and editing the Definition there.

Page 102: How to Build a Basic Model with Analytica

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.

Page 103: How to Build a Basic Model with Analytica

Defining a variable as a list

Page 104: How to Build a Basic Model with Analytica

In Analytica it's easy to define an input not just as a single number but, for example, as a list of values.

Page 105: How to Build a Basic Model with Analytica

This is especially useful when you want to perform WHAT-IF analyses.

Input

Output

Page 106: How to Build a Basic Model with Analytica

In order to see how Fuel Cost is affected by Miles per gallon, you want to define this variable as a list.

Page 107: How to Build a Basic Model with Analytica

Because it's alway good practice, you first enter a Description and the Units before you're going to define the variable...

Page 108: How to Build a Basic Model with Analytica

Now you want to define it as a list of numbers between 20 and 50, by increments of 10.

Page 109: How to Build a Basic Model with Analytica

From the Expression popup menu you choose List to enter a list of numbers.

Page 110: How to Build a Basic Model with Analytica

Then type 20 in the first cell.

Page 111: How to Build a Basic Model with Analytica

When you press Enter, Analytica automatically sets the next value using the default increment of 1.

Page 112: How to Build a Basic Model with Analytica

Change the second cell to 30 and press Enter. Analytica automatically sets the next value using the increment implied by the first two values.

Page 113: How to Build a Basic Model with Analytica

Now you have defined Miles per gallon as a range of values from 20 to 50.

Page 114: How to Build a Basic Model with Analytica

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.

Page 115: How to Build a Basic Model with Analytica

Viewing results in the Result window

Page 116: How to Build a Basic Model with Analytica

Now that you have entered attributes and definitions for all variables it is time to see the result.

Page 117: How to Build a Basic Model with Analytica

To do so, select the variable...

Page 118: How to Build a Basic Model with Analytica

...and click the Result button.

Page 119: How to Build a Basic Model with Analytica

The Result window appears.

Page 120: How to Build a Basic Model with Analytica

Icons in the upper left corner of the Result window control the view mode.

Page 121: How to Build a Basic Model with Analytica

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.