Lecture One: Fundamental of Computational Economics Lecture One: Fundamental of Computational Economics Li, Xihao * Department of Economics and Social Sciences (DiSES) Universit ` a Politecnica delle Marche October, 2013 * Department of Economics and Social Sciences (DiSES), Universit ` a Politecnica delle Marche, Piazzale Martelli 8, 60121 Ancona, Italy. Email: [email protected]. Li, Xihao Lecture Notes
23
Embed
Lecture One: Fundamental of Computational Economics
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Lecture One: Fundamental of Computational Economics
Lecture One: Fundamental ofComputational Economics
Li, Xihao∗
Department of Economics and Social Sciences (DiSES)
Universita Politecnica delle Marche
October, 2013
∗Department of Economics and Social Sciences (DiSES), Universita Politecnica delle Marche, Piazzale
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
Introduction: I
Goal of Lecture One: to have general idea about how touse computational tools to work out problems.
Tools:General tools: Matlab, GNU Octave
Special purpose tools: e.g., statistical package: Eview,Sdata, R
We use GNU Octave for demonstration!Main textbook: (”Scientific Computing with MATLABand Octave”, Quarteroni Alfio, Saleri Fausto, GervasioPaola 3rd ed., 2010)
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
Introduction: I
Goal of Lecture One: to have general idea about how touse computational tools to work out problems.
Tools:General tools: Matlab, GNU Octave
Special purpose tools: e.g., statistical package: Eview,Sdata, R
We use GNU Octave for demonstration!
Main textbook: (”Scientific Computing with MATLABand Octave”, Quarteroni Alfio, Saleri Fausto, GervasioPaola 3rd ed., 2010)
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
Introduction: I
Goal of Lecture One: to have general idea about how touse computational tools to work out problems.
Tools:General tools: Matlab, GNU Octave
Special purpose tools: e.g., statistical package: Eview,Sdata, R
We use GNU Octave for demonstration!Main textbook: (”Scientific Computing with MATLABand Octave”, Quarteroni Alfio, Saleri Fausto, GervasioPaola 3rd ed., 2010)
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
ABC of GNU Octave
GNU Octave (Octave in short) is free, under GNU GeneralPublic License.
Learning by doing!
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
Action: I
Clean up the working environment:
> clear all;
> clc;
display format in Octave:
> a = 1/7;
> a
format long:
> format long
> a
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
Action: II
epsilon, the roundoff error:
> eps
finite scope of float number:
> realmin
> realmax
Infinity representation:
> Inf
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise
Action: III
Numercial computation: computer is NOT the same asMath!
Example:
> a = 1; b=1; while a+b ∼ = a; b=b/2; end> b
Another example:
> x = 1.e-15;> ((1+x)-1)/x
NaN:
> 0/0
Li, Xihao Lecture Notes
Lecture One: Fundamental of Computational Economics Introduction First Tour Exercise