116
Statistical Inference for Networks Systems Biology Doctoral Training Centre Theoretical Systems Biology Module H ILARY T ERM 2008 P ROF.G ESINE R EINERT http://www.stats.ox.ac.uk/ reinert WITH P AO -Y ANG C HEN http://www.stats.ox.ac.uk/ chen AND W AQAR A LI 0-0

Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Statistical Inference for NetworksSystems Biology Doctoral Training Centre

Theoretical Systems Biology Module

HILARY TERM 2008PROF. GESINE REINERT

http://www.stats.ox.ac.uk/ reinertWITH PAO-YANG CHEN

http://www.stats.ox.ac.uk/ chenAND WAQAR ALI

0-0

Page 2: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Overview Lecture 1: Network summaries.What are networks? Some examples fromsocial science and from biology. The need to summarise networks. Clustering coefficient,degree distribution, shortest path length, motifs, between-ness, second-order summaries. Rolesin networks, derived from these summary statistics, and modules in networks. Directed andweighted networks. The choice of summary should depend on the research question.

Lecture 2:Models of random networks.Models would provide further insight into the net-work structure. Classical Erds-Renyi (Bernoulli) random graphs and their random mixtures,Watts-Strogatz small worlds and the modification by Newman, Barabasi-Albert scale-free net-works, exponential random graph models.

0-1

Page 3: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Lecture 3:Fitting a model: parametric methods.Deriving the distribution of summarystatistics. Parametric tests based on the theoretical distribution of the summary statistics (onlyavailable for some of the models).

Lecture 4:Statistical tests for model fit: nonparametric methods.Quantile-quantile plotsand other visual methods. Monte-Carlo tests based on shuffling edges with the number of edgesfixed, or fixing the node degree distribution, or fixing some other summary. The particularissue of testing for power-law dependence. Subsampling issues. Tests carried out on the samenetwork are not independent.

0-2

Page 4: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Lecture 5:Statistical inference for networks: local properties.Inferring characteristics fora missing node from the existing network. Log-linear regression models. Inferring missingedges and identifying false-positive edges. Logistic regression models.

Lecture 6:Statistical inference for networks: modules, motifs and roles.Identifying sim-ilar edges in networks. Clustering algorithms. Comparison of networks: two networks on thesame set of nodes. Regression models.

Lecture 7:Further topics.Hierarchical networks. Dynamics on networks.

0-3

Page 5: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Suggested reading

1. U. Alon: An Introduction to Systems Biology Design Principles of Biological Circuits.Chapman and Hall 2007.

2. S.N. Dorogovtsev and J.F.F. Mendes:Evolution of Networks. Oxford University Press2003.

3. R. Durrett:Random Graph Dynamics. Cambridge University Press 2007.

4. R. Gentleman, V. Carey, W. Huber, R. Irizarry, S. Dutoit (eds).Bioinformatics andComputational Biology Solutions using R and Bioconductor. Springer 2005.

5. W. de Nooy, A. Mrvar and V. Bagatelj.Exploratory Social Network Analysis with Pajek.Cambridge University Press 2005.

6. S. Wasserman and K. Faust:Social Network Analysis. Cambridge University Press1994.

7. D. Watts:Small Worlds. Princeton University Press 1999.

0-4

Page 6: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

This part of the module will take place Wednesday 27 February, Monday 10 March, andFriday 14 March, from 9:30 - 12 and 2-5 in the DTC.

The teaching will be a mixture of lectures, worked examples, and computer exercises.We shall use theR language in connection withBioconductor. Both of these are open

source.

Lecture notes will be published athttp://www.stats.ox.ac.uk/ reinert/dtc/networks.html.The notes may cover more material than the lectures. The notes may be updated through-

out the course.

The statistical analysis of networks is a very complex topic, far beyond what could becovered in 3-day course. Hence the goal of the class is to give a brief overview of the basics,highlighting some of the issues to be addressed.

0-5

Page 7: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

1 Network summaries

1.1 What are networks?Networks are just graphs. Often one would think of a network as a connected graph, but notalways. In this lecture course we shall usenetworkandgraph interchangeably.

Here are some examples of networks (graphs).

MAPK: Pancreatic pathway

KRAS

PIK3R4 RALGDS

ARHGEF6 AKT3

ARAF

RALA

RAC1 CHUK BAD CASP9

MAP2K1

RALBP1 PLD1

NFKB1 BCL2L1

MAPK1 MAPK8

(suppress apopt.)(cytosk. remod.)

(anti−apopt.)

(DNA; prolif. gn.)

(cell surv.)

This graph shows part of the KEGG pancreatic cancer model, surrounding the MAPK signalingpathway.

0-6

Page 8: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Flo: Florentine Families

0

1

2

34

5

6

7

8

9

10

1112

13

14

15

0-7

Page 9: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Marriage relations between Florentine families, in the order0 ACCIAIUOL,1 ALBIZZI,2 BARBADORI,3 BISCHERI,4 CASTELLAN,5 GINORI,6 GUADAGNI,7 LAMBERTES,8 MEDICI,9 PAZZI,10 PERUZZI,11 PUCCI,12 RIDOLFI,13 SALVIATI,14 STROZZI,15 TORNABUON.The Medici beat their arch-rivals, the Strozzi.

0-8

Page 10: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

0

1 2

34

5

6

7

8

9

10

11

12

13

14

15

Marriage relations between Florentine families: different drawing program.

0-9

Page 11: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Yeast: A plot of a connected subset of Yeast protein interactions.

0 123 45 6

7

8

910 111213 1415 16171819 2021 2223 2425 2627

28

293031323334353637383940 414243 4445 464748

49

505152535455 5657 5859606162636465

66

676869707172737475 7677 7879 8081828384858687 8889909192 93949596979899100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

47147

2

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512 51

3

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

59859

9

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

660

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

844

845

846

847

848

849

850

851

852

853

854

855

856

857

858

859

860

861

862

863

864

865

866

867

868

869

870

871

872

873

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

899

900

901

902

903

904

905

906

907

908

909

910

911

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

939

940

941

942

943

944

945

946

947

948

949

950

951

952

953

954

955

956

957

958

959

960

961

962

963

964

965

966

967

968

969

970

971

972

973

974

975

976

977

978

979

980

981

982

983

984

985

986

987

988

989

990

991

992

993

994

995

996

997

998

999

1000

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

101310

14

1015

1016

1017

1018

1019

1020

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1034

1035

1036

1037

1038

1039

1040

1041

1042

1043

1044

1045

1046

1047

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061 10

62

1063

1064

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089

1090

1091

1092

1093

1094

1095

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121

1122

1123

1124

1125

1126

1127

1128

1129

1130

1131

1132

1133

1134

1135

1136

1137

1138

1139

1140

1141

1142

1143

1144

1145

1146

1147

1148

1149

1150

1151

1152

1153

1154

1155

1156

1157

1158

1159

1160

1161

1162

1163

1164

1165

1166

1167

1168

1169

1170

1171

1172

1173

1174

1175

1176

1177

1178

1179

1180

1181

1182

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195

1196

1197

1198

1199

1200

1201

1202

1203

1204

1205

1206

1207

1208

1209

1210

1211

1212

1213

1214

1215

1216

1217

1218

1219

1220

1221

1222

1223

1224

1225

1226

1227

1228

1229

1230

1231

1232

1233

1234

1235

1236

1237

1238

1239

1240

1241

1242

1243

1244

1245

1246

1247

1248

1249

1250

1251

1252

1253

1254

1255

1256

1257

1258

1259

1260

1261

1262

1263

1264

1265

1266

1267

1268

1269

1270

1271

1272

1273

1274

1275

1276

1277

1278

1279

1280

1281

1282

1283

1284

1285

1286

1287

1288

1289

1290

1291

1292

1293

1294

1295

1296

1297

1298

1299

1300

1301

1302

1303

1304

1305

1306

1307

1308

1309

1310

1311

1312

1313

1314

1315

1316

1317

1318

1319

1320

1321

1322

1323

1324

1325

1326

1327

1328

1329

1330

1331

1332

1333

1334

1335

1336

1337

1338

1339

1340

1341

1342

1343

1344

1345

134613

47

1348

1349

1350

1351

1352

1353

1354

1355

1356

1357

1358

1359

136013

6113

62

1363

1364

1365

1366

1367

1368

1369

1370

1371

1372

1373

1374

1375

1376

1377

1378

1379

1380

1381

1382

1383

1384

1385

1386

1387

1388

1389

1390

1391

1392

1393

1394

