Dynamic Interactivity in Economic
Modeling
with Mathematica 6
:][: Motivation
"A picture may be worth a thousand words, but a good animation is worth much
more."
Selwyn Hollis, Professor of Mathematics, Armstrong Atlantic State University
by Jozef Barun k
Institute of Information Theory and Automation
Academy of Sciences of the Czech Republic
2
DIEM_MME07.nb
Today’s Talk
:] i [:
Introduction to Dynamic Interactivity in Mathematica 6
"Examples speaks for everything"
:] ii [: Capabilities of Mathematica That Defines Dynamic Interactivity
:] iii [: Examples of Economic Modeling Application
DIEM_MME07.nb
3
Motivation Examples
"A picture may be worth a thousand words, but a good animation is worth much
more." ...
Ever wanted to explore Chaotic systems in real-time? In Mathematica 6, it is possible with one single command...
:][: Lorenz Attractor
3-dimensional chaotic structure used as prime example of an chaotic system, is
governed by following equations:
dx
dt
dy
dt
dz
dt
= Σ Hy - xL
= x HΡ - zL - y
= x y - Β z,
where Σ is Prandtl number, Ρ is Rayleigh number, Σ, Ρ, Β > 0. System exhibits
chaotic behavior for Ρ = 28
4
DIEM_MME07.nb
Motivation Examples cont.
:][: Lorenz Attractor
Drag the graphics with mouse to rotate, drag while holding Shift to move, drag
while holding Alt to zoom, use "+" to Show Animation Controls !!!
time
10
parameters
Β
8
3
Σ
10
Ρ
67.5
initial conditions
x0
1
y0
5
z0
10
Set Initial Values
DIEM_MME07.nb
Motivation Example cont.
:][: Fractal Trees
Immediately Create Complex Dynamic Graphics
horizontal offset
vertical offset
number of steps
5
6
DIEM_MME07.nb
Interactive Manipulation
Single function Manipulate gives immediate access to a huge range of powerful
interactive capabilities. Researcher can instantly create full-function dynamic interface as a routine part of everyday work.
Manipulate [ expr , { u , umin , umax } ]
where "u" is parameter of "expr" which we want to be interactive, within range
specified by lowerbound umin and upperbound umax.
DIEM_MME07.nb
Adding Dynamics
:][: Manipulate Α and Β in f(x) : y = Sin(Α x) + Sin(Β x)
With this simple code we get dynamic interactive panel with controls:
Manipulate@Plot@Sin@Α xD + Sin@Β xD, 8x, 0, 2 Pi<D, 8Α, 1, 20<, 8Β, 1, 20<D
Α
Β
2
1
1
-1
-2
2
3
4
5
6
7
8
DIEM_MME07.nb
Graphics Far Beyond Plotting
:][: Slider, 2D Slider and Locator
With little bit of simple code, we are able to give our study an "extra dimension".
Manipulate@Graphics@8Line@Table@88Cos@tD, Sin@tD<, pt<, 8t, 2. Pi n, 2. Pi, 2. Pi n<DD<,
ImageSize ® 8300, 300<D, 88n, 30<, 1, 200, 1<,
8pt, 8-1, -1<, 81, 1<<, 88pt, 80, 0<<, Locator<, ControlPlacement ® LeftD
n
pt
DIEM_MME07.nb
9
Power to Illustrate and Demonstrate
:][: Derivative of a function
How many students really understand the concept of derivatives at first sight? Why
not to employ locator ???
polynomial
tangent line
trigonometric
first derivative
logarithmic
second derivative
4
2
È
-2
-4
2
4
6
8
10
10
DIEM_MME07.nb
Mathematica’s Dynamic Interactivity
in Economic modeling
DIEM_MME07.nb
11
Interactive Generation / Simulation of
Artificial data
We can interactively study behavior of any process, example shows IGARCH(1,1)
generation, using mathematica, we can easily create interfaces for simulating any
kind of process, even export it into external file.
IGARCHH1,1L
Simulated series
10
Simulated Volatility
5
Α0
0.5
Β1
0.2
100
-5
New Random Case
-10
Export Simulated Series
200
300
400
12
DIEM_MME07.nb
Interactive OLS Polynomial Curve-Fitting
Enviroment
With 2 lines of code, we are able to create interactive dynamic interface for OLS
curve fitting:
Manipulate@Module@8x<, Plot@Fit@points, Table@x ^ i, 8i, 0, order<D, xD,
8x, -2, 2<, PlotRange ® 2, ImageSize ® 500, Evaluated -> TrueDD,
88order, 3<, 1, 10, 1, Appearance ® "Labeled"<,
88points, RandomReal@8-2, 2<, 85, 2<D<, Locator, LocatorAutoCreate ® True<D
order
3
2
1
-2
-1
1
-1
-2
2
DIEM_MME07.nb
13
Interactive Cobb-Douglas Production
Functions
Cobb-Douglas functions are used in economics to show the relationship between
input factors and the level of production, and is of form a l Α k Β, where l and k are
factors of production (labor and capital)
scaling factor
2.0
10
increasing returns
to scale
capital exponent
1.5
8
1.0
6
capital HkL
0.5
decreasing returns
to scale
0.0
0.0
0.5
1.0
1.5
2.0
4
labor exponent
[email protected], 0.505, 0.53D@{, kD
2
0
0
2
4
labor H{L
6
8
Cobb-Douglas Production Function
method
ContourPlot
Plot3D
10
14
DIEM_MME07.nb
Exploring Black-Scholes Model and
Behavior of Greeks
European Option Price
option price
call
put
Stock Price: 129.
Call Option Price: 59.0773
European Option Greeks
option price
call sensitivities
call delta
call gamma
call rho
call vega
call theta
put sensitivities
put delta
put gamma
put rho
put vega
put theta
80
60
European Option Parameters
strike price
70.
interest rate
0.0396
dividend yield
0.0172
volatility
0.234
time to maturity
0.141
Plot type
2D
3D
40
20
80
100
1
DIEM_MME07.nb
Any Questions?
Thank you for your attention !
15
© Copyright 2026 Paperzz