SlideShare a Scribd company logo
FINANCIAL RISK MGT - FRM
Lecture by;
Dr. Syed
Muhammad Ali
Tirmizi
INTRODUCTORY LECTURE
1
2
MODERN WORLD FRM ANALYTICS
 Its absolutely true, that with modern programming
languages like R and Python, a skilled analyst can
now design their FRM analytic logic with
significantly less effort than before, using resources
such as Yahoo! or other free services for historical
quotes.
3
MODERN WORLD FRM ANALYTICS
 The algorithms (A precise rule or set of rules specifying
how to solve a problem) has made us to comprehend that
the programs, using data science techniques, can not
only automate very tedious calculations but then very
positively yield insights into the human thinking level:
insights that would otherwise not be found.
4
MODERN WORLD FRM ANALYTICS
 Data science involves the study of statistical and
computational models.
 Data engineering is the process of implementing
models on computers as applied to large datasets,
using files, program logic, testing, and continuous
improvement.
 We take advantage of the data science principles to
build and engineer our financial laboratory using R
Software.
5
UNDERSTANDING ANALYTICAL THINKING
 As an investor, there is no more immediate feeling of
excitement than a stock split during a bull market or an
acquisition that can bid one’s stock up by 20 percent in a
day.
 Even though semi-random events can risk the desired
outcome.
 Therefore, in a nutshell, when faced with risks,
preparation makes success more feasible.
6
UNDERSTANDING ANALYTICAL THINKING
 What would a financial analytics approach tell us from a
purely objective perspective? As we practice financial
analytics, we are trained, informed, and more prepared
for unexpected situations.
 Along with robust and accurate data, designing models
is a key component of the professional practice of
analytics.
 The most important applied models will be exemplified
during the course so that they can be adapted, relied
upon, and expanded.
7
UNDERSTANDING ANALYTICAL THINKING
 Models are presented in this course using hand-written
code in the R language, using historical market datasets
to gain a deeper understanding of the behavior.
 Analytics are applied to Big Data in order to take
advantage of the large sample sizes.
 Insights and discovery are simply more realistically
possible with large datasets.
8
WHAT IS ANALYTICAL FRM?
 The 2008 financial crisis made market practitioners to
realize that reliance on models which are mathematically
pure but fundamentally inaccurate is no longer
acceptable. Therefore, a more practical approach is
needed to tackle these situations.
 The financial markets where the instruments reside have
many more tail events (risk events – fat tails) that had
and have contributed to the flash crash, tech bubble, and
mortgage-based crisis with more to come.
9
WHAT IS ANALYTICAL FRM?
 Practitioners are in need of tools for quick discovery and
simulation to complement and calibrate the mathematics.
 The emerging new field of Analytics, also known as
Data Science, is providing computational intelligence to
businesses in ways many had never envisioned.
 Analytical computer programs are recommending
everything from medical diagnoses to automobile routes
to entertainment contents.
10
WHAT IS ANALYTICAL FRM?
 Investment firms like PIMCO and Vanguard have helped
investors meet retirement goals or send their children to
college by carefully delivering positive market exposure
(i.e., effective financial risk management).
 This course will provide the tools for being able to
understand better what firms like these and other
financial entities do relating financial risk management
practices.
 Therefore, Optimization is an important aspect of
financial analytics particularly in the case of FRM.
Statistical Analyses Using R
Starting Book for Beginners to understand
and Use R Software Effectively
11
Lecture by;
Dr. Syed
Muhammad Ali
Tirmizi
12
READ THE HANDBOOK
(Book is also available online)
13
INTRODUCTION
 R language has its roots at AT&T Bell
Laboratories during the 1970s and 1980s in the
S language project (Becker, Chambers, and
Wilks, 1988).
 People think that the S language would not have
been designed in the way it was if it had been
designed by computer scientists (Morandat, Hill,
Osvald, and Vitek, 2012).
14
INTRODUCTION
 R is an open source variant of S developed at the
University of Auckland by Ross Ihaka and Robert
Gentleman, first appearing in 1993 (Ihaka, 1998).
 Clearly the recent popularity of R, fueled by its
open source availability and the need for statistical
and analytical computing tools, shows that the
benefits of R far outweigh the negatives.
 Overall, R is based upon the vector as a first class
item in the language.
15
INTRODUCTION
 R shares this attribute with LISP, Scheme, Python,