1395

1396

1397

1398

1399

1400

1401

1402

1403

1404

1405

1406

1407

1408

1409

1410

1411

1412

1413

1414

1415

1416

1417

1418

1419

1420

1421

1422

1423

1424

1425

1426

1427

1428

1429

1430

1431

1432

1433

1434

1435

1436

1437

1438

1439

1440

1441

1442

1443

1444

1445

1446

1447

1448

1449

1450

1451

1452

1453

1454

1455

1456

1457

1458

1459

1460

1461

1462

1463

1464

1465

1466

1467

1468

14691470

1471

1472

1473

1474

1475

1476

1477

1478

1479

1480

1481

1482

1483

1484

1485

1486

1487

1488

1489

1490

1491

1492

1493

1494

1495

1496

1497

1498

1499

1500

1501

1502

1503

1504

1505

1506

1507

1508

1509

1510

1511

1512

1513

1514

1515

1516

1517

1518

1519

1520

1521

1522

1523

1524

1525

1526

1527

1528

1529

1530

1531

1532

1533

1534

1535

1536

1537

1538

1539

1540

1541

1542

1543

1544

1545

1546

1547

1548

1549

1550

1551

1552

1553

1554

1555

1556

1557

1558

1559

1560

1561

1562

1563

1564

1565

1566

1567

1568

1569

1570

1571

1572

1573

1574

1575

1576

1577

1578

1579

1580

1581

1582

1583

1584

1585

1586

1587

1588

1589

1590

1591

1592

1593

1594

1595

1596

1597

1598

1599

1600

1601

1602

1603

1604

1605

1606

1607

1608

1609

1610

1611

1612

1613

1614

1615

1616

1617

1618

1619

1620

1621

1622

1623

1624

1625

1626

1627

1628

1629

1630

1631

1632

1633

1634

1635

1636

1637

1638

1639

1640

1641

1642

1643

1644

1645

1646

1647

1648

1649

1650

1651

1652

1653

1654

1655

1656

1657

1658

1659

1660

1661

1662

1663

1664

1665

1666

1667

1668

1669

1670

1671

1672

1673

1674

1675

1676

1677

1678

1679

1680

1681

1682

1683

1684

1685

1686

1687

1688

1689

1690

1691

1692

1693

1694

1695

1696

1697

1698

1699

1700

1701

1702

1703

1704

1705

1706

1707

1708

1709

1710

1711

1712

1713

1714

1715

1716

1717

1718

1719

1720

1721

1722

1723

1724

1725

1726

1727

1728

1729

1730

1731

1732

1733

1734

1735

1736

1737

1738

1739

1740

1741

1742

1743

1744

1745

1746

1747

1748

1749

1750

1751

1752

1753

1754

1755

1756

1757

1758

1759

1760

1761

1762

1763

1764

1765

1766

1767

1768

1769

1770

1771

1772

1773

1774

1775

1776

1777

1778

1779

1780

1781

1782

1783

1784

1785

1786

1787

1788

1789

1790

1791

1792

1793

1794

1795

1796

1797

1798

1799

1800

1801

1802

1803

1804

1805

1806

1807

1808

1809

1810

1811

1812

1813

1814

1815

1816

1817

1818

1819

1820

1821

1822

1823

1824

1825

1826

1827

1828

1829

1830

1831

1832

1833

1834

1835

1836

1837

1838

1839

1840

1841

1842

1843

1844

1845

1846

1847

1848

1849

1850

1851

1852

1853

1854

1855

1856

1857

1858

1859

1860

1861

1862

1863

1864

1865

1866

1867

1868

1869

1870

1871

1872

1873

1874

1875

1876

1877

1878

1879

1880

1881

1882

1883

1884

1885

1886

1887

1888

1889

1890

1891

1892

1893

1894

1895

1896

1897

1898

1899

1900

1901

1902

1903

1904

1905

1906

1907

1908

1909

1910

1911

1912

1913

1914

1915

1916

1917

1918

1919

1920

1921

1922

1923

1924

1925

1926

1927

1928

1929

1930

1931

1932

1933

1934

1935

1936

1937

1938

1939

1940

1941

1942

1943

1944

1945

1946

1947

1948

1949

1950

1951

1952

1953

1954

1955

1956

1957

1958

1959

1960

1961

1962

1963

1964

1965

1966

1967

1968

1969

1970

1971

1972

1973

1974

1975

1976

1977

1978

1979

1980

1981

1982

1983

1984

1985

1986

1987

1988

1989

1990

1991

1992

1993

1994

1995

1996

1997

1998

1999

2000

2001

2002

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

2027

2028

2029

2030

2031

2032

2033

2034

2035

2036

2037

2038

2039

2040

2041

2042

2043

2044

2045

2046

2047

2048

2049

2050

2051

2052

2053

2054

2055

2056

2057

2058

2059

2060

2061

2062

2063

2064

2065

2066

2067

2068

2069

2070

2071

2072

2073

2074

2075

2076

2077

2078

2079

2080

2081

2082

2083

2084

2085

2086

2087

2088

2089

2090

2091

2092

2093

2094

2095

2096

2097

2098

2099

2100

2101

2102

2103

2104

2105

2106

2107

2108

2109

2110

2111

2112

2113

2114

2115

2116

2117

2118

2119

2120

2121

2122

2123

2124

2125

2126

2127

2128

2129

2130

2131

2132

2133

2134

2135

2136

2137

2138

2139

2140

2141

2142

2143

2144

2145

2146

2147

2148

2149

2150

2151

2152

2153

2154

2155

2156

2157

2158

2159

2160

2161

2162

2163

2164

2165

2166

2167

2168

2169

2170

2171

2172

2173

2174

2175

2176

2177

2178

2179

2180

2181

2182

2183

2184

2185

2186

2187

2188

2189

2190

2191

2192

2193

2194

2195

2196

2197

2198

2199

2200

2201

2202

2203

2204

2205

2206

2207

2208

2209

2210

2211

2212

2213

2214

2215

2216

2217

2218

2219

2220

2221

2222

2223

2224

2225

2226

2227

2228

2229

2230

2231

2232

2233

2234

2235

2236

2237

2238

2239

2240

2241

2242

2243

2244

2245

2246

2247

2248

2249

2250

2251

2252

2253

2254

2255

2256

2257

2258

2259

2260

2261

2262

2263

2264

2265

2266

2267

2268

2269

2270

2271

2272

2273

2274

2275

2276

2277

2278

2279

2280

2281

2282

2283

2284

2285

2286

2287

2288

2289

2290

2291

2292

2293

2294

2295

2296

2297

2298

2299

2300

2301

2302

2303

2304

2305

2306

2307

2308

2309

2310

2311

2312

2313

2314

2315

2316

2317

2318

2319

2320

2321

2322

2323

2324

2325

2326

2327

2328

2329

2330

2331

2332

2333

2334

2335

2336

2337

2338

2339

2340

2341

2342

2343

2344

2345

2346

2347

2348

2349

2350

2351

2352

2353

2354

2355

2356

2357

2358

2359

2360

0-10

Page 12: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Networks arise in a multitude of contexts, such as

- metabolic networks- protein-protein interaction networks- spread of epidemics- neural network ofC. elegans- social networks- collaboration networks (Erdos numbers ... )- Membership of management boards- World Wide Web- power grid of the Western US

The study of networks has a long tradition in social science, where it is calledSocial Net-work Analysis. The networks under consideration are typically fairly small. In contrast, start-ing at around 1997, statistical physicists have turned their attention to large-scale properties ofnetworks. Our lectures will try to get a glimpse on both approaches.

0-11

Page 13: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Typical networks in systems biology are

• Metabolic networks

• Gene interaction networks

• Protein interaction networks.

0-12

Page 14: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Research questions include

• How do these networks work? Where could we best manipulate a network in order toprevent, say, tumor growth?

• How did these biological networks evolve? Could mutation affect whole parts of thenetwork at once?

• How similar are these networks? If we study some organisms very well, how muchdoes that tell us about other organisms?

• How are these networks interlinked? Can we infer information from gene interactionnetworks that would be helpful for protein interaction networks?

• What are the building principles of these networks? How is resilience achieved, andhow is flexibility achieved? Could we learn from biological networks to build man-made efficient networks?

0-13

Page 15: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

From a statistical viewpoint, questions include

• How to best describe networks?

• How to infer characteristics of nodes in the network?

• How to infer missing links, and how to check whether existing links are not false posi-tives

• How to compare networks from related organisms?

• How to predict functions from networks?

