Unformatted Document Excerpt
Coursehero >>
New York >>
Columbia >>
IEOR 4726
Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Finance Experimental IEOR Department Mike Lipkin, Pankaj Mody
Housekeeping
Lab/home connectivity? Problem Set 2 due next week Office Hours
5:15pm to 8:00pm in Rm 318 (if the main door is locked, call 212-854-2987)
Also due next week, ONE person from each group, please email Pankaj (pm2655@columbia.edu) and Marco (ms4164@columbia.edu):
List of team members and their UNI Ids
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 2
Outline
Tables Select Statements Joins and Views Indices
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 3
Some Basic Database Design Background Four Basic Building Blocks: Tables: Information is split into multiple tables in order to minimize redundant information storage and to maximize speed of data return Indices and Keys: Organizing indices in an efficient manner so that queries return data quickly Views: Aggregation of table information into one virtual table Stored procedures and Functions: Similar to functions in C can pass data by reference or by value. Have the added capability of returning a query result.
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 4
Tables and Normalization
Normalization
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 5
Table Structures
Tables are normalized and split up for the following reasons:
Reduce storage by eliminating redundancy Querying smaller datasets is always faster Data management and storage for real-time systems: Data of the same type (i.e. same columns) can be split into multiple tables and stored on different drive clusters with their own controllers for simultaneous access.
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 6
Database Keys
Tables must have primary keys so that each row is uniquely identifiable. A primary key may consist of one or more columns SECURITY SECURITY_PRICE
Key: SecurityID
Key: SecurityID, Date
OPTION_PRICE
Key: SecurityID, Date, Expiration, Strike, callPut
Experimental Finance Mike Lipkin, Alexander Stanton Page 7
Database Keys - continued Keys can be based on columns that contain information e.g. Social security number ISBN number for books Is the ticker symbol a good key choice?
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 8
Database Keys - continued Keys can be based on columns that contain information e.g. Social security number ISBN number for books Is the ticker symbol a good key choice? No. Any data that has a remote possibility of changing is never a good candidate for a primary key Historical data would require time-consuming updates when a corporate name change occurs Existing queries and stored procedures might break if keys are referenced in any way (say as part of temporary or result tables)
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 9
Database Keys Additional reasons not to use data elements as primary keys:
Possibility of nulls (options may need to be created in a database before they have an official exchange ID or value) Changes in data structures and naming conventions Varying length data and size limitations
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 10
Database Keys Additional reasons not to use data elements as primary keys:
Possibility of nulls (options may need to be created in a database before they have an official exchange ID or value) Changes in data structures and naming conventions Varying length data and size limitations
A good financial example of a really bad key choice: IBMBL.X 60 Feb 2007 Call Last: 37.50 OI: 1451
After IBMBL.X expires, it is re-used. This causes major headaches during analysis, especially when the information to reconstruct the option is not available
Experimental Finance Mike Lipkin, Alexander Stanton Page 11
Surrogate Keys
Surrogate keys are used to manage relationships between data where even the defining data is likely to change
Effective Date
securityID stays constant with stock and option prices for the same company
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 12
What really happened?
Citibank used to be CCI before it merged with TRV C merged with Daimler to become DCX When Citibank merged with Traveler s Group it stayed CCI for two months before changing to C, about one month after Chrysler merged with Daimler. C was Chrysler it is now Citibank TRV is now Thousand Trails Inc. CCI is now Crown Castle Intl.
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 13
SQL Syntax
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 14
SQL Syntax Transact SQL is the database language pronounced Sequel Most databases use SQL to manipulate data Microsoft SQL Oracle Postgres MySQL
There are varying formats for SQL, but differences are minimal: e.g. return the top 10 rows: SELECT ticker FROM security limit 10; (MySQL) SELECT TOP 10 ticker FROM security; (MS-SQL) SELECT ticker FROM security WHERE ROWNUM < 10; (Oracle)
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 15
SQL Syntax
SQL has 2 parts DML Data Manipulation Language
Commands which retrieve from, update, delete or insert rows into a table, e.g.
SELECT UPDATE DELETE INSERT INTO
DDL Data Definition Language
Commands which define and update database objects such as tables, views, indexes and entire databases, e.g.
CREATE TABLE CREATE VIEW DROP TABLE CREATE INDEX
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 16
SELECT Queries
Basic Format SELECT <columns> FROM <table> WHERE <condition> ORDER BY <columns>
e.g.
SELECT securityID FROM security WHERE ticker= MSFT
result: 1051334
The keyword DISTINCT can be used to remove duplicates: SELECT DISTINCT strike FROM option_price (for MSFT in 2006)
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 17
WHERE Clause WHERE clause can use several operators: > < = AND, OR, LIKE, BETWEEN, IS NULL, IN, NOT e.g. SELECT securityID, date, closePrice FROM security_price WHERE close_price>200 AND date BETWEEN 2005-01-01 AND 2005-01-03 ORDER BY securityID, date
Returns all closePrices for stocks that have a price greater than $200, ordered first by ticker, then by date
Experimental Finance Mike Lipkin, Alexander Stanton Page 18
GROUP BY Clause
GROUP BY clauses create groupings when using aggregate functions such as:
AVG(), SUM(), COUNT(), MAX(), MIN()
e.g.
SELECT ticker, date, MAX(closePrice) as maxClosePrice, (weekNumber) FROM security_price WHERE date BETWEEN 2005-01-01 AND 2005-01-03 GROUP BY ticker, (weekNumber) ORDER BY ticker, (weekNumber)
Instructs SQL to return the maximum close price for each week for each ticker (i.e. grouped by ticker and week )
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 19
GROUP BY Clause Using a Count
SELECT securityID, date, count(*) FROM option_price GROUP BY securityID, date ORDER BY securityID, date Desire the number of different strikes across all series per day
What might be wrong here?
Experimental Finance Mike Lipkin, Alexander Stanton Page 20
Fixed Count
SELECT securityID, date, count(*) FROM option_price WHERE callPut = call GROUP BY securityID, date ORDER BY securityID, date
day per
Returns the number of strikes across all expirations per ticker
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 21
IN Clause IN Clause: SELECT ticker, date, closePrice FROM security_price WHERE ticker IN ( MSFT , MT , INTL , KO ) AND date BETWEEN 2005-01-01 AND 2005-01-03 ORDER BY date, ticker Returns all closePrices for the four stocks in the date range, ordered first by date, then ticker.
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 22
Sub Queries:
SELECT ticker, date, closePrice FROM security_price WHERE ticker IN (SELECT ticker FROM myTickerTable) AND date BETWEEN 2005-01-01 AND 2005-01-03 ORDER BY date, ticker
Very useful speed up strategy for repeated querying: Instead of joining two large tables to find the intersection, and running this repeatedly, create a small table of the intersection and then use either a JOIN or a sub-query using IN for further queries
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 23
SQL JOINS
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 24
JOINS
Joins allow combining of data from disjoint tables based on keys Allow conditional selection of data from one table that matches (or doesn t match) conditions in another Join conditions can be based on primary keys, unique and nonunique keys, as well as generic data in the table Joins can be complicated they are highly susceptible to design errors, and can lead to exceedingly long query times and incorrect data
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 25
JOINS
Stock Price
Option Price
Stock & Option Data
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 26
JOINS
Basic Format SELECT <columns> FROM <table1> INNER JOIN <table2> ON <condition> WHERE <condition> ORDER BY <columns> Returns a Cartesian product of table1 and table2, N x M rows <Conditions> can have multiple components Beware!! Joins where the condition is not precisely matched can cause large record sets of garbage data Usage of NULL is very powerful
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 27
INNER JOINS JOIN tables based on one or more conditions Result is an intersection of both tables where JOIN condition is satisfied SELECT ticker, date, closePrice FROM security s INNER JOIN security_price sp ON s.securityID=sp.securityID
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 28
INNER JOINS SELECT securityID, sp.date, sp.closePrice, o.strike, o.closePrice FROM security_price sp INNER JOIN option_price o ON o.securityID=sp.securityID
What is wrong here?
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 29
Cartesian Products JOIN conditions result in Nmatch X Mmatch Rows It is critical to get them right: SELECT ticker, sp.date, sp.closePrice, o.strike, o.closePrice FROM security_price sp INNER JOIN option_price o ON o.securityID=sp.securityID AND o.date=sp.date
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 30
JOIN Conditions- continued Note that this is not (quite) the same as: SELECT ticker, sp.date, sp.closePrice, o.strike, o.closePrice FROM security_price sp INNER JOIN option_price o ON o.securityID=sp.securityID WHERE o.date=s.date WHY?
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 31
JOIN Conditions- continued Note that this is not the same as: SELECT ticker, sp.date, sp.closePrice, o.strike, o.closePrice FROM security_price sp INNER JOIN option_price o ON o.securityID=sp.securityID WHERE o.date=s.date WHY? The processing order is: FIRST: Joins evaluated SECOND: results restricted by WHERE clause The query above creates much more data, most of which is false, and then trims out the false results. Highly inefficient. (NOTE: some SQL engines are good at parsing and optimizing, but this is fundamental knowledge you should have. The DB might get it wrong so the more you know the better)
Experimental Finance Mike Lipkin, Alexander Stanton Page 32
OUTER JOINS
JOINS OUTER select all data from one table, and only data from the second table where the JOIN condition is matched: SELECT ticker, date, closePrice FROM security s LEFT OUTER JOIN security_price sp ON s.securityID=sp.securityID
Joins are evaluated first, then the results are restricted according to the WHERE clause Can use LEFT OUTER JOIN and RIGHT OUTER JOIN to specify which table will be returned in full Columns values from the second table that don t match are filled with a NULL
Experimental Finance Mike Lipkin, Alexander Stanton Page 33
OUTER JOINS SELECT ticker, date, closePrice FROM security s LEFT OUTER JOIN security_price sp ON s.securityID=sp.securityID
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 34
Power of Nothing
OUTER JOINS are very powerful in conjunction with the NULL value. Example: SELECT TOP 1 ticker FROM security s LEFT OUTER JOIN security_price sp ON s.securityID=sp.securityID WHERE sp.date=NULL
Result:
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 35
Unfortunate Syntax
Table1 LEFT JOIN table 2 ON table1.ID = table2.ID Table1 LEFT OUTER JOIN Table2 ON table1.ID = table2.ID Table1, Table2 WHERE table1.ID = table2.ID Bad Syntax confuses WHERE clause Table1 OUTER JOIN Table2 ON table1.ID = table2.ID Bad Syntax only time the order of the tables matters
Use Standard ANSI-92 Notation: Table1 LEFT OUTER JOIN Table2 ON table1.ID = table2.ID
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 36
FULL JOINS and CROSS JOINS
FULL JOINS evaluate both tables and return all rows from both tables
CROSS JOINS return the cartesian product of two tables where there is no common key (i.e., no ON clause)
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 37
UNIONs UNIONs join tables with identical tables structures: SELECT * FROM OPTION_PRICE_2005_01 UNION ALL SELECT * FROM OPTION_PRICE_2005_02
2005_01
2006_02
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 38
Self JOINS
SQL processing is entirely row based There is no knowledge of previous or future row values One solution is to use JOINS to join a table to itself
SELECT s.ticker, sp1.date, sp1.closePrice, sp2.date, sp2.closePrice FROM security s INNER JOIN security_price sp1 on sp1.ID = s. ID LEFT JOIN security_price sp2 on sp2.ID = sp1.ID AND sp2.date=sp1.date-1 WHERE ticker='MSFT' AND sp1.date between '2004-01-07 and '2004-01-12
Why the LEFT JOIN?
Experimental Finance Mike Lipkin, Alexander Stanton Page 39
Self JOINS
Why would this query be useful?
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 40
Self JOINS
Why would this query be useful?
Compute the log return: SELECT s.ticker, sp1.date, (sp1.close-sp2.close)/sp2.close AS logReturn
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 41
Comparing Stock Price Differences
select sp1.date, s1.ticker, sp1.closePrice, s2.ticker, sp2.closePrice, (sp1.closePrice-sp2.closePrice) as diff from ivydb..security_price sp1 inner join ivydb..security_price sp2 on sp1.date=sp2.date inner join ivydb..security s1 on s1.securityID=sp1.securityID and s1.ticker='MOT' inner join ivydb..security s2 on s2.securityID=sp2.securityID and s2.ticker='NOK' where sp1.date>'2004-01-01'
Experimental Finance Mike Lipkin, Alexander Stanton Page 42
Example: Price Differences
MOT vs. NOK price difference 1/2004-5/2005 8 6 4 2 0 10/6/03 -2 -4 -6 -8
1/14/04
4/23/04
8/1/04
11/9/04
2/17/05
5/28/05
9/5/05
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 43
VIEWS
Views are based on SELECT statements and offer a shortcut to dealing with data that has already been normalized Views are identical to tables in terms of querying. Each base table can and will be evaluated based on its own indices Views are generally non-updateable, but they do exist IVY has a large UNION query for option prices OPTION_PRICE_VIEW Views can be indexed (allows precompilation) CREATE VIEW myView AS SELECT {} FROM {} INNER JOIN {} INNER JOIN {} INNER JOIN {} INNER JOIN {} INNER JOIN {} WHERE {} Etc. SELECT ticker, date, logReturn FROM myView ORDER BY ticker, date
Experimental Finance Mike Lipkin, Alexander Stanton Page 44
Large Queries
SELECT sp.date, sp.closePrice, dbo.formatstrike(strike) as strike, expiration, callput, datediff(day,sp.date,expiration) as daysToExpiration, CAST(datediff(day,sp.date,expiration) as float)/360 as interestDays, dbo.mbbo(bestBid,bestOffer) as mbbo, PPOP = (case WHEN dbo.formatstrike(strike)<sp.closePrice THEN dbo.mbbo(bestBid,bestOffer) ELSE dbo.mbbo(bestBid,bestOffer)-(dbo.formatstrike(strike)-sp.closeprice) END), CPOP = (case WHEN dbo.formatstrike(strike)>sp.closePrice THEN dbo.mbbo(bestBid,bestOffer) ELSE dbo.mbbo(bestBid,bestOffer)-(sp.closeprice-dbo.formatstrike(strike)) END) FROM security s INNER JOIN security_price sp ON s.securityID=sp.securityID INNER JOIN option_price_view o ON o.securityID=s.securityID AND sp.date=o.date INNER JOIN option_price_view o2 ON o2.securityID=s2.securityID AND sp.date=o2.date-1 WHERE sp.date>='2001-01-01 00:00:00' AND sp.date<='2005-01-01 00:00:00' AND Ticker IN (SELECT ticker FROM portfolioTickers pt INNER JOIN option_price_view o3 ON pt.securityID=03.securityID WHERE putCall= P ) AND abs(sp.closeprice-dbo.formatstrike(strike))<=7.5 ORDER BY sp.date, strike, expiration, callput
Experimental Finance Mike Lipkin, Alexander Stanton Page 45
SQL is full of Gotchas
What is wrong here (this is an Oracle example): SELECT t.* FROM trades t WHERE ROWNUM < 6 ORDER BY date DESC
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 46
SQL is full of Gotchas
What is wrong here (this is an Oracle example): SELECT t.* FROM trades t WHERE ROWNUM < 6 ORDER BY date DESC
Corrected: SELECT * FROM (SELECT t.* FROM trades t ORDER BY date DESC) WHERE ROWNUM < 6
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 47
Indices
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 48
Indices
Indices are added to tables to quickly access results when asking for a subset Primary keys are inherently indexed
e.g. SELECT all option data for Microsoft on 2005-05-12 will be an indexed query Lets say, however, that we want to return all days where the volume was above 80,000,000 for any stock The database would not be able to use the same index since neither Date nor SecurityID is part of the query restriction
Experimental Finance Mike Lipkin, Alexander Stanton Page 49
Table Scans, or Why the Database Dies Table scans Every row in the table is traversed and compared to the requirement volume>80,000,000 , then the list is compiled and returned. With 642,000,000 rows this will not even happen overnight Resolution Define a index on the database based on the volume column This creates an ordered list that can be searched using a B-Tree quickly and efficiently. It is hardly ever necessary to use a table scan for historical data be careful!!
Experimental Finance Mike Lipkin, Alexander Stanton Page 50
The Big Catch The database can only use one index per operation Consider: SELECT all options FROM optionsTable WHERE ticker= MSFT AND optionVolume>10,000 The database has two options: Use the primary key index (securityID, date) to select only MSFT data, then do a scan on the subset Use the volume index to get all option data that has volume>10,000, then scan to return only MSFT data Which is better?
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 51
The Query Optimizer Query Plans Answer: It depends
Limiting to MSFT means that we can reduce the dataset by a factor of 5,000 using the primary key If MSFT strike volume is only above 10,000 very infrequently, and there are only a few other stocks that have a similarly high volume, the volume index will be more efficient.
The built in SQL Query Optimizer decides which index is better to use, based on hit ratios and other statistics This is a statistical process and the optimizer may choose a different query plan for the same query depending on circumstance A small change in the query (e.g. volume> 11,000) might cause it to change the query plan and use a different index, yielding completely different execution times
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 52
Query Plans are not Voodoo Look at the query plan before the query executes: set showplan_all [on|off] Displays the query plan, i.e. what steps the engine will use to execute the query. The query is not actually executed. Check the query will use the indices you expect it to If a slightly modified query takes much longer, compare query plans. It is possible to give the query optimizer Hints (e.g. use the volume index ) however this is for experts only the query optimizer is generally better than you.
Do not let queries run out of control!
Experimental Finance Mike Lipkin, Alexander Stanton Page 53
Data Validation and Cleaning
Always validate your results spot check by selecting example rows and perform the entire calculations manually IVY generally has good data, but care must be taken to ensure analysis is not based on inconsistent data, mostly as a result of query selectivity. All data sources have problems don t forget it Check for:
abnormal values negative numbers rounding errors COUNT/SUM that count differently sized sets (e.g. 4-day weeks)
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 54
Useful Functions
IF THEN ELSE Statements CAST (arithmetic) and CONVERT (strings) Date Functions:
DATEADD DATEDIFF DATEPART MONTH YEAR
FLOOR, CEILING
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 55
Date Gotchas Nobody agrees on holidays, especially internationally
4th July Bank Holidays Easter in Gregorian/Julian calendars, Orthodox vs. Catholic Weekends in Islamic countries Germany s hard-working four-day work-week On July 4th, 2008 they announced that the world's atomic clocks would be adding another second at the end of the year
The Maritime Freight Industry publishes local holiday schedules for every port in the world We aren t so lucky, and even if we know the dates, interpreting pricing rules for instruments and comparing different markets is exceedingly difficult Dates are just an example: Currencies, Lots, Price Ticks all provide ample fun for your weekend coding
Experimental Finance Mike Lipkin, Alexander Stanton Page 56
ODBC Setup
Control Panel -> Administrative Tools -> Data Sources (ODBC) Add a File DSN, choosing the SQL server driver Connect to the Database in the same way as the Query Analyzer
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 57
Excel & Data Sources
In Excel, choose Data->Import External Data->New Database Query Choose the DSN you created, and write a query to select results
Experimental Finance
Mike Lipkin, Alexander Stanton
Page 58
Next Time
Creating Tables Creating Temporary Tables Creating Indices Stored Procedures and Functions
PROBLEM SET 2 DUE NEXT WEEK
Also... you might want to read the following paper in your free time: A Market-Induced Mechanism For Stock Pinning
Experimental Finance Mike Lipkin, Alexander Stanton Page 59
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more.
Course Hero has millions of course specific materials providing students with the best way to expand
their education.
Below is a small sample set of documents:
Columbia - IEOR - 4726
Experimental Finance IEOR Spring 2012 Mike Lipkin, Pankaj ModyLecture 3fPinning KO last week pinning to 67.50 (weeklies)2/2/12Experimental FinanceMike Lipkin, Alexander StantonPage 2Lecture 3fPinningExperimental FinanceMike Lipkin, Alexander Stan
Columbia - IEOR - 4726
Experimental Finance, IEOR Mike Lipkin, Pankaj ModyHousekeeping Make sure your tables/views/functions are prefixed with UNI ID One zip file please, containing other files This week s winner is: One PDF with an excel file, zipped, 49kb This week s virtua
Columbia - IEOR - 4726
Experimental Finance IEOR Spring 2012 Mike Lipkin, Pankaj ModyLecture 5fDynamicsConsider the following scenarios: Stock XYZ; price, S0= 50.00; 3 weeks to go to expiration. Earnings date: 4 weeks away. For concreteness, we take the front month options t
Columbia - IEOR - 4726
Experimental Finance IEOR Mike Lipkin, Pankaj ModyOutline Problem set notes SQL statements continued Functions Stored Procedures Input/Output parameters Variable Declarations CursorsExperimental FinanceMike Lipkin, Alexander StantonPage 2Problem Set
Columbia - IEOR - 4726
Experimental Finance IEOR Spring 2012 Mike Lipkin, Pankaj ModyLecture 7fHard-To-Borrows Today I want to discuss a difficult, and often very lucrative but scary group of stocks. These are called: hard-to-borrow. Before I do that, I want to spend some ti
Columbia - IEOR - 4726
Experimental Finance IEOR Spring 2012 Mike Lipkin, Pankaj ModyLecture 8fTake-Overs From time to time stocks are acquired for cash, stock, or some combination of the two. There are many scenarios for these deals: Big buyer, small target Equals Take-und
Columbia - IEOR - 4726
Ivy DBFile and Data Reference ManualVersion 2.5Rev. 5/5/2005The material contained in this document is confidential and proprietary to OptionMetrics LLC. The names "OptionMetrics" and "Ivy DB" are registered trademarks of OptionMetrics LLC. Copyright
Columbia - IEOR - 4602
IEOR E4602: Quantitative Risk Management c 2012 by Martin HaughSpring 2012Basic Concepts and Techniques of Risk ManagementWe introduce the basic concepts and techniques of risk management in these lecture notes. We will closely follow the content and n
Columbia - IEOR - 4602
Copulas and DependencyIEOR E4602: Quantitative Risk managementInstructor: Martin Haugh Slides for QRM 2012Copulas and Dependency2Why Study Copulas? Copulas separate the marginal distributions from the dependency structure. Copulas help expose the fal
Columbia - IEOR - 4602
Contents1Coping with CopulasThorsten Schmidt1Department of Mathematics, University of Leipzig Dec 2006 Forthcoming in Risk Books "Copulas - From Theory to Applications in Finance"Contents1 Introdcution 2 Copulas: first definitions and examples 2.1 S
Columbia - IEOR - 4602
IEOR E4602: Quantitative Risk Management c 2012 by Martin HaughSpring 2012Dimension Reduction TechniquesWe study dimension reduction techniques in these notes focusing in particular on principal components analysis (PCA) and factor models. We will gene
Columbia - IEOR - 4602
Quantitative Risk ManagementQuantitative Risk Management: Concepts, Techniques and Tools is a part of the Princeton Series in FinanceSeries Editors Darrell Duffie Stanford University Stephen Schaefer London Business SchoolFinance as a discipline has be
Columbia - IEOR - 4602
IEOR E4602: Quantitative Risk Management c 2012 by Martin HaughSpring 2012Model RiskWe discuss model risk in these notes, mainly by way of example. We emphasize (i) the importance of understanding the physical dynamics and properties of a model (ii) th
Columbia - IEOR - 4602
IEOR E4602: Quantitative Risk Management c 2012 by Martin HaughSpring 2012Multivariate DistributionsWe will study multivariate distributions in these notes, focusing1 in particular on multivariate normal, normal-mixture, spherical and elliptical distri
Columbia - IEOR - 4602
IEOR E4602: Quantitative Risk Management c 2012 by Martin HaughSpring 2012Risk Measures, Risk Aggregation and Capital AllocationWe consider risk measures, risk aggregation and capital allocation in these lecture notes and build on our earlier introduct
Columbia - IEOR - 4602
IEOR E4602: Quantitative Risk management c 2012 by Martin HaughSpring 2012Typos / Errors in "Coping With Copulas"1. The derivation of equation (5) on page 4 doesn't follow because Fi Fi (y) y. It holds for continuous marginals in which case it may be s
SUNY Albany - AECO - 355
1. The government of Westlovakia has just reformed its social security system. Thisreform changed two aspects of the system: (1) It abolished its actuarial reductionfor early retirement, and (2) it reduced the payroll tax by half for workers whocontinu
Waterloo - STAT - 340
Tutorial 6Question 1Which of the following codeuses control variates toestimate theta?A.u=runif(1000)x=exp(1/x)mean(x)B.u=runif(1000)x=exp(1/x+x)+(e-1)/emean(x)C.u=runif(1000)x=exp(x)mean(x)D.u=runif(1000)x=exp(1/x)-exp(-x)+(e-1)/emean
Alaska Bible - ECON - 101
(d) a recession.Chapter 1: Introduction to MacroeconomicsAnswer: AThe two major reasons for the tremendous growth in output in theU.S. economy over the last 125 years are(a) population growth and low inflation.(b) population growth and increased pro
Alaska Bible - ECON - 101
Chapter 1Introduction to MacroeconomicsT Multiple Choice Questions1.The two major reasons for the tremendous growth in output in the U.S. economy over the last125 years are(a) population growth and low inflation.(b) population growth and increased
Alaska Bible - ECON - 101
Chapter 2The Measurement and Structureof the National EconomyT Multiple Choice Questions1.The three approaches to measuring economic activity are the(a) cost, income, and expenditure approaches.(b) product, income, and expenditure approaches.(c) c
Alaska Bible - ECON - 101
Chapter 2The Measurement and Structureof the National EconomyT Multiple Choice Questions1.The three approaches to measuring economic activity are the(a) cost, income, and expenditure approaches.(b) product, income, and expenditure approaches.(c) c
Alaska Bible - ECON - 101
Chapter 3Productivity, Output, and EmploymentT Multiple Choice Questions1.A mathematical expression relating the amount of output produced to quantities of capital and laborutilized is the(a) real interest rate.(b) productivity relation.(c) produc
Alaska Bible - ECON - 101
Chapter 4Consumption, Saving, and InvestmentT Multiple Choice Questions1.Desired national saving equals(a) Y Cd G.(b) Cd+ Id+ G.(c) Id+ G.(d) Y Id G.Answer: ALevel of difficulty: 1Section: 4.12.With no inflation and a nominal interest rate (i
Alaska Bible - ECON - 101
Chapter 4Consumption, Saving, and InvestmentT Multiple Choice Questions1.Desired national saving equalsd(a) Y C G.dd(b) C + I + G.d(c) I + G.d(d) Y I G.Answer: ALevel of difficulty: 1Section: 4.12.With no inflation and a nominal interest
Alaska Bible - ECON - 101
Chapter 6Long-Run Economic GrowthT Multiple Choice Questions1.Between 1870 and 1996, among the United States, Germany, Japan, and Australia, _ grew atthe fastest rate and _ grew at the slowest rate.(a) the United States; Germany(b) Germany; the Uni
Alaska Bible - ECON - 101
Chapter 6Long-Run Economic GrowthT Multiple Choice Questions1.Between 1870 and 1996, among the United States, Germany, Japan, and Australia, _ grew atthe fastest rate and _ grew at the slowest rate.(a) the United States; Germany(b) Germany; the Uni
Alaska Bible - ECON - 101
Chapter 7The Asset Market, Money, and PricesT Multiple Choice Questions1.A disadvantage of the barter system is that(a) no trade occurs.(b) people must produce all their own food, clothing, and shelter.(c) the opportunity to specialize is greatly r
Alaska Bible - ECON - 101
Chapter 7The Asset Market, Money, and PricesT Multiple Choice Questions1.A disadvantage of the barter system is that(a) no trade occurs.(b) people must produce all their own food, clothing, and shelter.(c) the opportunity to specialize is greatly r
Alaska Bible - ECON - 101
Chapter 8Business CyclesT Multiple Choice Questions1.One of the first organizations to investigate the business cycle was(a) the Federal Reserve System.(b) the National Bureau of Economic Research.(c) the Council of Economic Advisors.(d) the Brook
Alaska Bible - ECON - 101
Chapter 8Business CyclesT Multiple Choice Questions1.One of the first organizations to investigate the business cycle was(a) the Federal Reserve System.(b) the National Bureau of Economic Research.(c) the Council of Economic Advisors.(d) the Brook
Alaska Bible - ECON - 101
Chapter 9The IS-LM/AD-AS Model: A GeneralFramework for Macroeconomic AnalysisT Multiple Choice Questions1.The FE line shows the level of output at which the _ market is in equilibrium.(a) Goods(b) Asset(c) Labor(d) MoneyAnswer: CLevel of diffic
Alaska Bible - ECON - 101
Chapter 9The IS-LM/AD-AS Model: A GeneralFramework for Macroeconomic AnalysisT Multiple Choice Questions1.The FE line shows the level of output at which the _ market is in equilibrium.(a) Goods(b) Asset(c) Labor(d) MoneyAnswer: CLevel of diffic
Alaska Bible - ECON - 101
Chapter 12Unemployment and InflationT Multiple Choice Questions1.The origin of the idea of a trade-off between inflation and unemployment was a 1958 article by(a) A.W. Phillips.(b) Edmund Phelps.(c) Milton Friedman.(d) Robert Gordon.Answer: ALev
Alaska Bible - ECON - 101
Chapter 12Unemployment and InflationT Multiple Choice Questions1.The origin of the idea of a trade-off between inflation and unemployment was a 1958 article by(a) A.W. Phillips.(b) Edmund Phelps.(c) Milton Friedman.(d) Robert Gordon.Answer: ALev
Alaska Bible - ECON - 101
Chapter 13Exchange Rates, Business Cycles,and Macroeconomic Policy in theOpen EconomyT Multiple Choice Questions1.The price of one currency in terms of another is called(a) the exchange rate.(b) purchasing power parity.(c) the terms of trade.(d)
Alaska Bible - ECON - 101
Chapter 1Ten Principles of EconomicsTRUE/FALSE1.Scarcity means that there is less of a good or resource available than people wish to have.ANS: TDIF: 1REF: 1-0NAT: AnalyticLOC: Scarcity, tradeoffs, and opportunity costTOP: ScarcityMSC: Definiti
Alaska Bible - ECON - 101
Chapter 2Thinking Like An EconomistTRUE/FALSE1.Economists try to address their subject with a scientists objectivity.ANS: TDIF: 1REF: 2-1NAT: AnalyticLOC: The study of economics and definitions of economicsTOP: EconomistsMSC: Definitional2.Ec
Alaska Bible - ECON - 101
Chapter 3Interdependence and the Gains from TradeTRUE/FALSE1.In most countries today, many goods and services consumed are imported from abroad, and many goods andservices produced are exported to foreign customers.ANS: TDIF: 1REF: 3-0NAT: Analyt
Alaska Bible - ECON - 101
Chapter 4The Market Forces of Supply and DemandTRUE/FALSE1.Prices allocate a market economys scarce resources.ANS: TDIF: 1REF: 4-0NAT: AnalyticLOC: Markets, market failure, and externalitiesTOP: Market economiesMSC: Definitional2.In a market
Alaska Bible - ECON - 101
Chapter 5Elasticity and Its ApplicationTRUE/FALSE1.Elasticity measures how responsive quantity is to changes in price.ANS: TDIF: 1REF: 5-0NAT: AnalyticLOC: ElasticityTOP: Price elasticity of demandMSC: Definitional2.Measures of elasticity enh
Alaska Bible - ECON - 101
Chapter 6Supply, Demand, and Government PoliciesTRUE/FALSE1.Economic policies often have effects that their architects did not intend or anticipate.ANS: TDIF: 1REF: 6-0NAT: AnalyticLOC: The study of economics and definitions of economicsTOP: Pub
Alaska Bible - ECON - 101
Chapter 7Consumers, Producers, and the Efficiency of MarketsTRUE/FALSE1.Welfare economics is the study of the welfare system.ANS: FDIF: 1REF: 7-1LOC: Supply and demandTOP: WelfareNAT: AnalyticMSC: Definitional2.The willingness to pay is the m
Alaska Bible - ECON - 101
Chapter 8Application: the Costs of TaxationTRUE/FALSE1.Total surplus is always equal to the sum of consumer surplus and producer surplus.ANS: FDIF: 2REF: 8-1NAT: AnalyticLOC: Supply and demandTOP: Total surplusMSC: Interpretive2.Total surplus
Alaska Bible - ECON - 101
Chapter 9Application: International TradeTRUE/FALSE1.Trade decisions are based on the principle of absolute advantage.ANS: FDIF: 1REF: 9-1NAT: AnalyticLOC: Gains from trade, specialization and tradeTOP: Absolute advantageMSC: Interpretive2.Th
Alaska Bible - ECON - 101
Chapter 10ExternalitiesTRUE/FALSE1.Markets sometimes fail to allocate resources efficiently.ANS: TDIF: 2REF: 10-0NAT: AnalyticLOC: Markets, market failure, and externalitiesTOP: Market failureMSC: Interpretive2.When a transaction between a bu
Alaska Bible - ECON - 101
Chapter 11Public Goods and Common ResourcesTRUE/FALSE1.When goods are available free of charge, the market forces that normally allocate resources in our economyare absent.ANS: TDIF: 2REF: 11-0NAT: AnalyticLOC: Markets, market failure, and exter
Alaska Bible - ECON - 101
Chapter 12The Design of the Tax SystemTRUE/FALSE1.The average American pays a higher percent of his income in taxes today than he would have in the late 18thcentury.ANS: TDIF: 1REF: 12-0NAT: AnalyticLOC: The role of government TOP:Tax burdenMS
Alaska Bible - ECON - 101
Chapter 13The Costs of ProductionTRUE/FALSE1.The economic field of industrial organization examines how firms decisions about prices and quantitiesdepend on the market conditions they face.ANS: TDIF: 2REF: 13-0NAT: AnalyticLOC: Costs of producti
Alaska Bible - ECON - 101
Chapter 14Firms in Competitive MarketsTRUE/FALSE1.For a firm operating in a perfectly competitive industry, total revenue, marginal revenue, and average revenueare all equal.ANS: FDIF: 2REF: 14-1NAT: AnalyticLOC: Perfect competitionTOP: Average
Alaska Bible - ECON - 101
Chapter 15MonopolyTRUE/FALSE1.Monopolists can achieve any level of profit they desire because they have unlimited market power.ANS: FDIF: 2REF: 15-0NAT: AnalyticLOC: MonopolyTOP: MonopolyMSC: Interpretive2.Even with market power, monopolists
Alaska Bible - ECON - 101
Chapter 16Monopolistic CompetitionTRUE/FALSE1.The "competition" in monopolistically competitive markets is most likely a result of having many sellers in themarket.ANS: TDIF: 1REF: 16-1NAT: AnalyticLOC: Monopolistic competitionTOP: Monopolistic
Alaska Bible - ECON - 101
Chapter 17OligopolyTRUE/FALSE1.The essence of an oligopolistic market is that there are only a few sellers.ANS: TDIF: 1REF: 17-0NAT: AnalyticLOC: OligopolyTOP: OligopolyMSC: Definitional2.Game theory is just as necessary for understanding com
Alaska Bible - ECON - 101
Chapter 18The Markets For the Factors of ProductionTRUE/FALSE1.If the marginal productivity of the sixth worker hired is less than the marginal productivity of the fifth workerhired, then the addition of the sixth worker causes total output to declin
Alaska Bible - ECON - 101
Chapter 19Earnings and DiscriminationTRUE/FALSE1.A compensating differential refers to a difference in wages that arises from nonmonetary characteristics.ANS: TDIF: 2REF: 19-1NAT: AnalyticLOC: Labor marketsTOP: Compensating differentialsMSC: De
Alaska Bible - ECON - 101
Chapter 20Income Inequality and PovertyTRUE/FALSE1.The poverty line is set by the government so that 10 percent of all families fall below that line and are therebyclassified as poor.ANS: FDIF: 1REF: 20-1NAT: AnalyticLOC: The study of economics,
Alaska Bible - ECON - 101
Chapter 21The Theory of Consumer ChoiceTRUE/FALSE1.The theory of consumer choice illustrates that people face tradeoffs, which is one of the Ten Principles ofEconomics.ANS: TDIF: 1REF: 21-0NAT: AnalyticLOC: Utility and consumer choiceTOP: Consu
Alaska Bible - ECON - 101
Chapter 22Frontiers of MicroeconomicsTRUE/FALSE1.The science of economics is a finished jewel, perfect and unchanging.ANS: FDIF: 1REF: 22-0NAT: AnalyticLOC: The Study of economics, and definitions in economicsTOP: economicsMSC: Definitional2.
Alaska Bible - ECON - 101
Chapter 23Measuring a Nation's IncomeTRUE/FALSE1.In years of economic contraction, firms throughout the economy increase their production of goods andservices, employment rises, and jobs are easy to find.ANS: FDIF: 1REF: 23-0NAT: AnalyticLOC: Th
Alaska Bible - ECON - 101
Chapter 24Measuring the Cost of LivingTRUE/FALSE1.The consumer price index is used to monitor changes in an economys production of goods and services overtime.ANS: FDIF: 2REF: 24-0NAT: AnalyticLOC: The study of economics and definitions of econo
Alaska Bible - ECON - 101
Chapter 25Production and GrowthTRUE/FALSE1.If per capita real income grows by 2 percent per year, then it will double in approximately 20 years.ANS: FDIF: 1REF: 25-0NAT: AnalyticLOC: Productivity and growth TOP:Economic growthMSC: Definitional