and Matlab.
 This and the prevalence of over 4,000 publicly
available packages are two of the many strengths of
R.
 In this course, we will focus on R packages that
revolve around financial risk management
modelling and portfolio optimization.
16
INTRODUCTION
17
GETTING STARTED WITH R
 One of the great things about R is how easy it is to install.
 In your browser, head to the web site for the Comprehensive
R Archive Network (CRAN), http://cran.r-project.org
 This website will help you to download and install R software
for windows.
 Just as a basic test, we can create a vector of prices and plot it
with this block of code:
x <- c(1.3,1.2,1.3,NA,1.4,1.5)
plot(x,ylab="EUR prices")
is.na(x)
[1] FALSE FALSE FALSE TRUE FALSE FALSE
R
CODES
18
GETTING STARTED WITH R
 The c() operator creates a vector of elements.
 This is the basic vector operator in R.
 Note the “not available” (NA) element
appearing as the fourth item of the vector.
 R’s ability to handle NAs, infinite values (Inf),
and not a number (NaN) is one of its many
strengths.
19
GETTING STARTED WITH R
 A later development is the R Studio GUI available
from the web site www.rstudio.com.
 R Studio is a commercially developed GUI allowing
management of plot windows, variable contents,
and better debugging than the basic R interpreter.
 R Studio is a second-generation R user interface
with integrated code, execution, variable inspection,
and plotting windows, and expression completion.
20
21
GETTING STARTED WITH R
 Any time a library statement is encountered, R
will check that the package is available.
 If not, it must be downloaded.
 As an example, to download the ggplot2
package, use the following command:
update.packages()
install.packages("ggplot2",dependencies=TRUE)
library(ggplot2)
22
LANGUAGE FEATURES: FUNCTIONS,
ASSIGNMENT, ARGUMENTS, AND TYPES
 R has four assignment operators.
 The most basic operator is “<-”. This is the one
we use in the first assignment in the code block
below.
 R’s functional nature is so strong that even this
can be replaced by the function call assign
(“x”, 1).
23
LANGUAGE FEATURES: FUNCTIONS,
ASSIGNMENT, ARGUMENTS, AND TYPES
 Over time, because people were used to other
languages that use “=” instead, and even though
“=” was used to assign parameter values in
function calls (g(x, y = 7), for example), it was
also made available for assignment in R.
 So using “<-” or “=” is now really a matter of
preference.
24
LANGUAGE FEATURES: FUNCTIONS,
ASSIGNMENT, ARGUMENTS, AND TYPES
> x <- 1
> assign("x",2)
> x
[1] 2
> x = 3
> x
[1] 3
> f <-function(x)
+ {
+ x = 4
+ x
+ }
> f(x)
[1] 4
> x
[1] 3
RUN THESE
CODES for
Practice
25
LANGUAGE FEATURES: FUNCTIONS,
ASSIGNMENT, ARGUMENTS, AND TYPES
 R’s fourth assignment operator, with two “<”s,
is known as the “super-assignment” operator.
 Executing it will look outside the current frame
for x, which is global to the function f , and
assign to that x.
 If there is no x in the global environment, it will
create one and assign the value to it.
26
LANGUAGE FEATURES: FUNCTIONS,
ASSIGNMENT, ARGUMENTS, AND TYPES
> #The fourth type is "<<-"
> x = 3
> x
[1] 3
> f <-function(x)
+ {
+ x <<- 4
+ x
+ }
> f(x)
[1] 4
> x
[1] 4
> typeof(f)
[1] "closure"
> typeof(x)
[1] "double"
RUN THESE
CODES for
Practice
27
DATA FRAMES AND INPUT– OUTPUT
 Data frames are one of R’s more unusual and handy
features.
 A data frame is a sequence of rows where the
columns are heterogeneously typed. A common way
of loading data frames is from the Excel .csv files.
#Input-ouput:
write.csv(d,file="d.txt",row.names=FALSE)
e <- read.csv("d.txt",header=TRUE)
28
LISTS IN “R”
 Lists are ordered aggregates like vectors, which are
constructed by c(. . .).
 However, lists differ from the basic vectors, in that
they are recursively formed, using list(. . .).
#Lists:
c(1,c(1,2),3,"A",c(4,5))
[1] "1" "1" "2" "3" "A" "4" "5"
list(1,c(1,2),3,"A",list(4,5))
THANK YOU
29