• How to find relevant sub-structures of a network?

Statistical inference relies on the assumption that there is some randomness in the data. Beforewe turn our attention to modelling such randomness, let’s look at how to describe networks, orgraphs, in general.

0-14

Page 16: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

1.2 What are graphs?A graphconsists ofnodes(sometimes also calledvertices) andedges(sometimes also calledlinks). We typically think of the nodes as actors, or proteins, or genes, or metabolites, and wethink of an edge as an interaction between the two nodes at either end of the edge. Sometimesnodes may possess characteristics which are of interest (such as structure of a protein, orfunction of a protein). Edges may possess different weights, depending on the strength of theinteraction. For now we just assume that all edges have the same weight, which we set as 1.

0-15

Page 17: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Mathematically, we abbreviate a graphG asG = (V, E), whereV is the set of nodes andE is the set of edges. We use the notation|S| to denote the number of elements in the setS.Then|V | is the number of nodes, and|E| is the number of edges in the graphG. If u andvare two nodes and there is an edge fromu to v, then we write that(u, v) ∈ E, and we say thatv is aneighbourof u.

If both endpoints of an edge are the same, then the edge is aloop. For now we excludeself-loops, as well as multiple edges between two nodes.

Edges may bedirectedor undirected. A directed graph, or digraph, is a graph where alledges are directed. Theunderlyinggraph of a digraph is the graph that results from turning alldirected edges into undirected edges. Here we shall mainly deal with undirected graphs.

0-16

Page 18: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Two nodes are calledadjacentif they are joined by an edge. A graph can be described byits adjacency matrixA = (au,v). This is a square|V | × |V | matrix. Each entry is either 0 or1;

au,v = 1 if and only if (u, v) ∈ E.

As we assume that there are no self-loops, all elements on the diagonal of the adjacency matrixare 0. If the edges of the graph are undirected, then the adjacency matrix will be symmetric.

The adjacency matrix entries tell us for every nodev which nodes are within distance 1 ofv. If we take the matrix produceA2 = A×A, the entry for(u, v) with u 6= v would be

a(2)(u, v) =∑w∈V

au,waw,v.

If a(2)(u, v) 6= 0 thenu can be reached fromv within two steps;u is within distance 2 ofv.Higher powers can be interpreted similarly.

0-17

Page 19: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Example: Adjacency matrix for marital relation between Florentine families (seeWasserman+Faust, p.744).

0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 00 0 0 0 0 1 1 0 1 0 0 0 0 0 0 00 0 0 0 1 0 0 0 1 0 0 0 0 0 0 00 0 0 0 0 0 1 0 0 0 1 0 0 0 1 00 0 1 0 0 0 0 0 0 0 1 0 0 0 1 00 1 0 0 0 0 0 0 0 0 0 0 0 0 0 00 1 0 1 0 0 0 1 0 0 0 0 0 0 0 10 0 0 0 0 0 1 0 0 0 0 0 0 0 0 01 1 1 0 0 0 0 0 0 0 0 0 1 1 0 10 0 0 0 0 0 0 0 0 0 0 0 0 1 0 00 0 0 1 1 0 0 0 0 0 0 0 0 0 1 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 1 0 0 0 0 0 1 10 0 0 0 0 0 0 0 1 1 0 0 0 0 0 00 0 0 1 1 0 0 0 0 0 1 0 1 0 0 00 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0

0-18

Page 20: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

A completegraph is a graph such that every pair of nodes is joined by an edge. Theadjacency matrix has entry 0 on the diagonal, and 1 everywhere else.

A bipartitegraph is a graph where the node setV is decomposed into two disjoint subsets,U andW , say, such that there are no edges between any two nodes inU , and also there are noedges between any two nodes inW ; all edges have one endpoint inU and the other endpointin W . An example is a network of co-authorship and articles;U could be the set of authors,W the set of articles, and an author is connected to an article by an edge if the author is aco-author of that article. The adjacency matrixA can then be arranged such that it is of theform [

0 A1

A2 0

].

0-19

Page 21: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

1.3 Network summariesThedegreedeg(v) of a nodev is the number of edges which involvev as an endpoint. Thedegree is easily calculated from the adjacency matrixA;

deg(v) =∑

u

au,v.

Theaverage degreeof a graph is then the average of its node degrees.

(For directed graphs we would define thein-degreeas the number of edges directed at thenode, and theout-degreeas the number of edges that go out from that node.)

0-20

Page 22: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The clustering coefficientof a nodev is, intuitively, the proportion of its ”friends” whoare friends themselves. Mathematically, it is the proportion of neighbours ofv which areneighbours themselves. In adjacency matrix notation,

C(v) =

∑u,w∈V au,vaw,vau,w∑

u,w∈V au,vaw,v.

The(average) clustering coefficientis defined as

C =1

|V |∑v∈V

C(v).

0-21

Page 23: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Note that ∑u,w∈V

au,vaw,vau,w

is the number of triangles involvingv in the graph. Similarly,∑u,w∈V

au,vaw,v

is the number of2-starscentred aroundv in the graph. The clustering coefficient is thus theratio between the number of triangles and the number of 2-stars. The clustering coefficientdescribes how ”locally dense” a graph is. Sometimes the clustering coefficient is also calledthetransitivity.

The clustering coefficient in the Florentine family example is 0.1914894; the average clus-tering coefficient in the Yeast data is 0.1023149.

0-22

Page 24: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Exercise 1:

• Draw an undirected complete graph on 6 nodes, and write down its adjacency matrix.Determine the degrees of the 6 nodes. What is the clustering coeffient?

• Draw two different undirected graphs on 6 nodes where each node has degree 2, andwrite down their adjacency matrices. What are their clustering coefficients?Hint: agraph does not have to be connected.

0-23

Page 25: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

In a graph apath from nodev0 to nodevn is an alternating sequence of nodes andedges,(v0, e1, v1, e2, . . . , vn−1, en, vn) such that the endpoints ofei are vi−1 and vi, fori = 1, . . . , n. A graph is calledconnectedif there is a walk between any pair of nodes in thegraph, otherwise it is calleddisconnected. Thedistance (u, v) between two nodesu andv isthe length of the shortest path joining them. This path does not have to be unique.

We can calculate the distance`(u, v) from the adjacency matrixA as the smallest powerp of A such that the(u, v)-element ofAp is not zero.

In a connected graph, theaverage shortest path lengthis defined as

` =1

|V |(|V | − 1)

∑u 6=v∈V

`(u, v).

The average shortest path length describes how ”globally connected” a graph is.

0-24

Page 26: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Example: H. Pylori and Yeast protein interaction network comparison:

n ` CH.Pylori 686 4.137637 0.016

Yeast 2361 4.376182 0.1023149

0-25

Page 27: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Node degree, clustering coefficient, and shortest path length are the most common sum-maries of networks. Other popular summaries, to name but a few, are: thebetween-ness of anedgecounts the proportion of shortest paths between any two nodes which pass through thisedge. Similarly, thebetween-ness of a nodeis the proportion of shortest paths between anytwo nodes which pass through this node. Theconnectivityof a connected graph is the smallestnumber of edges whose removal results in a disconnected graph.

In addition to considering these general summary statistics, it has proven fruitful to de-scribe networks in terms ofmotifs; these are building- block patterns of networks such as afeed-forward loop, see the book byAlon. Here we think of a motif as a subgraph with a fixednumber of nodes and with a given topology. In biological networks, it turns out that motifsseem to be conserved across species. They seem to reflect functional units which combine toregulate the cellular behaviour as a whole.

0-26

Page 28: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The decomposition ofcommunitiesin networks, small subgraphs which are highly con-nected but not so highly connected to the remaining graph, can reveal some structure of thenetwork. Identifyingroles in networks singles out specific nodes with special properties, suchas hub nodes, which are nodes with high degree.

Looking at the ”spectral decomposition”, i.e. at eigenvectors and eigenvalues, of the adja-cency matrix, provides another set of summaries, such ascentrality.

0-27

Page 29: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The above network summaries provide an initial go at networks. Specific networks mayrequire specific concepts. In protein interaction networks, for example, there is a differencewhether a protein can interact with two other proteins simultaneously (party hub) or sequen-tially (date hub). In addition, the research question may suggest other summaries. For example,in fungal networks, there are hardly any triangles, so the clustering coefficient does not makemuch sense for these networks.

0-28

Page 30: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Excursion:Milgram and thesmall world effect.

