math 2uu3 lecture 7 - ms.mcmaster.ca · whatare)buy)and)sell)rates?)...

74

Upload: others

Post on 22-Apr-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

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
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
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

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

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

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

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

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

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

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

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
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
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

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

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

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
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

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

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

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

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

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

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

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

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
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

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
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

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

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

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

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