More Related Content

What's hot

Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
JigsawAcademy2014
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
Victor Ordu
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
Ahammed Alamin
 
High performance computing language,julia
High performance computing language,juliaHigh performance computing language,julia
High performance computing language,julia
Anusha sweety
 
C Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingC Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C Programming
Tonex
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & Implementation
Gaditek
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
jatin batra
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
aaravSingh41
 
The epistemology of programming language paradigms
The epistemology of programming language paradigmsThe epistemology of programming language paradigms
The epistemology of programming language paradigms
Federico Gobbo
 
High quality implementation for
High quality implementation forHigh quality implementation for
High quality implementation for
ijseajournal
 
R Programming: First Steps
R Programming: First StepsR Programming: First Steps
R Programming: First Steps
Rsquared Academy
 
1 R Tutorial Introduction
1 R Tutorial Introduction1 R Tutorial Introduction
1 R Tutorial Introduction
Sakthi Dasans
 
R programming
R programmingR programming
R programming
Nandhini G
 
Programming language
Programming languageProgramming language
Programming language
Dhani Ahmad
 
C Language
C LanguageC Language
C Language
TodayTutoring
 
Mise14 @ ICSE1 14 Uncertainty in Bidirectional Transformations
Mise14 @ ICSE1 14 Uncertainty in Bidirectional TransformationsMise14 @ ICSE1 14 Uncertainty in Bidirectional Transformations
Mise14 @ ICSE1 14 Uncertainty in Bidirectional Transformations
Alfonso Pierantonio
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
Ankit Dubey
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
Ankit Dubey
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
busyking03
 

What's hot (19)

Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
 
High performance computing language,julia
High performance computing language,juliaHigh performance computing language,julia
High performance computing language,julia
 
C Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingC Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C Programming
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & Implementation
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
 
The epistemology of programming language paradigms
The epistemology of programming language paradigmsThe epistemology of programming language paradigms
The epistemology of programming language paradigms
 
High quality implementation for
High quality implementation forHigh quality implementation for
High quality implementation for
 
R Programming: First Steps
R Programming: First StepsR Programming: First Steps
R Programming: First Steps
 
1 R Tutorial Introduction
1 R Tutorial Introduction1 R Tutorial Introduction
1 R Tutorial Introduction
 
R programming
R programmingR programming
R programming
 
Programming language
Programming languageProgramming language
Programming language
 
C Language
C LanguageC Language
C Language
 
Mise14 @ ICSE1 14 Uncertainty in Bidirectional Transformations
Mise14 @ ICSE1 14 Uncertainty in Bidirectional TransformationsMise14 @ ICSE1 14 Uncertainty in Bidirectional Transformations
Mise14 @ ICSE1 14 Uncertainty in Bidirectional Transformations
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 

Similar to Financial Risk Mgt - Lec 1 by dr. syed muhammad ali tirmizi

Statistical Analysis and Data Analysis using R Programming Language: Efficien...
Statistical Analysis and Data Analysis using R Programming Language: Efficien...Statistical Analysis and Data Analysis using R Programming Language: Efficien...
Statistical Analysis and Data Analysis using R Programming Language: Efficien...
BRNSSPublicationHubI
 
R_L1-Aug-2022.pptx
R_L1-Aug-2022.pptxR_L1-Aug-2022.pptx
R_L1-Aug-2022.pptx
ShantilalBhayal1
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
ranapoonam1
 
UNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdfUNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdf
Sweta Kumari Barnwal
 
2 it unit-1 start learning r
2 it   unit-1 start learning r2 it   unit-1 start learning r
2 it unit-1 start learning r
Netaji Gandi
 
Best corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiBest corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbai
Unmesh Baile
 
Succeeding with Functional-first Programming in Enterprise
Succeeding with Functional-first Programming in EnterpriseSucceeding with Functional-first Programming in Enterprise
Succeeding with Functional-first Programming in Enterprise
dsyme
 
Getting started with R
Getting started with RGetting started with R
Productivity Factors in Software Development for PC Platform
Productivity Factors in Software Development for PC PlatformProductivity Factors in Software Development for PC Platform
Productivity Factors in Software Development for PC Platform
IJERA Editor
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
Derek Kane
 
FULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdfFULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdf
attalurilalitha
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
Ajay Ohri
 
