1 / 21

Aðalbjörn Þórólfsson ath@alit.is

Aðalbjörn Þórólfsson ath@alit.is. Financial derivatives. Stock price models and parameters ( hlutabréfalíkön og kennistærðir ) Approx. 2 weeks Simple models Stochastic behavior ( slembiferli ) Financial derivatives ( fjármálaafleiður ) Approx. 2 weeks Introduction The Black-Scholes model

keelia
Download Presentation

Aðalbjörn Þórólfsson ath@alit.is

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aðalbjörn Þórólfssonath@alit.is Líkön og mælingar – Fjármálaafleiður

  2. Financial derivatives • Stock price models and parameters (hlutabréfalíkön og kennistærðir) • Approx. 2 weeks • Simple models • Stochastic behavior (slembiferli) • Financial derivatives (fjármálaafleiður) • Approx. 2 weeks • Introduction • The Black-Scholes model • Bank visit and other material • Approx. 1 week Líkön og mælingar – Fjármálaafleiður

  3. Simple stock price models Líkön og mælingar – Fjármálaafleiður

  4. Price model 1 • The value of a stock at a given time t [t0,T] is supposed to be a continuous real function: S :[t0,T] R • The value of S(t0) is known. • The change in value with time is constant: dS = dt or S(t) = S(t0) + (t- t0) • Limitation: Doesn’t allow fluctuations with time. Líkön og mælingar – Fjármálaafleiður

  5. Stochastic processes • A variable whose value changes over time in an uncertain way is said to follow a stochastic process (slembiferli). • In a Markov process,future movements of a variable depend only on where we are, not the history of how we got there. • Stock prices are usually assumed to follow Markov processes. Líkön og mælingar – Fjármálaafleiður

  6. Basic Wiener process • A variable Z follows a basic Wiener process if it has the following two properties: • The change Z during a small time period t is Z =  t where  is a random drawing from a standardized normal distribution (0,1). • The values of Z for any two different short intervals of time t are independent. Líkön og mælingar – Fjármálaafleiður

  7. The normal distribution • Standardized form: • Mean: = 0. Variance  = 1. • Why the normal distribution? If X is the mean of N independent measurements of the same phenomena, then the distribution of X becomes normal as N (central limit theorem). • Examples: • Independent measurements of your height. • Stock price with no drift in the mean with time. Líkön og mælingar – Fjármálaafleiður

  8. Basic Wiener processes • Advantage: Allows fluctuations with time. • Limitation: Doesn’t show an average drift with time. Líkön og mælingar – Fjármálaafleiður

  9. Generalized Wiener process • A generalized Wiener process for a variable S is defined by: dS = a dt + b dZ where dZ (= dt) is defined as before. • The discrete form is: S = a t + b t where  is a random drawing from a standardized normal distribution (0,1). • A special case is b = 0, and we find model 1 for stock price: S = a t Líkön og mælingar – Fjármálaafleiður

  10. Price model 2 • The change in value with time is based on the general Wiener process: dS =  dt +  dZ or, in a discrete form: S = t +  t where  is defined as before. • Solution (T=t-t0, N=T/t): • The change in S after a period Tis normally distributed, has a mean =Tand a variance =2 T. Líkön og mælingar – Fjármálaafleiður

  11. Model comparisons • Model 1 - Linear: S(t) = 1.0 * t • Basic Wiener (no average drift with time): S(t) =  t • Model 2 - General Wiener: S(t) = 1.0 * t + 1.0 *  t Líkön og mælingar – Fjármálaafleiður

  12. The factor  • The factor  describes the amplitude of the stochastic behavior of stocks (volatility (flökt)), and thus how high the associated investment risk is: dS =  dt +  dZ • The factor  actually depends on time, but can be taken as a constant when considering relatively short periods. • The volatility can be estimated by: • The naked eye • Calculating the standard deviation of past data (see later) sdev =  = T Líkön og mælingar – Fjármálaafleiður

  13. More realistic considerations • In model 2, the drift and variability terms are independent of S(t). • However, investors require a certain percentage return: dS ~ S’ dt or S(t)=S(t0)e’Twith ’= /S(t0). • Also, the volatility term is, to a good appoximation, a percentage of the price: dS ~ S    dt Líkön og mælingar – Fjármálaafleiður

  14. Price model 3 (1) • The change in value is proportional the value: dS = S’ dt + S dZ • Result of Ito’s lemma: • The change in ln(S) after a period Tis normally distributed, has a mean =(’-2/2)Tand a variance =2 T. Líkön og mælingar – Fjármálaafleiður

  15. Price model 3 (2) • S is log-normally distributed, with a mean and a variance • How to calculate S: • Note: ’=/S(t0 ) gives a higher change than wished for. A better result is gotten with ’=ln(/S(t0 )) Líkön og mælingar – Fjármálaafleiður

  16. Historic volatility • Let ui=ln(Si /Si-1), i=0,1,...,N. This is the daily return in interval i, since Si=Si-1eui. • An estimate of the variance of the ui ‘s (one interval) is: • The variance (one interval) is =2t, so an estimate of the volatility for a period T=Ntis: Líkön og mælingar – Fjármálaafleiður

  17. Assignment 1 • Write programs that calculate and display the values of S(t) according to stock price models 1, 2 and 3. • Get real one-year data from the web and determine S(t0) and  (linear fit). Try to determine  by the naked eye and then by using the variance formula. Note that calculated  is only comparable to real data in model 3. • Compare the values /S(t0),  and the return/risk ratio: (S(t)-S(t0))/(S(t0)) for two different companies. Are the /S(t0) and the returns comparable? • Write and return a short report, including graphics and code. Líkön og mælingar – Fjármálaafleiður

  18. Tips (1) • Data on bi.is or financialweb.com • Use for example Excel, Perl and Gnuplot • One year = 1. • Linear fit: y = ax + b Líkön og mælingar – Fjármálaafleiður

  19. Tips (2) • Standardized normal distribution: • If x1 and x2 are random variables between 0 and 1, then y1 and y2 are standardized and normally distributed if • In model 3, the rise/fall tends to be overestimated if we use the obtained from linear fitting. Líkön og mælingar – Fjármálaafleiður

  20. Perl #!/usr/bin/perl #Launches the PERL compilator $file_in=$ARGV[0]; #The first argument passed to the program $file_out = "data.dat"; #Assign a filename open (INFILE,$file_in); #Relate INFILE with filename @ALL = <INFILE>; #Read all the data into a vector close (INFILE); #Close the infile open (OUTFILE,">" . $file_out); #Open for output for($k=1;$k<=$#ALL;$k++) #Loop over vector content { ($date,$day,$price,@rest) = split(/\s/,$ALL[$k]); #Split the fields on spaces $price =~ s/,/./; #Substitute . for , $day_norm = $day/365; #Normalize the time print (OUTFILE "$day_norm\t$price\n"); #Output data } close (OUTFILE); #Close the outfile --- To debug code, type: perl –wc program.pl To run code, type: ./program.pl infile.dat Líkön og mælingar – Fjármálaafleiður

  21. Gnuplot set terminal postscript landscape "Times-Roman" 22 set output “plot.ps“ set title “Title“ set ylabel "Value (kr/share)“ set xlabel "Time (years)" 0,-1 #set data style linespoints set data style lines #set nokey #set yrange [100:102.3] #set xrange [100:102.3] plot "data.dat“ using 1:2, 4.15 + 0.17*x --- To make a fit, start gnuplot, then type: f(x)=a*x+b fit f(x) ‘data.dat’ via a,b Líkön og mælingar – Fjármálaafleiður

More Related