math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?)...
Transcript of math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?)...
![Page 1: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/1.jpg)
![Page 2: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/2.jpg)
Propor%onal rela%onship:
Quan%%es A and B are called propor%onal if one is a mul%ple of the other, i.e.,
A = some number *B
examples: • conversion of units • scaling • money exchange • percent
![Page 3: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/3.jpg)
common: 1 kg = 2.2 lb and 1 lb = 1/2.2 kg = 0.45 kg precise: 1 kg = 2.20462 lb and 1 lb = 0.45359 kg
2.2*2.99=6.578 2.20462*2.99=6.5918
2.99/lb or 6.59/kg
![Page 4: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/4.jpg)
Currency exchange:
one currency = conversion factor * another currency
conversion factor is called buy rate or sell rate depending on whether we’re buying or selling currency
or, conversion factor could be some kind of average rate
![Page 5: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/5.jpg)
Average exchange rates (used for certain types of transac%ons)
Bank of Canada: http://www.bankofcanada.ca/rates/exchange/daily-converter/
![Page 6: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/6.jpg)
Different banks/ins%tu%ons offer different rates …
hUps://www.uexchange.ca/compare-‐rates.php
Rates at 4:22:22 pm on 12 February 2020
![Page 7: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/7.jpg)
And they fluctuate (change) all the %me
hUps://www.google.com/search?q=currecncy+exchange+euro+cdn+dollar&ie=u^-‐8&oe=u^-‐8&client=firefox-‐b-‐ab
Rates at 11:45:00 pm on 12 February 2020
![Page 8: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/8.jpg)
Example of buy and sell rates
Example: Euro Rates at 4:20:02 pm on 12 February 2020
Sco%abank: hUps://www.sco%abank.com/ca/en/0,,7662,00.html
![Page 9: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/9.jpg)
What are buy and sell rates?
Example: Sco%abank, exchange rates between Canadian Dollar and Euro (data from 12 Feb 2020)
1.4899 1.4044
Which is buy rate, which is sell rate?
If not clear: compute the conversion that you need using both rates, and the one that’s worse for you (beUer for the bank, exchange kiosk) is the right one
![Page 10: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/10.jpg)
Beware ... there are places with very unfavourable exchange rates
Example: Toronto Pearson Airport ice exchange kiosk
![Page 11: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/11.jpg)
If you have $1,000 US, and wish to convert to Cdn$ (then this kiosk BUYS US$ from you) you will get $1,099.70 Cdn
But if you have Cdn $ but need to buy $1,000 US (the kiosk SELLS US$ to you) you need to pay $1, 432.71 Cdn
![Page 12: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/12.jpg)
Op%onal: hUps://www.theguardian.com/money/2018/jun/23/holiday-‐money-‐best-‐cards-‐currency-‐rates-‐bank-‐charges-‐cash
![Page 13: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/13.jpg)
Op%onal: hUps://www.theguardian.com/money/2018/jun/23/holiday-‐money-‐best-‐cards-‐currency-‐rates-‐bank-‐charges-‐cash
Among other pieces of advice:
i.e., it’s always beUer to pay in the currency of the country we’re in
![Page 14: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/14.jpg)
Make a decision …
![Page 15: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/15.jpg)
Remember:
Called “dynamic currency conversion” which is onen a rip-‐off
select without conversion
![Page 16: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/16.jpg)
Some%mes purposely unclear, to confuse …
![Page 17: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/17.jpg)
Op%onal reading: hUps://bit.ly/2y2XPU8
![Page 18: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/18.jpg)
Conversion of units -‐ there are many online calculators
Note: no need to memorize conversion factors (but it’s good to know some)
![Page 19: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/19.jpg)
SI units are universal, and based on decimal system
Other units are s%ll in use; we’re used to it, but some%mes it’s confusing; for example
1 GB pint = 20 GB fl oz = 568 ml (1 GB fl oz = 28.4131 ml) 1 US pint = 16 US fl oz = 473 ml (1 US fl oz = 29.5735 ml)
ounces are not equal: 1 GB fl oz = 0.96 US fl oz
next slide: 20 US fl oz = 591.25 ml
![Page 20: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/20.jpg)
why 591ml? because 20 US fl oz = 591.25 ml
![Page 21: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/21.jpg)
Percent:
20% of A = 0.2 * A
Propor%onal in two ways:
with respect to percent and with respect to quan%ty
![Page 22: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/22.jpg)
![Page 23: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/23.jpg)
Op%onal reading: hUp://www.bbc.com/news/science-‐environment-‐38210837
Problem set 7, ques%on #24
![Page 24: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/24.jpg)
Is the math correct?
Increase from 30 to between 33 -‐ 36 vs about 10 -‐ 20% increase
![Page 25: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/25.jpg)
Important ques%on – always ask % of what?
Look at increase from 30 per 1000 to 36 per 1000 – that’s an (absolute) increase of 6 per 1000
Rela%ve (compared to something else): If 6 is compared to 30 … it is 20% If 6 is compared to 1000 … it is 0.6%
So it is both 20% and 0.6% increase!
![Page 26: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/26.jpg)
Why did the authors pick the 20% increase angle?
To make a (stronger) point!
![Page 27: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/27.jpg)
Linear change = all marginal changes are equal
Linear change = result of accumula%on (posi%ve or nega%ve)
![Page 28: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/28.jpg)
posi%ve marginal changes (posi%ve slope)
increasing quan%ty
nega%ve marginal changes (nega%ve slope)
decreasing quan%ty
![Page 29: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/29.jpg)
Compare: non-‐linear quan%ty (marginal changes differ)
marginal change from 1 to 2
marginal change from 10 to 11
![Page 30: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/30.jpg)
Why do we care about linear paUern/ linear func%ons?
It’s easy to work with and understand (visual representa%on is a line)
Certain data sets can be described using linear func%ons (this process is called linear regression)
![Page 31: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/31.jpg)
![Page 32: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/32.jpg)
Regression
We wish to understand and use a data set (which can have thousands, or millions of data points)
Assume that the data set models a rela%onship between one independent variable (explanatory, input) and one dependent variable (response, output)
Idea: reduce the data set to a mathema%cal curve, figure out how well that curve represents the data, and use that curve to draw conclusions (such as interpola%on and extrapola%on)
![Page 33: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/33.jpg)
If that curve is a line – linear regression (we will also do exponen%al regression)
We use a linear regression calculator (the link is on the 2UU3 page) hUps://keisan.casio.com/exec/system/14059929550941
and do not worry about how regression is calculated, but how to interpret and use what the calculator gives us
here is how it will work ...
![Page 34: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/34.jpg)
x ... percent on tests 1 and 2 y ... final grade
![Page 35: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/35.jpg)
How to make sense of this data? How can we use it?
![Page 36: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/36.jpg)
Idea: compute the line that best approximates the data; that line is called a line of regression or a trendline
![Page 37: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/37.jpg)
Using sonware or a regression calculator (details soon) we obtain the following data:
correla%on coefficient
line of regression
where: x = success on the first two tests combined (%) y = final course grade
![Page 38: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/38.jpg)
Using sonware or a regression calculator (details soon) we obtain the following data:
correla%on coefficient
line of regression
Interpolate: if x=60, then y= 0.7565(60)+18.95=64.34 if x=82, then y= 0.7565(82)+18.95=80.98
Extrapolate: if x=105, then y= 0.7565(105)+18.95=98.35
![Page 39: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/39.jpg)
Correla%on coefficient (denoted by r) tells us how well a linear model explains the rela%onship between the variables
In our case: we assumed a linear rela%onship between the success on tests 1, 2 and the final course grade; is this assump%on reasonable, i.e., how reliably can a line describe the data set we have?
Of course, there are outliers (data points “outside” of a paUern), but what is a “general trend”?
![Page 40: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/40.jpg)
Correla%on coefficient (no need to memorize all this)
Memorize: r larger than 0.7 … strong posi%ve correla%on r smaller than -‐0.7 … strong nega%ve correla%on
![Page 41: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/41.jpg)
x y 0 1.5 1 2 2 1.5 3 3 4 3
Sample linear regression calcula%on, 5 data points:
![Page 42: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/42.jpg)
x y
0 1.5
1 2
2 1.5
3 3
4 3
enter into online regression calculator
![Page 43: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/43.jpg)
y = A+Bx = 1.4+0.4x
r = 0.83 ... strong posi%ve correla%on
output ...
![Page 44: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/44.jpg)
Another example:
![Page 45: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/45.jpg)
y = A+Bx = 6.36-‐1.1x
r = -‐0.78... strong nega%ve correla%on
![Page 46: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/46.jpg)
Climate change = change in sta%s%cs about weather paUerns, due to:
• plate tectonics • volcanic errup%ons and changes in the atmosphere • solar effects • human popula%on and human ac%ons, animals,etc.
Climate change happens all the %me – but the big difference is this %me humans are the dominant cause and are accelera%ng the pace of the changes on Earth
![Page 47: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/47.jpg)
Climate change indicators – important quan%ta%ve measures
• Average global temperature
• Concentra%on of CO2 in the atmosphere
• Arc%c Sea ice extent (extent = area)
• Volume of Arc%c Sea ice
• Rising levels of oceans
![Page 48: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/48.jpg)
Assume it’s 1950 ... extrapolate to predict average global temperature in 2010-‐2020
![Page 49: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/49.jpg)
enter the data into regression calculator…
![Page 50: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/50.jpg)
Correla%on coeff. r =0.66
r is not larger than 0.7, so the correla%on is not strong
It is posi%ve or nega%ve correla%on?
What is the slope of the regression line? What does it mean, what are its units?
![Page 51: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/51.jpg)
scaUer plot (ie, data points) and the line of regression
![Page 52: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/52.jpg)
thus average temperature = 13.674 + 0.004t
where t is in years, t=0 represents 1880 (t=100 represents 1980, t=130 represents 2010, etc.)
predic%on for 2010 (extrapola%on) average temperature = 13.674 + 0.004*130 = 14.194 degrees C
compare to actual data ...
![Page 53: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/53.jpg)
Actual data
Conclusion: linear regression model does not give a good es%mate (regression coefficient suggests only a moderate (i.e., not strong) correla%on)
![Page 54: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/54.jpg)
![Page 55: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/55.jpg)
Linear regression: illicit drug overdose deaths in B.C.
hUp://www.cbc.ca/news/canada/bri%sh-‐columbia/a-‐year-‐of-‐overdoses-‐7-‐charts-‐that-‐show-‐the-‐scope-‐of-‐b-‐c-‐s-‐drug-‐crisis-‐1.3910246
Problem: Predict the number of deaths for 2016
![Page 56: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/56.jpg)
269 366
![Page 57: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/57.jpg)
Y=A+Bx= 269+48.5x
so
OD = 269+48.5x
Note: correla%on coefficient =1
Extrapolate (%me=4) … OD=463
![Page 58: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/58.jpg)
![Page 59: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/59.jpg)
Major conclusion:
Extrapola%on can be very wrong, even when the correla%on coefficient is high!
What can we do? • Look at more detailed data (monthly vs yearly) • Try different pairs of points, and then compute the average of all extrapola%ons • Try with (lot) more data points
![Page 60: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/60.jpg)
End of 2016?
![Page 61: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/61.jpg)
Trends are difficult to iden%fy !!!
![Page 62: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/62.jpg)
Possible approach: take two newest data points and assume linear growth
![Page 63: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/63.jpg)
Y=A+Bx= 366+144x
so
OD = 366+144*%me
Note: correla%on coefficient =1
Extrapolate (%me=2) … OD=654
![Page 64: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/64.jpg)
Possible approach: take more data (say from 2010 to 2015) and assume linear growth
211 330
510
366
269
292
t=0 in 2010
![Page 65: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/65.jpg)
Enter data, then Execute
![Page 66: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/66.jpg)
Y=A+Bx= 202.7+50.8x
so
OD = 202.7+50.8*%me
Note: correla%on coefficient =0.9
Extrapolate (%me=6) … OD=507.5
![Page 67: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/67.jpg)
![Page 68: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/68.jpg)
hUps://w
ww.businessinsider.com
/cho
colate-‐con
sump%
on-‐vs-‐no
bel-‐
prizes-‐2014-‐4
![Page 69: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/69.jpg)
![Page 70: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/70.jpg)
Further data … can build more linear models
![Page 71: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/71.jpg)
Extrapolate to predict average global temperature in 2010
![Page 72: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/72.jpg)
Actual data
![Page 73: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/73.jpg)
The Keeling Curve (in Problem set 9, ques%ons 5, 6)
hUps://scripps.ucsd.edu/programs/keelingcurve/
![Page 74: math 2uu3 lecture 7 - ms.mcmaster.ca · Whatare)buy)and)sell)rates?) Example:)Sco%abank,)exchange)rates)between)Canadian) Dollar)and)Euro))(datafrom)12)Feb)2020)) 1.4899 1.4044 Which)is)buyrate,which)is](https://reader035.fdocuments.net/reader035/viewer/2022062417/6128cb38b9c5d44fb879f9ca/html5/thumbnails/74.jpg)