Introduction to R ajay Ohri
Introduction to R ajay OhriIntroduction to R ajay Ohri
Introduction to R ajay Ohri
Ajay Ohri
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
rajalakshmi5921
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
NareshKarela1
 
Lecture_R.ppt
Lecture_R.pptLecture_R.ppt
Lecture_R.ppt
Abebe334138
 
GET STARTED WITH R FOR DATA SCIENCE
GET STARTED WITH R FOR DATA SCIENCEGET STARTED WITH R FOR DATA SCIENCE
GET STARTED WITH R FOR DATA SCIENCE
USDSI
 
Fresher's guide to Preparing for a Big Data Interview
Fresher's guide to Preparing for a Big Data InterviewFresher's guide to Preparing for a Big Data Interview
Fresher's guide to Preparing for a Big Data Interview
Rock Interview
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
Dr. Muhammad Ali Tirmizi., Ph.D.
 
An introduction to R is a document useful
An introduction to R is a document usefulAn introduction to R is a document useful
An introduction to R is a document useful
ssuser3c3f88
 

Similar to Financial Risk Mgt - Lec 1 by dr. syed muhammad ali tirmizi (20)

Statistical Analysis and Data Analysis using R Programming Language: Efficien...
Statistical Analysis and Data Analysis using R Programming Language: Efficien...Statistical Analysis and Data Analysis using R Programming Language: Efficien...
Statistical Analysis and Data Analysis using R Programming Language: Efficien...
 
R_L1-Aug-2022.pptx
R_L1-Aug-2022.pptxR_L1-Aug-2022.pptx
R_L1-Aug-2022.pptx
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
 
UNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdfUNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdf
 
2 it unit-1 start learning r
2 it   unit-1 start learning r2 it   unit-1 start learning r
2 it unit-1 start learning r
 
Best corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiBest corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbai
 
Succeeding with Functional-first Programming in Enterprise
Succeeding with Functional-first Programming in EnterpriseSucceeding with Functional-first Programming in Enterprise
Succeeding with Functional-first Programming in Enterprise
 
Getting started with R
Getting started with RGetting started with R
Getting started with R
 
Productivity Factors in Software Development for PC Platform
Productivity Factors in Software Development for PC PlatformProductivity Factors in Software Development for PC Platform
Productivity Factors in Software Development for PC Platform
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
 
FULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdfFULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdf
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Introduction to R ajay Ohri
Introduction to R ajay OhriIntroduction to R ajay Ohri
Introduction to R ajay Ohri
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
 
Lecture_R.ppt
Lecture_R.pptLecture_R.ppt
Lecture_R.ppt
 
GET STARTED WITH R FOR DATA SCIENCE
GET STARTED WITH R FOR DATA SCIENCEGET STARTED WITH R FOR DATA SCIENCE
GET STARTED WITH R FOR DATA SCIENCE
 
Fresher's guide to Preparing for a Big Data Interview
Fresher's guide to Preparing for a Big Data InterviewFresher's guide to Preparing for a Big Data Interview
Fresher's guide to Preparing for a Big Data Interview
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
 
An introduction to R is a document useful
An introduction to R is a document usefulAn introduction to R is a document useful
An introduction to R is a document useful
 

More from Dr. Muhammad Ali Tirmizi., Ph.D.

Financial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Financial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 14
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 14Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 14
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 14
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 13Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 13
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 5
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 5Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 5
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 5
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 3
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 3Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 3
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 3
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Special topics in finance lec 1
Special topics in finance   lec 1Special topics in finance   lec 1
Special topics in finance lec 1
Dr. Muhammad Ali Tirmizi., Ph.D.
 

More from Dr. Muhammad Ali Tirmizi., Ph.D. (17)

Financial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 14 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 13 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 12 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 11 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 10 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 9 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 8 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 7 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 5 & 6 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 3 by Dr. Syed Muhammad Ali Tirmizi
 
Financial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 2 by Dr. Syed Muhammad Ali Tirmizi
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 14
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 14Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 14
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 14
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 13Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 13
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 13
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 5
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 5Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 5
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 5
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 3
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 3Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 3
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 3
 
Special topics in finance lec 1
Special topics in finance   lec 1Special topics in finance   lec 1
Special topics in finance lec 1
 

Recently uploaded

一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
hyfjgavov
 
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
taqyea
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Fernanda Palhano
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
ihavuls
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
SaffaIbrahim1
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
a9qfiubqu
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
VyNguyen709676
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
sameer shah
 