In 1967 the American sociologist Milgram reported a series of experiments of the follow-ing type. A number of people from a remote US state (Nebraska, say) are asked to havea letter (or package) delivered to a certain person in Boston, Massachusetts (such as thewife of a divinity student). The catch is that the letter can only be sent to someone whomthe current holder knew on a first-name basis. Milgram kept track of how many interme-diaries were required until the letters arrived; he reported a median of six; see for examplehttp : //www.uaf.edu/northern/bigworld.html. This made him coin the notion ofsixdegrees of separation, often interpreted as everyone being six handshakes away from the Pres-ident. While the experiments were somewhat flawed (in the first experiment only 3 lettersarrived), the concept ofsix degrees of separationhas stuck.

0-29

Page 31: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2 Models of random networksIn order to judge whether a network summary is ”unusual” or whether a motif is ”frequent”,there is an underlying assumption of randomness in the network.

Network data are subject to various errors, which can create randomness, such as

• There may be missing edges in the network. Perhaps a node was absent (social network)or has not been studied yet (protein interaction network).

• Some edges may be reported to be present, but that recording is a mistake. Dependingon the method of determining protein interactions, the number of suchfalse positiveinteractions can be substantial, of around 1/3 of all interactions.

• There may be transcription errors in the data.

• There may be bias in the data, some part of the network may have received higherattention than another part of the network.

Often network data are snapshots in time, while the network might undergo dynamical changes.In order to understand mechanisms which could explain the formation of networks, math-

ematical models have been suggested.

0-30

Page 32: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2.1 Bernoulli (Erdos-Renyi) random graphsThe most standard random graph model is that of Erdos and Renyi (1959). The (finite) nodesetV is given, say|V | = n, and an edge between two nodes is present with probabilityp,independently of all other edges. As there are(

n

2

)=

n(n− 1)

2

potential edges, the expected number of edges is then(n

2

)p.

Each node hasn − 1 potential neighbours, and each of thesen − 1 edges is present withprobabilityp, and so the expected degree of a node is(n − 1)p. As the expected degree of anode is the same for all nodes, the average degree is(n− 1)p.

0-31

Page 33: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Similarly, the average number of triangles in the graph is(n

3

)p3 =

n(n− 1)(n− 2)

6p3,

and the average number of 2-stars is (n

3

)p2.

Thus, with a bit of handwaving, we would expect an average clustering coefficient of about(n3

)p3(

n3

)p2

= p.

0-32

Page 34: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

