Like this presentation? Why not share!

# Financial Networks V - Inferring Links

## by Kimmo Soramaki, Founder at Financial Network Analytics on Feb 11, 2013

• 501 views

Fifth lecture of a PhD level course on "Financial Networks" at Center for Financial Research at Goethe University, Frankfurt.

Fifth lecture of a PhD level course on "Financial Networks" at Center for Financial Research at Goethe University, Frankfurt.

### Views

Total Views
501
Views on SlideShare
497
Embed Views
4

Likes
1
13
0

### Accessibility

Uploaded via SlideShare as Microsoft PowerPoint

## Financial Networks V - Inferring LinksPresentation Transcript

• Center for Financial Studies at the Goethe UniversityPhD Mini-courseFrankfurt, 25 January 2013Financial NetworksV. Inferring Links Dr. Kimmo Soramäki Founder and CEO FNA, www.fna.fi
• I. Mapping II. MappingSystemic Risk Financial Markets 2
• Observing vs inferring• Observing links – Exposures, payment flow, trade, co-ownership, joint board membership, etc. – Cause of link is known• Inferring links – Observing the effects and inferring a relationship – Cause of link is unknown – Time series on asset prices, trade volumes, balance sheet items 3
• AgendaV. Inferring Links• Prices and Returns• Controlling for common factors• Correlation and dependence• Significant correlations• Multiple ComparisonsVI. Correlation Networks• Distance and Hierarchical Clustering• Minimum Spanning Tree & PMFG• Filtering• Visual Layouts 4
• Prices and Returns 5
• Prices vs Returns• Benefit of using returns vs prices for correlations:• Normalization. All variables are denoted in same units• Required by some matrix algebra• Returns (on asset prices) have low serial correlation• Returns are what matter once investement is made• Well use returns 6
• Log vs Arithmetics Returns• Most often logarithmic returns are used in Finance. Why?• Benefit of using log returns vs arithmetic returns – Assumptions in statistical estimates (log-normal returns) – Easier calculations (integration, compounding) lead to smaller algorithmic complexity• Normaliy assumptions make log returns better• Well use log returns 7
• Data Issues• Which prices – daily (low, high, close) – time-zone issues – high-frequency• Missing prices – Errors in source data – Partial holidays – Weekends/holidays – Exit and entry of assets• Handling options – Look up from other sources – Edit values, e.g. replace with same as previous (prices) or 0 (returns) – Exclude days/series from analysis – Decide on weekend returns depending on data 8
• Ticker Name Sector WeightDAX stocks ADS Adidas clothing and footwear 2.0 ALV Allianz insurance 6.7 BAS BASF speciality chemicals 9.6 BAYN Bayer speciality chemicals 7.6 BEI Beiersdorf personal products 0.9 BMW BMW automobile manufacturers 3.3 CBK Commerzbank credit banks 1.0 CON Continental car parts manufacturers 0.8 DAI Daimler automobile manufacturers 5.8 DB1 Deutsche Börse securities brokers 1.5 DBK Deutsche Bank credit banks 5.1 DPW Deutsche Post logistics 1.9 DTE Deutsche Telekom fixed-line telecommunication 5.4 EOAN E.ON multi-utilities 6.2 FME Fresenius Medical Care health care 2.2 FRE Fresenius health care 1.6 HEI HeidelbergCement building materials 0.9 HEN3 Henkel personal products 1.5 IFX Infineon Technologies semiconductors 1.3 LHA Deutsche Lufthansa airlines 0.8 LIN Linde industrial gases 3.8 LXS Lanxess specialty chemicals 0.7 MRK Merck pharmaceuticals 1.0 MUV2 Munich Re re-insurance 2.9 RWE RWE multi-utilities 2.2 SAP SAP software 7.7 SDF K+S commodity chemicals 1.2 SIE Siemens diversified industrials 10.0 TKA ThyssenKrupp diversified industrials 1.3 VOW3 Volkswagen Group automobile manufacturers 3.4 9
• Data: Prices of 30 stocks in DAX in 2011 date ADS ALV BAYN BAS ... 2011-12-30 50.26 73.91 49.4 53.89 2011-12-29 49.94 73.21 48.73 53.17 2011-12-28 49.79 73.15 47.36 52.39 2011-12-27 50.3 75.45 48.27 53.17 2011-12-23 50.29 75.97 48.13 52.83 2011-12-22 49.98 75.81 47.92 52.63 2011-12-21 49.43 75.37 47.04 52.4 2011-12-20 49.56 75.43 46.99 52.9 2011-12-19 47.96 72.23 44.75 51.15 2011-12-16 48.1 72.77 45.04 51.71 2011-12-15 47.89 73.47 44.99 51.13 2011-12-14 48 71.53 44.8 50.58 2011-12-13 48.45 73.04 45.73 51.1 ... 10
• calculatereturns -command• File (-file) : File with price data. The file must contain a table where each row has the observation date as its first element, and asset prices as subsequent elements separated by a field delimiter. The first line read must contain names for each asset column (except the first column which contains the date). Mandatory.• Save As (-saveas) : File where result should be saved. Mandatory.• Date format (-dateformat) : Format of date in input file. Default value yyyy- MM-dd. Optional.• Method of calculation (-method) : Arithmetic (arithmetic) or logarithmic (log) returns. Mandatory. By default log.• Number of observations (-obs) : Larger than or equal to 2. Optional. By default 2.• Length of interval (-interval) : Larger than or equal to 1. Optional. By default 1.• Date order (-dateorder) : Date order in the file. Optional. Allowed values: [asc, desc]. By default asc. 11
• Examples# Calculate daily log returnscalculatereturns -file daxprices-2011.csv -saveas daxreturns-2011.csv -methodlog -dateorder desc# Calculate two-day log returnscalculatereturns -file daxprices-2011.csv -saveas daxreturnsl-2dl2.csv -methodlog -obs 2 -interval 2 -dateorder desc# Calculate two-day log returns with a one-day windowcalculatereturns -file daxprices-2011.csv -saveas daxreturnsl-2dl1.csv -methodlog -obs 2 -interval 1 -dateorder desc# Calculate daily arithmetic returnscalculatereturns -file daxprices-2011.csv -saveas daxreturns-2da1.acsv -methodarithmetic -dateorder desc 12
• Data: Returns of 30 stocks in DAX in 2011 date ADS.DE ALV.DE BAYN.DE BAS.DE ... 2011-12-29 0.0064 0.0095 0.0137 0.0135 2011-12-28 0.0030 0.0008 0.0285 0.0148 2011-12-27 -0.0102 -0.0310 -0.0190 -0.0148 2011-12-23 0.0002 -0.0069 0.0029 0.0064 2011-12-22 0.0062 0.0021 0.0044 0.0038 2011-12-21 0.0111 0.0058 0.0185 0.0044 2011-12-20 -0.0026 -0.0008 0.0011 -0.0095 2011-12-19 0.0328 0.0433 0.0488 0.0336 2011-12-16 -0.0029 -0.0074 -0.0065 -0.0109 2011-12-15 0.0044 -0.0096 0.0011 0.0113 2011-12-14 -0.0023 0.0268 0.0042 0.0108 2011-12-13 -0.0093 -0.0209 -0.0205 -0.0102 2011-12-12 0.0058 -0.0163 -0.0020 -0.0099 ... 13
• Common Factors• A common factor may be affecting all the returns – E.g bullish/bearish market• If we know the market return, we can deduct it from the returns to look at excess returns to market• If we dont know, we can try to control for this unknown common factor via statistical methods• Principal Component Analysis allows us to identify and remove the common factor 14
• Eigenvectors - example A plot of the normalised data (mean subtracted) -> First component explains maximum variance The data has two variables (x and y), the covariance matrix is 2x2 and thus there are two Eigenvectors The eigenvectors of the covariance matrix are overlayed as dotted lines 15
• Eigenvectors of asset correlations• The eigenvectors of a correlation matrix are orthogonal to each other. The data can be projected in terms of its eigenvectors• Each eigenvector represents a Priciple Component – if values are similar, the component affects all returns similarly• Eigenvalues scale with the share of variance explaned by each component – Divide each by the sum to get share• Laloux et al (1999) find on S&P500 (and other markets) – The largest eigenvalue is well separated from the bulk and corresponds to the whole market as the corresponding eigenvector has roughly equal components – The next largest eigenvectors carry information about the real correlations and can be used in identifying clusters of strongly interacting assets – The smaller eigenvectors are noise (95%)L. Laloux, P. Cizeau, J.-P. Bouchaud, M. Potters, Noise Dressing of Financial Correlation Matrices. Phys. Rev. Lett. 83 (1999)1467 ; T. Heimo, J. Saramaki, J-P. Onnela, K. Kaski (2007). Spectral and network methods in the analysis of correlationmatrices of stock returns, Physica A 383, pp. 147–151 16
• pca -command• File (-file) : File with input data.• Components (-components) : Components to keep, e.g. 2- or 1 or 2-10 Optional.• Observations (-obs) : Number of observations in each period.• Interval (-interval) : Number of observations between each period.• Saveas (-saveas) : Name of file to store amended data.Examples# calculate returns corresponding to all but principal componentpca -file dax-returns-2011.csv -obs 30 -interval 30 -components 2- -saveas dax-montly1.csv# calculate returns corresponding to second to 10th largest componentpca -file dax-returns-2011.csv -obs 30 -interval 30 -components 2-10 -saveas dax-montly2.csv 17
• Correlation and Covariance 18
• 19
• buildbycorrelation -command• File (-file) : File from which to read data. To skip lines or use non-default field delimiter use the delimiter and skiplines arguments. Mandatory.• Save as property (-saveas) : Property name of saved result. Optional. By default correlation.• Number of observations (-obs) : Larger than or equal to 2. Optional.• Length of interval (-interval) : Larger than or equal to 1. Optional.• -commitinterval : Larger than or equal to 1. Optional. By default 10000.• Save standard deviation (-savestdev) : Option to save standard deviation as vertex property. Optional. By default false.• Save average returns (-savereturns) : Option to save average returns as vertex property. Optional. By default true.• Preserve (-preserve) : Do not overwrite existing networks in database. Optional. By default true. 20
• • Missing values (-missing) : Handling of missing or non-numeric values in data. Alternatives: – Zero : missing values are considered as 0. – NaN : default value corresponds to NaN and missing values setting in Default format settings. – Alert : missing values cause the calculation to fail. Optional. Allowed values: [Zero, NaN, Alert]. By default Zero.• Start date (-start) : Starting date of calculation. Optional.• End date (-end) : Ending date of calculation. Optional.• Date format (-dateformat) : Format of date in input file. Default value corresponds to Date format setting in Default format settings. Optional.• Date order (-dateorder) : Order of dates in the input file. If dates are ascending order, the newest network has fewer observations than other networks. If dates are descending order, the oldest network has fewer observations. Optional. Allowed values: [asc, desc]. By default desc. 21
• Correlation Matrix & Network A B C A 0 0.72 0.31 B 0.72 0 0.60 C 0.31 0.60 0 22
• Examples# Calculate 100 day pairwise correlations with 1 day sliding window, considerany missing/non-numeric return as 0buildbycorrelationd -file daxreturns-2011.csv -missing Zero -days 100 -interval1 -preserve false# Calculate 100 day pairwise correlations with no sliding window, consider anymissing/non-numeric return as 0buildbycorrelationd -file daxreturns-2011.csv -missing Zero -days 100 -interval100 -preserve false# Calculate pairwise correlations for whole data, alert about missing valuesbuildbycorrelation -file daxreturns-2011.csv -missing Alert -preserve false 23
• Heatmap -command• Creates time series of heatmaps• Like viz -command• Allows mapping of data to cell size, shape, color, label, hover• Allows definition of color ranges and domains# create heatmap from correlationsheatmap -sortv vertex_id -p correlation -symmetric true -cellsizedefault 13 -transition 0 -cellhover correlation -colordomain (-1)-1 -palette darkblue-lightgray-darkred -saveas daxheat-def-Y 24
• 28&29All components Principal Component Removed 25