Recently uploaded (20)

一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
 
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
 

Financial Risk Mgt - Lec 1 by dr. syed muhammad ali tirmizi

  • 1. FINANCIAL RISK MGT - FRM Lecture by; Dr. Syed Muhammad Ali Tirmizi INTRODUCTORY LECTURE 1
  • 2. 2 MODERN WORLD FRM ANALYTICS  Its absolutely true, that with modern programming languages like R and Python, a skilled analyst can now design their FRM analytic logic with significantly less effort than before, using resources such as Yahoo! or other free services for historical quotes.
  • 3. 3 MODERN WORLD FRM ANALYTICS  The algorithms (A precise rule or set of rules specifying how to solve a problem) has made us to comprehend that the programs, using data science techniques, can not only automate very tedious calculations but then very positively yield insights into the human thinking level: insights that would otherwise not be found.
  • 4. 4 MODERN WORLD FRM ANALYTICS  Data science involves the study of statistical and computational models.  Data engineering is the process of implementing models on computers as applied to large datasets, using files, program logic, testing, and continuous improvement.  We take advantage of the data science principles to build and engineer our financial laboratory using R Software.
  • 5. 5 UNDERSTANDING ANALYTICAL THINKING  As an investor, there is no more immediate feeling of excitement than a stock split during a bull market or an acquisition that can bid one’s stock up by 20 percent in a day.  Even though semi-random events can risk the desired outcome.  Therefore, in a nutshell, when faced with risks, preparation makes success more feasible.
  • 6. 6 UNDERSTANDING ANALYTICAL THINKING  What would a financial analytics approach tell us from a purely objective perspective? As we practice financial analytics, we are trained, informed, and more prepared for unexpected situations.  Along with robust and accurate data, designing models is a key component of the professional practice of analytics.  The most important applied models will be exemplified during the course so that they can be adapted, relied upon, and expanded.
  • 7. 7 UNDERSTANDING ANALYTICAL THINKING  Models are presented in this course using hand-written code in the R language, using historical market datasets to gain a deeper understanding of the behavior.  Analytics are applied to Big Data in order to take advantage of the large sample sizes.  Insights and discovery are simply more realistically possible with large datasets.
  • 8. 8 WHAT IS ANALYTICAL FRM?  The 2008 financial crisis made market practitioners to realize that reliance on models which are mathematically pure but fundamentally inaccurate is no longer acceptable. Therefore, a more practical approach is needed to tackle these situations.  The financial markets where the instruments reside have many more tail events (risk events – fat tails) that had and have contributed to the flash crash, tech bubble, and mortgage-based crisis with more to come.
  • 9. 9 WHAT IS ANALYTICAL FRM?  Practitioners are in need of tools for quick discovery and simulation to complement and calibrate the mathematics.  The emerging new field of Analytics, also known as Data Science, is providing computational intelligence to businesses in ways many had never envisioned.  Analytical computer programs are recommending everything from medical diagnoses to automobile routes to entertainment contents.
  • 10. 10 WHAT IS ANALYTICAL FRM?  Investment firms like PIMCO and Vanguard have helped investors meet retirement goals or send their children to college by carefully delivering positive market exposure (i.e., effective financial risk management).  This course will provide the tools for being able to understand better what firms like these and other financial entities do relating financial risk management practices.  Therefore, Optimization is an important aspect of financial analytics particularly in the case of FRM.
  • 11. Statistical Analyses Using R Starting Book for Beginners to understand and Use R Software Effectively 11 Lecture by; Dr. Syed Muhammad Ali Tirmizi
  • 12. 12 READ THE HANDBOOK (Book is also available online)
  • 13. 13 INTRODUCTION  R language has its roots at AT&T Bell Laboratories during the 1970s and 1980s in the S language project (Becker, Chambers, and Wilks, 1988).  People think that the S language would not have been designed in the way it was if it had been designed by computer scientists (Morandat, Hill, Osvald, and Vitek, 2012).
  • 14. 14 INTRODUCTION  R is an open source variant of S developed at the University of Auckland by Ross Ihaka and Robert Gentleman, first appearing in 1993 (Ihaka, 1998).  Clearly the recent popularity of R, fueled by its open source availability and the need for statistical and analytical computing tools, shows that the benefits of R far outweigh the negatives.  Overall, R is based upon the vector as a first class item in the language.
  • 15. 15 INTRODUCTION  R shares this attribute with LISP, Scheme, Python, and Matlab.  This and the prevalence of over 4,000 publicly available packages are two of the many strengths of R.  In this course, we will focus on R packages that revolve around financial risk management modelling and portfolio optimization.
  • 17. 17 GETTING STARTED WITH R  One of the great things about R is how easy it is to install.  In your browser, head to the web site for the Comprehensive R Archive Network (CRAN), http://cran.r-project.org  This website will help you to download and install R software for windows.  Just as a basic test, we can create a vector of prices and plot it with this block of code: x <- c(1.3,1.2,1.3,NA,1.4,1.5) plot(x,ylab="EUR prices") is.na(x) [1] FALSE FALSE FALSE TRUE FALSE FALSE R CODES
  • 18. 18 GETTING STARTED WITH R  The c() operator creates a vector of elements.  This is the basic vector operator in R.  Note the “not available” (NA) element appearing as the fourth item of the vector.  R’s ability to handle NAs, infinite values (Inf), and not a number (NaN) is one of its many strengths.
  • 19. 19 GETTING STARTED WITH R  A later development is the R Studio GUI available from the web site www.rstudio.com.  R Studio is a commercially developed GUI allowing management of plot windows, variable contents, and better debugging than the basic R interpreter.  R Studio is a second-generation R user interface with integrated code, execution, variable inspection, and plotting windows, and expression completion.
  • 20. 20
  • 21. 21 GETTING STARTED WITH R  Any time a library statement is encountered, R will check that the package is available.  If not, it must be downloaded.  As an example, to download the ggplot2 package, use the following command: update.packages() install.packages("ggplot2",dependencies=TRUE) library(ggplot2)
  • 22. 22 LANGUAGE FEATURES: FUNCTIONS, ASSIGNMENT, ARGUMENTS, AND TYPES  R has four assignment operators.  The most basic operator is “<-”. This is the one we use in the first assignment in the code block below.  R’s functional nature is so strong that even this can be replaced by the function call assign (“x”, 1).
  • 23. 23 LANGUAGE FEATURES: FUNCTIONS, ASSIGNMENT, ARGUMENTS, AND TYPES  Over time, because people were used to other languages that use “=” instead, and even though “=” was used to assign parameter values in function calls (g(x, y = 7), for example), it was also made available for assignment in R.  So using “<-” or “=” is now really a matter of preference.
  • 24. 24 LANGUAGE FEATURES: FUNCTIONS, ASSIGNMENT, ARGUMENTS, AND TYPES > x <- 1 > assign("x",2) > x [1] 2 > x = 3 > x [1] 3 > f <-function(x) + { + x = 4 + x + } > f(x) [1] 4 > x [1] 3 RUN THESE CODES for Practice
  • 25. 25 LANGUAGE FEATURES: FUNCTIONS, ASSIGNMENT, ARGUMENTS, AND TYPES  R’s fourth assignment operator, with two “<”s, is known as the “super-assignment” operator.  Executing it will look outside the current frame for x, which is global to the function f , and assign to that x.  If there is no x in the global environment, it will create one and assign the value to it.
  • 26. 26 LANGUAGE FEATURES: FUNCTIONS, ASSIGNMENT, ARGUMENTS, AND TYPES > #The fourth type is "<<-" > x = 3 > x [1] 3 > f <-function(x) + { + x <<- 4 + x + } > f(x) [1] 4 > x [1] 4 > typeof(f) [1] "closure" > typeof(x) [1] "double" RUN THESE CODES for Practice
  • 27. 27 DATA FRAMES AND INPUT– OUTPUT  Data frames are one of R’s more unusual and handy features.  A data frame is a sequence of rows where the columns are heterogeneously typed. A common way of loading data frames is from the Excel .csv files. #Input-ouput: write.csv(d,file="d.txt",row.names=FALSE) e <- read.csv("d.txt",header=TRUE)
  • 28. 28 LISTS IN “R”  Lists are ordered aggregates like vectors, which are constructed by c(. . .).  However, lists differ from the basic vectors, in that they are recursively formed, using list(. . .). #Lists: c(1,c(1,2),3,"A",c(4,5)) [1] "1" "1" "2" "3" "A" "4" "5" list(1,c(1,2),3,"A",list(4,5))