In a Bernoulli random graphs, your friends are no more likely to be friends themselves thanwould be a two complete strangers. This model is clearly not a good one for social networks.Below is an example from scientific collaboration networks (N. Boccara, Modeling ComplexSystems, Springer 2004, p.283. We can estimatep as the fraction of average node degreeandn − 1; this estimate would also be an estimate of the clustering coefficient in a Bernoullirandom graph.

0-33

Page 35: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Network n ave degree C CBernoulli

Los Alamos archive 52,909 9.7 0.43 0.00018MEDLINE 1,520,251 18.1 0.066 0.000011NCSTRL 11,994 3.59 0.496 0.0003

Also in real-world graphs often the shortest path length is much shorter than expectedfrom a Bernoulli random graph with the same average node degree. The phenomenon of shortpaths, often coupled with high clustering coefficient, is called thesmall world phenomenon.Remember the Milgram experiments!

0-34

Page 36: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2.2 The Watts-Strogatz modelWatts and Strogatz (1998)published a ground-breaking paper with a new model for smallworlds; the version currently most used is as follows. Arrange then nodes ofV on a lattice.Then hard-wire each node to itsk nearest neighbours on each side on the lattice, wherek issmall. Thus there arenk edges in this hard-wired lattice. Now introduce random shortcutsbetween nodes which are not hard-wired; the shortcuts are chosen independently, all with thesame probability.

0-35

Page 37: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

If there are no shortcuts, then the average distance between two randomly chosen nodesis of the ordern, the number of nodes. But as soon as there are just a few shortcuts, thenthe average distance between two randomly chosen nodes has an expectation of orderlog n.Thinking of an epidemic on a graph - just a few shortcuts dramatically increase the speed atwhich the disease is spread.

It is possible to approximate the node degree distribution, the clustering coefficient, andthe shortest path length reasonably well mathematically; we may come back to these approxi-mations later.

0-36

Page 38: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

While the Watts-Strogatz model is able to replicate a wide range of clustering coefficientand shortest path length simultaneously, it falls short of producing the observed types of nodedegree distributions. It is often observed that nodes tend to attach to ”popular” nodes; popu-larity is attractive.

0-37

Page 39: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2.3 ”The” Barabasi-Albert modelIn 1999, Barabasi and Albert noticed that the actor collaboration graph adn the World WideWeb had degree distributions that were of the type

Prob(degree = k) ∼ Ck−γ

for k →∞. Such behaviour is calledpower-law behaviour; the constantγ is called thepower-law exponent. Subsequently a number of networks have been identified which show this type ofbehaviour. They are also calledscale-free random graphs. To explain this behaviour, Barabasiand Albert introduced thepreferential attachmentmodel for network growth. Suppose that theprocess starts at time 1 with 2 nodes linked bym (parallel) edges. At every timet ≥ 2 we adda new node withm edges that link the new node to nodes already present in the network. Weassume that the probabilityπi that the new node will be connected to a nodei depends on thedegreedeg(i) of i so that

πi =deg(i)∑j deg(j)

.

To be precise, when we add a new node we will add edges one at a time, with the second andsubsequent edges doing preferential attachment using the updated degrees.

0-38

Page 40: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

This model has indeed the property that the degree distribution is approximately powerlaw with exponentγ = 3. Other exponents can be achieved by varying the probability forchoosing a given node.

Unfortunately the above construction will not result in any triangles at all. It is possibleto modify the construction, adding more than one edge at a time, so thatany distribution oftriangles can be achieved.

0-39

Page 41: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2.4 Erdos-Renyi Mixture GraphsAn intermediate model with not quite so many degrees of freedom is given by the Erdos-Renyimixture model, also known aslatent block modelsin social science (Nowicky and Snijders(2001)). Here we assume that nodes are of different types, say, there areL different types.Then edges are constructed independently, such that the probability for an edge varies onlydepending on the type of the nodes at the endpoints of the edge.Robin et alhave shown thatthis model is very flexible and is able to fit many real-world networks reasonably well. It doesnot produce a power-law degree distribution however.

0-40

Page 42: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Exercise 2:Consider an Erdos-Renyi mixture model with two types of nodes. Type 1,of which there aren1 nodes, has edge probabilityp1; whereas Type 2, of which there aren2 nodes, has edge probabilityp2; the edge probability for an edge between a Type-1 nodeand a Type-2 node isp1,2. We are interested in the average node degree and the clusteringcoefficient.

• What should average node degree and the clustering coefficient be ifp1,2 = 0? What ifp1,2 6= 0 butp1 = p2 = 0?

• What would the average node degree be in general?

• For the clustering coefficient, which types of triangles would you need to consider?What would you expect for the casep1,2 = 0? What ifp1,2 6= 0 butp1 = p2 = 0?

0-41

Page 43: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2.5 Exponential random graph (p∗) modelsNetworks have been analysed for ”ages” in the social science literature, see for example thebook byWasserman and Faust. Here usually digraphs are studied, and the research questionsare different from biological networks. Typical research questions could be

• Is there a tendency in friendship towards transitivity; are friends of friends my friends?

• What is the role of explanatory variables such as income on the position in the network?

• What is the role of friendship in creating behaviour (such as smoking)?

• Is there a hierarchy in teh network?

• Is the network influenced by other networks for which the membership overlaps?

0-42

Page 44: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Exponential random graph (p∗) modelsmodel the whole adjacency matrix of a graphsimultaneously, making it easy to incorporate dependence. Suppose thatX is our randomadjacency matrix. The general form of the model is

Prob(X = x) =1

κexp{

∑B

λBzB(x)},

where the summation is over all subsetsB of the set of potential edges,

zB(x) =∏

(i,j)∈B

xi,j

is the network statistic corresponding to the subsetB, κ is a normalising quantity so that theprobabilities sum to 1, and the parameterλB = 0 for all x unless all the the variables inB aremutually dependent.

The simplest such model is that the probability of any edge is constant across all possibleedges, i.e. the Bernoulli graph, for twhich

Prob(X = x) =1

κexp{λL(x)},

whereL(x) is the number of edges in the networkx andλ is a parameter.

0-43

Page 45: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

For social networks, Frank and Strauss (1986) introducedMarkov dependence, wherebytwo possible edges are assumed to be conditionally dependent if they share a node. For non-directed networks, the resulting model has parameters relating only to the configurationsstarsof various types, and triangles. If the numberL(x) of edges, the numberS2(x) of two-stars,the numberS3(x) of three-stars, and the numberT (x) of triangles are included, then the modelreads

Prob(X = x) =1

κexp{λ1L(x) + λ2S2(x) + λ3S3(x) + λ4T (x)}.

By setting the parameters to particular values and then simulating the distribution, we canexamine global properties of the network.

0-44

Page 46: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

2.6 Specific models for specific networksDepending on the research question, it may make sense to build a specific network model.For example, a gene duplication model has been suggested which would result in a power-lawlike node degree distribution. For metabolic pathways, a number of Markov models have beenintroduced. When thinking of flows through networks, it may be a good idea to use weightednetworks; the weights could themselves be random.

0-45

Page 47: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Further referencesJ.-J. Daudin, F. Picard, S. Robin (2006). A mixture model for random graphs. Preprint.

O. Frank and D. Strauss (1986). Markov graphs.Journal of the American StatisticalAssociation81, 832-842.

K. Nowicky and T. Snijders (2001). Estimation and Prediction for Stochastic Blockstruc-tures.Journal of the American Statistical Association455, Vol. 96, pp. 1077-1087.

S. Milgram (1967). The small world problem.Psychology Today2, 60–67.

0-46

Page 48: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Recap and additionsNetworks are complex, hence the need to find good summaries. The most common ones arenode degrees, clustering coefficient, andshortest path length.

Addendum: summaries based on spectral properties of the adjacency matrix.

If λi are the eigenvalues of the adjacency matrixA, then the spectral density of the graphis defined as

ρ(λ) =1

n

∑i

δ(λ− λi),

whereδ(x) is the delta function. For Bernoulli random graphs, ifp is constant asn → ∞,thenρ(λ) converges to a semicircle.

The eigenvalues can be used to compute thekth moments,

Mk =1

n

∑i

(λi)k =

1

n

∑i1,i2,...,ik

ai1,i2ai2,i3 · · · aik−1,ik .

0-47

Page 49: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The quantitynMk is the number of paths returning to the same node in the graph, passingthroughk edges, where these paths may contain nodes that were already visited.

Because in a tree-like graph a return path is only possible going back through alreadyvisited nodes, the presence of odd moments is an indicator for the presence of cycles in thegraph.

Thesubgraph centrality

Sci =

∞∑k=0

(Ak)i,i

k!

measures the ”centrality” of a node based on the number of subgraphs in which the node takespart. It can be computed as

Sci =

n∑j=i

vj(i)2eλi ,

wherevj(i) is theith element of thejth eigenvector.

0-48

Page 50: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Addendum: entropy-type summaries

The structure of a network is related to its reliability and speed of information propagation.If a random walk starts on nodei going to nodej, the probability that it goes through a givenshortest pathπ(i, j) between these vertices is

P(π(i, j)) =1

d(i)

∑b∈N (π(i,j))

1

d(b)− 1,

whered(i) is the degree of nodei, andN (π(i, j)) is the set of nodes in the pathπ(i, j)excludingi andj. Thesearch informationis the total information needed to identify one of allthe shortest paths betweeni andj and is given by

S(i, j) = − log2

∑π(i,j)

P(π(i, j)).

Similarly, an entropy can be defined based on the predictability of a message flow.

0-49

Page 51: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Further reading:L. da F. Costa, F.A. Rodrigues, P.R. Villas Boas, G. Travieso (2007). Characterization of

complex networks: a survey of measurements. Advances in Physics 56, Issue 1 January 2007,167 - 242.

0-50

Page 52: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Recap: network models

We looked at Bernoulli random graphs and their mixtures, Watts-Strogatz small worlds,Barabasi-Albert scale-free networks, and exponential random graphs. We saw that in thesemodels the summaries are dependent. As an extreme case, knowing the degree sequence mayalready completely specify the network.

Specific networks may allow for specific modelling, and summaries may be chosen to bestreflect the main features of the network.

0-51

Page 53: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3 Fitting a model: parametric methodsParametricjust means that we have a finite set of parameters which fully specify the model.For example:

Bernoulli (Erdos-Renyi) random graphs

In the random graph model of Erdos and Renyi (1959), the (finite) node setV is given, say|V | = n. We denote the set of all potential edges byE; thus|E| =

(n2

). An edge between two

nodes is present with probabilityp, independently of all other edges. Herep is an unknownparameter.

0-52

Page 54: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.1 Parameter estimationIn classical (frequentist) statistics we often estimate unknown parameters via the method ofmaximum likelihood.

The likelihoodof the parameter given the data is just the probability of seeing the data wesee, given the parameter.

0-53

Page 55: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Example:Bernoulli random graphs.

Our data is the network we see. We describe the data using the adjacency matrix, denoteit by x here because it is the realisation of a random adjacency matrixX. Recall that theadjacency matrix is the square|V | × |V |matrix where each entry is either 0 or 1;

xu,v = 1 if and only if there is an edge betweenu andv.

The likelihood of p being the true value of the edge probability if we seex is

L(p;x) =∏

(i,j)∈E

{pxi,j (1− p)1−xi,j

}.

For example,

L(0.5;x) =∏

(i,j)∈E

{(0.5)xi,j (1− 0.5)1−xi,j

}=

∏(i,j)∈E

0.5 = 0.5|E|.

0-54

Page 56: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

In general we can simplify

L(p;x) = (1− p)|E|∏

(i,j)∈E

(p

1− p

)xi,j

= (1− p)|E|(

p

1− p

)∑(i,j)∈E xi,j

.

Note thatt =∑

(i,j)∈E xi,j is the total number of edges in the random graph.

To maximise the likelihood, we often take logs, and then differentiate. Here this wouldgive

`(p;x) = logL(p;x)

= |E| log(1− p) + t log p− t log(1− p);

and

∂`(p;x)

∂p= − 1

1− p(|E| − t) +

t

p.

0-55

Page 57: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

To find a maximum we equate this to zero and solve forp,

t

p=

1

1− p(|E| − t) ⇐⇒ t(1− p) = p(|E| − t)

⇐⇒ t = p|E| ⇐⇒ p =t

|E| .

We can check that the second derivative of` is less than zero, so the fraction of edges that arepresent in the network,

p =t

|E| ,

is our maximum-likelihood estimator.

Maximum-likelihood estimators have attractive properties; under some regularity condi-tions they would not only converge to the true parameter as the sample size tends to infinity,but it would also be approximately normally distributed if suitably standardized, and we canapproximate the asymptotic variance.

0-56

Page 58: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Maximum-likelihood estimation also works well in Erdos-Renyi Mixture graphs when thenumber of types is known, and it works well in Watts-Strogatz small world networks when thenumberk of nearest neighbours we connect to is known. When the number of types, or thenumber of nearest neighbours, is unknown, then things become messy.

In Barabasi-Albert models, the parameter would be the power exponent for the node de-gree, as occurring in the probability for an incoming node to connect to some nodei alreadyin the network.

In exponential random graphs, unless the network is very small, maximum-likelihood es-timation quickly becomes numerically unfeasible. Even in a simple model like

Prob(X = x) =1

κexp{λ1L(x) + λ2S2(x) + λ3S3(x) + λ4T (x)}

the calculation of the normalising constantκ becomes numerically impossible very quickly.

0-57

Page 59: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.2 Markov Chain Monte Carlo estimationA Markov chain is a stochastic process where the state at timen only depends on the stateat timen − 1, plus some independent randomness; a random walk is an example. A Markovchain isirreducible if any set of states can be reached from any other state in a finite numberof moves. The Markov chain isreversibleif you cannot tell whether it is running forwards intime or backwards in time. A distribution isstationaryfor the Markov chain if, when you startin the stationary distribution, one step after you cannot tell whether you made any step or not;the distribution of the chain looks just the same.

There are mathematical definitions for these concepts, but we only need the main resulthere:

If a Markov chain is irreducible and reversible, then it will have a unique stationary dis-tribution, and no matter in which state you start the chain, it will eventually converge to thisstationary distribution.

0-58

Page 60: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

We make use of this fact by looking at our target distribution, such as the distribution forX in an exponential random graph model, as the stationary distribution of a Markov chain.

This Markov chain lives on graphs, and moves are adding or deleting edges, as well asadding types or reducing types. Finding suitable Markov chains is an active area of research.

The ergm package has MCMC implemented for parameter estimation. We need to beaware that there is no guarantee that the Markov chain has reached its stationary distribution.Also, if the stationary distribution is not unique, then the results can be misleading. Unfortu-nately in exponential random graph models it is known that in some small parameter regionsthe stationary distribution is not unique. Another very active area of research.

0-59

Page 61: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.3 Assessing the model fitSuppose that we have estimated our parameters in our model of interest. We can now use thismodel to see whether it does actually fit the data.

To that purpose we study the (asymptotic) distributions of our summary statisticsnodedegree, clustering coefficient, andshortest path length. Then we see whether our observedvalues are plausible under the estimated model.

Often, secretly we would like to find that they are not plausible! Because then we canreject, say, the simple random graph model, and conclude that something more complicated isgoing on.

0-60

Page 62: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.4 A quick review of distributionsJust a quick reminder of some classical distributions which often appear as limiting distribu-tions.

The normal distributionN (µ, σ2)

This distribution has meanµ and varianceσ2. Its shape is given by the Bell curve. Itsdensity is awkward to write down, but probabilities can be calculated numerically.

0-61

Page 63: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

-4 -2 0 2 4

0.0

0.1

0.2

0.3

0.4

Normal Probability Densities

x

dens

ity

N(0,1)N(0,2)N(1,1)

0-62

Page 64: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

For a normally distributed random variable, around 2/3 of the time it will be withinσ (thestandard deviation, square root of the variance) of the mean.

Around 95% of the time it will be within2σ of the mean.

Around 99% of the time it will be within3σ of the mean.

Thus if an observed value is further than3σ away fromµ, we would find that ratherunusual; we would reject the null hypothesis that the data is normallyN (µ, σ2) distributed atthe level 1%.

0-63

Page 65: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The Central Limit Theoremtells us that, in a sequence of independent identically dis-tributed observations with finite variance, the sample mean will converge to a normal distribu-tion, and the standardised sample mean will be approximately standard normal.

Fact: If the observations are dependent, but only ”weakly” dependent, then the CentralLimit Theorem still holds. (Another area of research.)

0-64

Page 66: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Binomial Probability distibution with n=10 and p=0.6

x

P(X

=x)

0.00

0.10

0.20

Binomial Probability distibution with n=50 and p=0.6

x

P(X

=x)

0.00

0.04

0.08

0-65

Page 67: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The Poisson distribution

When considering the occurrence of ”rare” events, an approximation with a Poisson dis-tribution is often more appropriate than a normal approximation.

The Poisson distributionlives on the non-negative integers; it has a parameterλ andXhas Poisson distribution with parameterλ if

P (X = k) = e−λ λk

k!, k = 0, 1, 2, . . .

It is relatively easy to calculate that mean and variance both equal toλ.

0-66

Page 68: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Poisson Probability distibution with lambda=5

x

P(X

=x)

0.00

0.05

0.10

0.15

Poisson Probability distibution with lambda=10

x

P(X

=x)

0.00

0.04

0.08

0.12

0-67

Page 69: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

A famous result result states that if the expected numbernp of successes inn independentBernoulli trials with probability of successp each is such thatnp → λ asn → ∞ , then thenumber of successes in these trials is approximately Poisson distributed with parameterλ.

Note:np → λ asn →∞means that in each trial the probability of success is very small.A Poisson approximation is used forrare events.

The Poisson approximation is also good if the trials are only ”weakly” dependent.

0-68

Page 70: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Binomial Probability distibution with n=50 and p=0.1

x

P(X

=x)

0.00

0.05

0.10

0.15

Poisson Probability distibution with lambda=5

x

P(X

=x)

0.00

0.05

0.10

0.15

0-69

Page 71: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.5 The distribution of summary statistics in Bernoulli randomgraphs

In a Bernoulli random graph onn nodes, with edge probabilityp, the network summaries arepretty well understood.

3.5.1 The degree of a random node

Pick a nodev, and denote its degree byD(v), say.

The degree is calculated as the number of neighbours of this node. Each of the other(n− 1) nodes is connected to our nodev with probabilityp, independently of all other nodes.Thus the distribution ofD(v) is Binomial with parametersn andp, for each nodev.

0-70

Page 72: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Typically we look at relatively sparse graphs, and so a Poisson approximation applies. IfX denotes the random adjacency matrix, then, in distribution,

D(v) =∑

u:u 6=v

Xu,v ≈ Poisson((n− 1)p).

Note that the node degrees in a graph are not independent. We have seen last time thatthere isno graph on 6 nodes which has 5 nodes of degree 5 and 1 node of degree 1. SoD(v)doesnot stand for the average node degree.

Computer exercise:Simulate many Bernoulli random graphs and look at their averagenode degree distribution. Also: pick node at random in each of the simulated graph, find itsdegree, and look at the distribution of these degrees.

0-71

Page 73: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

How about the average degree of a node? Denote it byD. Note that the average does notonly take integer values, so would certainly not be Poisson distributed. But

D =1

n

n∑v=1

D(v) =2

n

n∑v=1

∑u<v

Xu,v,

noting that each edge gets counted twice. As theXu,v are independent, we can use a Poissonapproximation again, giving that

n∑v=1

∑u<v

Xu,v ≈ Poisson

(n(n− 1)

2p

)and so, in distribution,

D ≈ 2

nZ,

whereZ ∼ Poisson(

n(n−1)2

p)

.

0-72

Page 74: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.5.2 The clustering coefficient of a random node

Here it gets a little tricky already. Recall that theclustering coefficientof a nodev is,

C(v) =

∑u,w∈V Xu,vXw,vXu,w∑

u,w∈V Xu,vXw,v.

The ratio of two random sums is not easy to evaluate. If we just look at∑u,w∈V

Xu,vXw,vXu,w

then we see that we have a sum of dependent random variables.

Exercise:Calculate the covariance ofXu,vXw,vXu,w andXu,vXt,vXu,t, wherew 6= t.Recall: for random variablesX andY , the covariance is defined as

Cov(X, Y ) = E(XY )− E(X)E(Y ).

0-73

Page 75: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Most 3-tuples(u, w, v) and(r, s, t), though, will not share an index, and henceXu,vXw,vXu,w

andXr,sXs,tXr,t will be independent. The dependence among the random variables overallis hence weak, so that a Poisson approximation applies. As

E∑

u,w,v∈V

Xu,vXw,vXu,w =

(n

3

)p3,

we obtain that, in distribution,

∑u,w.v∈V

Xu,vXw,vXu,w ≈ Poisson

((n

3

)p3

).

Similarly,

E∑

u,w∈V

Xu,vXw,v =

(n

2

)p2.

0-74

Page 76: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

K. Lin (2007) showed that, for the average clustering coefficient

C =1

n

∑v

C(v)

it is also true that, in distribution,

C ≈ 1

n(

n2

)p2

Z,

whereZ ∼ Poisson((

n3

)p3).

0-75

Page 77: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Example.In the Florentine family data, we observe a total number of 20 edges, an averagenode degree of 2.5, and an average clustering coefficient of 0.1914894, with 16 nodes in total.Assess the null hypothesis that the data come from a Bernoulli random graph.

Let us assume that the null hypothesis is true, the data come from a Bernoulli randomgraph. Then we estimate

p =20(162

) =20× 2

16× 15=

1

6.

As in a Bernoulli random graphD ≈ 2nZ, whereZ ∼ Poisson

(n(n−1)

2p)

, under the null

hypothesis the average node degree would be

D ≈ 1

8Z,

whereZ ∼ Poisson(20). The probability under the null hypothesis thatD ≥ 2.5 would thenbe

P (Z ≥ 2.5× 8) = P (Z ≥ 20) ≈ 0.55,

so no reason to reject the null hypothesis.

0-76

Page 78: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Exercise: Test the null hypothesis that the Florentine family data come from a Bernoullirandom graph using a test based on the average clustering coefficient.

0-77

Page 79: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.5.3 Shortest paths: Connectivity in Bernoulli random graph

Erdos and Renyi (1960)showed the following ”phase transition” for the connectedness of aBernoulli random graph.

If p = p(n) = log nn

+ cn

+ 0(

1n

)then the probability that a Bernoulli graph, denoted by

G(n, p) onn nodes with edge probabilityp is connected converges toe−e−c

.

Recall theO ando notation:f(n) = O(g(n)) asn →∞ if the fraction f(n)g(n)

is bounded

away from∞. If f(n) = o(g(n)) asn →∞ then the fractionf(n)g(n)

tends to zero asn →∞.

0-78

Page 80: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Thediameterof a graph is the maximum diameter of its connected components; the diam-eter of a connected component is the longest shortest path length in that component.

Chung and Lu (2001)showed that, ifnp ≥ 1 then, asympotically, the ratio between thediameter and log n

log(np)is at least 1, and remains bounded above asn →∞.

If np → ∞ then the diameter of the graph is(1 + o(1)) log nlog(np)

. If nplog n

→ ∞, then thediameter is concentrated on at most two values.

In the Physics literature, the valuelog nlog(np)

is used for the average shortest path length in aBernoulli random graph. This has hence to be taken with a lot of grains of salt.

While we have some idea about how the diameter (and, relatedly, the shortest path length)behaves, it is an inconvenient statistics for Bernoulli random graphs, because the graph neednot be connected.

0-79

Page 81: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.6 The distribution of summary statistics in Watts-Strogatz smallworlds

Recall that in this model we arrange then nodes ofV on a lattice. Then hard-wire each nodeto its k nearest neighbours on each side on the lattice, wherek is small. Thus there arenkedges in this hard-wired lattice. Now introduce random shortcuts between nodes which are nothard-wired; the shortcuts are chosen independently, all with the same probabilityφ.

Thus the shortcuts behave like a Bernoulli random graph, but the graph will necessarily beconnected. The degreeD(v) of a nodev in the Watts-Strogatz small world is hence distributedas

D(v) = 2k + Binomial(n− 2k − 1, φ),

taking the fixed lattice into account. Again we can derive a Poisson approximation whenp issmall; see K.Lin (2007) for the details.

For the clustering coefficient there is a problem - triangles in the graph may now appear inclusters. Each shortcut between nodesu andv which are a distance ofk + a ≤ 2k apart onthe circle createsk − a− 1 triangles automatically.

0-80

Page 82: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Thus a Poisson approximation will not be suitable; instead we use acompound Poissondistribution. A compound Poisson distribution arises as the distribution of a Poisson numberof clusters, where the cluster sizes are independent and have some distribution themselves. Ingeneral there is no closed form for a compound Poisson distribution.

0-81

Page 83: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The compound Poisson distribution also has to be used when approximating the numberof 4-cycles in the graph, or the number of other small subgraphs which have the clumpingproperty.

It is also worth noting that when counting the joint distribution of the number of trianglesand the number of 4-cycles, these counts are not independent, not even in the limit; a bivariatecompound Poisson approximation with dependent components is required. See Lin (2007) fordetails.

0-82

Page 84: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.6.1 The shortest path length

LetD denote shortest distance between two randomly chosen points, and abbreviateρ = 2kφ.Then (Barbour + Reinert) show that uniformly in|x| ≤ 1

4log(nρ),

P

(D >

1

ρ

(1

2log(nρ) + x

))=

∫ ∞

0

e−y

1 + e2xydy + O

((nρ)−

15 log2(nρ)

)if the probability of shortcuts is small. If the probability of shortcuts is relatively large, thenDwill be concentrated on one or two points.

Note thatD is the shortest distance between two randomly chosen points,not the averageshortest path. Again the difference can be considerable (Computer exercise).

0-83

Page 85: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Dependent sampling

Our data are usually just one graph, and we calculate all shortest paths. But there is muchoverlap between shortest paths possible, creating dependence

0-84

Page 86: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Simulation:n = 500, k = 1, φ = 0.01

0-85

Page 87: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Simulation: dependent vs independent

We simulate 100 replicas, and calculate the average shortest path length in each network.We compare this distribution to the theoretical approximate distribution; we carry out 100chi-square tests:

n k φ E.no mean p-value max p-value300 1 0.01 3 1.74 E-09 8.97 E-08

0.167 50 0.1978 0.89132 0.01 6 0 0

1000 1 0.003 3 1.65E-13 3.30 E-120.05 50 0.0101 0.1124

2 0.03 60 0.0146 0.2840

Thus the two statistics are close if the expected numberE.no of shortcuts is large (or verysmall); otherwise they are significantly different.

0-86

Page 88: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Recall: chi-square test of goodness-of-fit

We want to test whether a data set comes from a conjectured (null) distribution. We groupour data into cells such that under the null distribution, the count in each cell is expected to beat least 5.

Then we take the sum

X2 =∑cellsi

(Observedi − Expectedi)2

Expectedi.

If the data come indeed from the null distribution, thenX2 will be approximately chi-squareddistributed, with degrees of freedom ”number(cells) - number(fitted parameters) - 1”.

Thep-value is the probability of seeingX2 as least as large as the observed value if thenull distribution is the correct distribution.

0-87

Page 89: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Aside: When comparing continuous distributions, theKolmogorov-Smirnov testis anothernonparametric alternative, as areWilcoxon tests.

0-88

Page 90: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.7 The distribution of summary statistics in Barabasi-Albert mod-els

The node degree distribution is given by the model directly, as that is how it is designed.

The clustering coefficient depends highly on the chosen model. In the original Barabasi-Albert model, when only one new edge is created at any single time, there will be no triangles(beyond those from the initial graph). The model can be extended to match any clusteringcoefficient, but even if only two edges are attached at the same time, the distribution of thenumber of the clustering coefficient is unknown to date.

0-89

Page 91: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The expected value, however, can be approximated. Fronczaket al. (2003) studied themodels where the network starts to grwo from an initial cluster ofm fully connected nodes.Each new node that is added to the network createdm edges which connect it to previouslyadded nodes. The probability of a new edge to be connected to a nodev is proportional to thedegreed(v) of this node. If both the number of nodes,n, andm are large, then the expectedaverage clustering coefficient is

EC =m− 1

8

(log n)2

n.

The average pathlenghincreases approximately logarithmically with network size. Ifγ = 0.5772 denotes the Euler constant, then Fronczaket al. (2004) show for the mean averageshortest path length that

E` ∼ log n− log(m/2)− 1− γ

log log n + log(m/2)+

3

2.

The asymptotic distribution is not understood.

0-90

Page 92: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

3.8 The distribution of summary statistics in exponential randomgraph models

The distribution of the node degree, clustering coefficient, and the shortest path length is poorlystudied in these models. One reason is that these models are designed to predict missing edges,and to infer characteristics of nodes, but their topology itself has not often been of interest.

The summary statistics appearing in the model try to push the random networks towardscertain behaviour with respect to these statistics, depending on the sign and the size of theirfactorsθ.

0-91

Page 93: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

When only the average node degree and the clustering coefficient are included in themodel, then a strange phenomenon happens. For many combinations of parameter valuesthe model produces networks that are either full (every edge exists) or empty (no edge exists)with probability close to 1. Even for parameters which do not produce this phenomenon, thedistribution of networks produced by the model is often bimodal: one mode is sparsely con-nected and has a high number of triangles, while the other mode is densely connected but witha low number of triangles. Again: active research.

0-92

Page 94: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

4 Statistical tests for model fit: nonparametric meth-ods

What if we do not have a suitable test statistic for which we know the distribution? We needsome handle on the distribution, so here we assume that we can simulate random samples fromour null distribution. There are a number of methods available.

4.1 Quantile-quantile plotsIt is often a good idea to use plots to visually assess the fit. A much used plot in Statistics aquantile-quantile plot.

The quantilesof a distribution are its ”percent points”; for example the 0.5 quantile isthe 50 % point, i.e. the median. Mathematically, the(sample) quantilesqα, are defined for0 ≤ α ≤ 1 so that a proportion of at leastα of the data are less or equal toqα and a proportionof at least1−α is greater or equal toqα. There are many (at least 8) definitions ofqα if αn isnot an integer.

0-93

Page 95: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

We plot the quantiles of our observed (empirical) distribution against the quantiles of ourhypothesised (null) distribution; if the two distributions agree, then the plot should result in aroughly diagonal line.

0-94

Page 96: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Example: Simulate 1,000 random variables from a normal distribution. Firstly: mean zero,variance 1; secondly: mean 1, variance 3. Both QQ-plots are satisfactory.

0-95

Page 97: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

We can also use a quantile-quantile plot for two sets of simulated data, or for one set ofsimulated data and one set of observed data. The interpretation is always the same: if the datacome from the same distribution, then we should see a diagonal line; otherwise not. Here wecompare 1000 Normal (0,1) variables with 1000 Poisson (1) variables - clearly not a good fit.

0-96

Page 98: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

4.2 Monte-Carlo testsThe Monte Carlo test, attributed to Dwass (1957) and Barnard (1963), is an exact procedure ofvirtually universal application and correspondingly widely used.

Suppose that we would like to base our test on the statisticT0. We only need to be able tosimulate a random sampleT01, T02, . . . from the distribution, call itF0, determined by the nullhypothesis. We assume thatF0 is continuous, and, without loss of generality, that we rejectthe null hypothesisH0 for large values ofT0. Then, provided thatα = m

n+1is rational, we

can proceed as follows.

1. Observe the actual valuet∗ for T0, calculated from the data

2. Simulate a random sample of sizen from F0

3. Order the set{t∗, t01, . . . , t0n}4. RejectH0 if the rankof t∗ in this set (in decreasing order) is> m.

The basis of this test is that, underH0, the random variableT ∗ has the same distribution as theremainder of the set and so, by symmetry,

P(t∗ is among the largestm values) =m

n + 1.

0-97

Page 99: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

The procedure is exact however smalln might be. However, increasingn increases thepower of the test. The question of how largen should be is discussed by Marriott (1979), seealso Hall and Titterington (1989). A reasonable rule is to choosen such thatm > 5. Note thatwe will need more simulations to test at smaller values ofα.

An alternative view of the procedure is to count the numberM of simulated values> t∗.ThenP = M

nestimates the true significance levelP achieved by the data, i.e.

P = P(T0 > t∗|H0).

In discrete data, we will typically observe ties. We can break ties randomly, then the aboveprocedure will still be valid.

Unfortunately this test does not lead directly to confidence intervals.

0-98

Page 100: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

For random graphs, Monte Carlo tests often use shuffling edges with the number of edgesfixed, or fixing the node degree distribution, or fixing some other summary.

Suppose we want to see whether our observed clustering coefficient is ”unusual” for thetype of network we would like to consider. Then we may draw many networks uniformly atrandom from all networks having the same node degree sequence, say. We count how often aclustering coefficient at least as extreme as ours occurs, and we use that to test the hypothesis.

In practice these types of test are the most used tests in network analysis. They are calledconditional uniform graph tests.

0-99

Page 101: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Some caveats:

In Bernoulli random graphs, the number of edges asymptotically determines the numberof triangles when the number of edges is moderately large. Thus conditioning on the numberof edges (or the node degrees, which determine the number of edges) gives degenerate results.More generally, we have seen that node degrees and clustering coefficient (and other subgraphcounts) are not independent, nor are they independent of the shortest path length. By fixingone summary we may not know exactly what we are testing against.

”Drawing uniformly at random” from complex networks is not as easy as it sounds. Algo-rithms may not explore the whole data set.

”Drawing uniformly at random”, conditional on some summaries being fixed, is related tosampling from exponential random graphs. We have seen already that in exponential randomgraphs there may be more than one stationary distribution for the Markov chain Monte Carloalgorithm; this algorithm is similar to the one used for drawing at random, and so we may haveto expect similar phenomena.

0-100

Page 102: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

4.3 Scale-free networksBarabasi and Albert introduced networks such that the distribution of node degrees the type

Prob(degree = k) ∼ Ck−γ

for k → ∞. Such behaviour is calledpower-law behaviour; the constantγ is called thepower-law exponent. The networks are also calledscale-free:

If α > 0 is a constant, then

Prob(degree = αk) ∼ C(αk)−γ ∼ C′k−γ ,

whereC′ is just a new constant. That is, scaling the argument in the distribution changes theconstant of proportionality as a function of the scale change, but preserves the shape of thedistribution itself. If we take logarithms on both sides:

log Prob(degree = k) ∼ log C − γ log k

log Prob(degree = αk) ∼ log C − γ log α− γ log k;

0-101

Page 103: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

scaling the argument results in a linear shift of thelog probabilities only. This equation alsoleads to the suggestion to plot thelog relfreq(degree = αk) of the empirical relative degreefrequencies againstlog k. Such a plot is called alog-log plot. If the model is correct, then weshould see a straight line; the slope would be our estimate ofγ.

0-102

Page 104: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Example: Yeast data.

0-103

Page 105: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

These plots have a lot of noise in the tails. As an alternative,Newman (2005)suggeststo plot thelog of the empirical cumulative distribution function instead, or, equivalently, ourestimate for

log Prob(degree ≥ k).

If the model is correct, then one can calculate that

log Prob(degree ≥ k) ∼ C′′ − (γ − 1) log k.

Thus a log-log plot should again give a straight line, but with a shallower slope. The tails aresomewhat less noisy in this plot.

In both cases, the slope is estimated by least-squares regression: for our observations,y(k)(which could be log probabilities or log cumulative probabilities, for example) we find the linea + bk such that ∑

(y(k)− a− bk)2

is as small as possible.

0-104

Page 106: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

As a measure of fit, the sample correlationR2 is computed. For general observationsy(k)andx(k), for k = 0, 1, . . . , n, with averagesy andx, it is defined as

R =

∑k(x(k)− x)(y(k)− y)√

(∑

k(x(k)− x)2)(∑

k(y(k)− y)2).

It measures the strength of the linear relationship.

In linear regression,R2 > 0.9 would be rather impressive. However, the rule of thumb forlog-log plots is that1. R2 > 0.992. The observed data (degrees) should cover at least 3 orders of magnitude.

Examples include the World Wide Web at some stage, when it had around109 nodes. Thecriteria are not often matched.

Computer exercise:Generate random samples from your favourite probability distribution,make a log-log plot.

0-105

Page 107: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

A final issue for scale-free networks: It has been shown (Stumpf et al. (2005)that whenthe underlying real network is scale-free, then a subsample on fewer nodes from the networkwill not be scale-free. Thus if our subsample looks scale-free, the underlying real network willnot be scale-free.

In biological network analysis, is is debated how useful the concept of ”scale-free” be-haviour is, as many biological networks contain relatively few nodes.

0-106

Page 108: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

Further referencesA.D. Barbour and G. Reinert (2001). Small Worlds. Random Structures and algorithms 19, 54- 74.

A.D. Barbour and G. Reinert (2006). Discrete small world networks. Electronic Journal ofProbability 11, 12341283.

G. Barnard (1963). Contribution to the discussion of Bartlett’s paper. J. Roy. Statist. Soc. B,294.

F. Chung and L. Lu (2001). The diameter of sparse random graphs. Advances in AppliedMath. 26, 257–279.

M. Dwass (1957). Modified randomization tests for nonparametric hypotheses.Ann. Math.Stat.28, 181–187.

A. Fronczak, P. Fronczak and Janusz A. Holyst (2003). Mean-field theory for clustering coef-

0-107

Page 109: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

ficients in Barabasi-Albert networks Phys. Rev. E 68, 046126.

A. Fronczak, P. Fronczak, Janusz A. Holyst (2004). Average path length in random networksPhys. Rev. E 70, 056110.

P. Hall and D.M. Titterington (1989). The effect of simulation order on level accuracy andpower of Monte Carlo tests. J. Roy. Statist. Soc. B, 459.

K. Lin (2007). Motif counts, clustering coefficients, and vertex degrees in models of randomnetworks. D.Phil. dissertation, Oxford.

F. Marriott (1979). Barnard’s Monte Carlo tests: how many simulations? Appl. Statist.28, 75–77.

M.E.J. Newman (2005). Power laws, Pareto distributions and Zipf’s law. ContemporaryPhysics 46, 323351.

M. P. H. Stumpf, C.Wiuf and R. M. May (2005). Subnets of scale-free networks are not scale-

0-108

Page 110: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

free: Sampling properties of networks. Proc Natl Acad Sci U S A. 2005 March 22; 102(12):4221 - 4224.

0-109

Page 111: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

0-110

Page 112: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

0-111

Page 113: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

0-112

Page 114: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal Q-Q Plot

Theoretical Quantiles

N(0

,1) r

ando

m s

ampl

es: s

ampl

e qu

antil

es

-3 -2 -1 0 1 2 3

-50

510

Normal Q-Q Plot

Theoretical Quantiles

N(1

,3) r

ando

m s

ampl

es: s

ampl

e qu

antil

es

0-113

Page 115: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

● ●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●

●●●●●● ● ●

−3 −2 −1 0 1 2 3

01

23

45

x

y

0-114

Page 116: Statistical Inference for Networksreinert/dtc/networks_files/networklecturesshort.pdfStatistical Inference for Networks Systems Biology Doctoral Training Centre ... Gentleman, V. Carey,

01

23

4

-8-7-6-5-4-3-2

log

k

log P(k)

01

23

4

-8-6-4-2

log

k

log P(greater than k)

0-115