×

### Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

or

by: Kwan

38

0

3

# Quantitative Financial Analysis Week II Notes BU.230.710.52.SP16

Marketplace > Johns Hopkins University > Finance > BU.230.710.52.SP16 > Quantitative Financial Analysis Week II Notes
Kwan
JHU

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

Matlab Lec2
COURSE
Quantitative Financial Analysis
PROF.
Stuart Urban
TYPE
Class Notes
PAGES
3
WORDS
KARMA
25 ?

## Popular in Finance

This 3 page Class Notes was uploaded by Kwan on Tuesday March 29, 2016. The Class Notes belongs to BU.230.710.52.SP16 at Johns Hopkins University taught by Stuart Urban in Spring 2016. Since its upload, it has received 38 views. For similar materials see Quantitative Financial Analysis in Finance at Johns Hopkins University.

×

## Reviews for Quantitative Financial Analysis Week II Notes

×

×

### What is Karma?

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 03/29/16
Quant  II Friday,  March  25,  2016 09:07 1.HW1 Format  shortg:  smarter  than  short  (choose  the  best  within  short) "disp([a  b  c])"  as  matrix Spacing/formating:  line  up  (lec  3)  [don't  waste  time] As  a  pool/variable:  t0 -­‐-­‐>  t1,  t2  as  subset  (reused/type  twice  meaning  errors  may  occur) 2.Lec  2  -page  26 x>y:  0  False;  1  True randi(10,1,5):  [1,10],  1x5 10*(x  >  5) == ~= &:  and |:  or NB.  (x>3)  |  (y>5):  use  (),  easy  to  read ~ Search  Matlab  order  of  precedence:  check  order  or  use  () Smart  indent:  for  readability Break  point:  use  red  point  (select  a  line  and  run-­‐)-­‐debug  mode  (K>>):  step,  show  results   of  each  step Walk  from  one  side  to  the  other:  s>K2;  s>K1  (s<=K2  implied) Don't  over-­‐specify  like  (s>K1)  &  (s<=K2) Loops: For:  i=1:5  (vector:  from  1  to  5) While:  orders  matter;  "control  +  c"  in  the  command  window  to  stop  infinity  (don't  know   how  many  times  to  run) Creating  a  Function  File: New  -­‐Function For:  i=1:5  (vector:  from  1  to  5) While:  orders  matter;  "control  +  c"  in  the  command  window  to  stop  infinity  (don't  know   how  many  times  to  run) Creating  a  Function  File: New  -­‐Function end  is  optional  and  bad  (delete) Mistake:  assign  a  variable  inside Help  Matlab_forwardPrice_function:  shows  between  the  %% Mapping In  the  same  folder Cmd  +  S:  save Yield: Fzeros:  like  a  solver  (initial  guess   -­‐>  0) (Optimization  toolbox   -­‐ to  fine  more  than  one  zero) y  =  fzero(@(y)sum(cash_flows.*exp( -­‐y*t))-­‐B,0.06) Anonymous  function Want  to  find  y;  initial s-­‐  0.06  (if  many  zeros,  decent  one  to  get  the  right  result) In-­‐Class  Exercise: If  -­‐ end  -­‐ statements Never  do  if  statement  on  a  vector:  may  return  only  a  single  result,  cuz  true  for  all  is  true For  I  =  1  :  length(ST);  call_payoff(i),  ST(i) -­‐-­‐>  Max(ST  -­‐ K,0):  vectorized Plot: Title Xlabel Ylabel Help  plot:  eg.'cd' Edit  -­‐ copy  figure Hold  on:  on  the  same Hold  off Figure;  :  separately Comment/uncomment Examples: ButterflySpread-­‐  -­‐ max:  consistent  (positive,1);  simplified:  payoff  =  call_payoff1  -­‐ 2 *call_payoff2  +  call_payoff3; Max-­‐-­‐>  get_call_payoff(s,k(1)) Examples: ButterflySpread-­‐  -­‐ max:  consistent  (positive,1);  simplified:  payoff  =  call_payoff1  -­‐ 2 *call_payoff2  +  call_payoff3; Max-­‐-­‐>  get_call_payoff(s,k(1)) Tab:  complete Plot:  the  right  inputs   -­‐-­‐eg.[];  linspace;[  :] Xls: {}:  cell  array Mac:  a  new  csv  column Files:  Matlab_dailyReturn.m  and  Matlab_dailyVolatility.m

×

×

### BOOM! Enjoy Your Free Notes!

×

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Janice Dongeun University of Washington

#### "I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!
×

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com