1 of 49

Day 4

  • Relationships

2 of 49

3 of 49

4 of 49

Distance can be in any units

  • We’re measuring distance between things.
  • That can be clean, like being taller or shorter in inches
  • Or that can be abstract, like closer or farther by qualia

  • Signal processing lets us put distances on things like periodicity, frequency, and stability thereof

  • Building towards high-dimensional comparisons and clustering!

5 of 49

Euclidean vs. Manhattan distances

  • Euclidean distance (crow flies)

  • Manhattan distance (taxi drives)

p

q

Can you think of any third distance?

6 of 49

Graphs

Not just any rendering of data;

Model of pair-wise connections

The Bridge Problem:

Euler walk: each edge once, end at start

Must have vertices with even edges

Each move can’t disconnect the graph

7 of 49

We se graphs all over

Physical maps

Regulatory networks

Probabilities

P(B|A)

A

B

Nodes (vertices, points)

Edges

8 of 49

Tree of life

Relatedness of all genetically identified species (2.3 million)

www.scientificamerican.com/article/

all-2-3-million-species-are-mapped-into-a-single-circle-of-life1/

9 of 49

Cortical connections

Degree of MRI-evinced connectedness between brain regions during visual tasks

https://scholar.harvard.edu/merabetlab/circos

10 of 49

Semantic networks

Mota et al., Sci Rep. 2014

11 of 49

Completeness, directedness

Directed: edges have direction

Undirected: edges are symmetrical

Complete: all connections

(Directed = undirected)

Recall Bayes Nets

Directed. Why?

A

B

C

D

E

A

B

C

D

E

undirected

directed

A

B

C

D

E

complete

12 of 49

Graphs as matrixes

Edges as vectors

  1. Define a network by a list of edges: (x1,y1 : x2, y2)
  2. Define a network by nodes with connections:

A B C D E

A [ 0 1 0 0 0]

B [ 0 0 1 0 0]

C [ 0 0 0 1 0]

D [ 0 0 0 0 1]

E [ 0 0 0 0 0]

A

B

C

D

E

To

From

Adjacency matrix

13 of 49

  • break

14 of 49

We use something like Markov Models to live

15 of 49

Brains like Gandalf: Grey vs. White

16 of 49

(H)MMs help model complex biology

Model neurons as Graphs

Matrixes define Edge Weights between Nodes

Can this capture the complexity of thought?

A

B

C

D

p1

p2

p3

p4

p5

p6

p0

17 of 49

Markov chains

Will my neuronal receptor activate?

A

B

C

D

p1

p2

p3

p4

p5

p6

A: Docked

B: Diffusing

C: Bound receptor

D: Degraded

State

transition

p0

Fill in values: literature, experiments, guesses

18 of 49

Transition matrices

A B C D

A [ p0 p1 0 0 ]

B [ 0 p2 p3 p6 ]

C [ 0 p5 p4 0 ]

D [ 0 0 0 0 ]

A B C D

A [ 0.8 0.2 0 0 ]

B [ 0 0.7 0.1 0.2 ]

C [ 0 0.9 0.1 0 ]

D [ 0 0 0 0 ]

P([A,B]) * P([B,C]) * P([C,C]) = 0.2 * 0.1 * 0.1 = 0.002

A

B

C

D

p1

p2

p3

p4

p5

p6

p0

One reason nature likes massive redundancy

is that it’s bad at its job…

(neurotransmitter molecules, fish eggs, etc)

Sums to 1 (probability)

Topology

19 of 49

Network structure can oscillate

Think about social networks: You’re connected to more people when you’re awake than when you’re asleep:

  • Either edge weights are dynamic (i.e. when sleeping)
  • Or Edges themselves come and go (how would you code this?)

“network plasticity” – integral in learning, adaptation

Wiegert, Oertner. PNAS. 2013.

20 of 49

Coupled oscillators

Coupling implies energy transfer

Coupling strength is a continuous variable

Able to be modeled with classical physics Enables network resilience / plasticity

k

21 of 49

Coupled oscillators synchronize

Cardiac pacemaker cells

Brain regions

Organs (metab regulation)

Voles (predator avoidance)

Shan et al., Neuron. 2020.

Suprachiasmatic nucleus

22 of 49

Kuramoto networks

Common oscillator network model

  • Assumes equal coupling
  • Assumes stable limit cycles
  • Precise solution over infinite N.

Position as phase

oscillators

coupling

freq

23 of 49

Classic Kuramoto model: fireflies!

24 of 49

Good Night

Bad Night

Temperature

Heart Rate

EGG power

The body also sleeps! (beyond EEG)

25 of 49

Periodic modulation of periodic functions

Ono, Honma, Honma. Sci Rep. 2015.

26 of 49

27 of 49

Smarr et al., J Neurosci, 2019

Multiscale co-oscillation modeling example

28 of 49

Coherence of wavelet of wavelet…

wavelets

WaveCoh

29 of 49

Low High

Coherence

Smarr et al., J Neurosci, in revision

Q175-/-

Q175+/-

Q175+/+

Into HD

30 of 49

State dependent graphs

Properties of edges and nodes can be conditional

Conditions can be approximated as discrete states.

Mutual information and correlations may change as signals change, updating graph values

Oscillators are a predictable version of this: day and night modify which genes can be expressed and which pathways are available

31 of 49

  • break

32 of 49

A word on data visualization

Only include what you want others to focus on

Don’t be afraid of scale as context

1

-1

33 of 49

A word on data visualization

Less is more

Contrast, closeness

Big fonts!!! Small fonts are less immediately clear even when they’re legible

Everything adds meaning or noise

34 of 49

Compare choices

35 of 49

36 of 49

Properties to map with color

  • Hue

  • Saturation

  • Luminance

  • Brightness (subj)

37 of 49

Agglomerative clustering

38 of 49

Cluster analysis

Grouping objects together based on their relationship.

Depending on distance metric

Depending on order of measures

Tons of kinds of clustering!

39 of 49

Single linkage

“Nearest-Neighbor”:

Choose the clusters with the shortest distance between the closest object in one cluster and the closest object in the other cluster.

40 of 49

Complete linkage

“Furthest-Neighbor”:

Choose the clusters with the shortest distance between the furthest object in one cluster and the furthest object in the other cluster.

41 of 49

Average linkage

Choose the clusters with the shortest average distance all objects one cluster and all objects in the other cluster.

42 of 49

Centroid linkage

Choose the clusters with the shortest distance between the centroid of one cluster and the centroid of the other cluster.

43 of 49

The K-means clustering algorithm

  • Input: A set of objects X = {x0,x1,…,xn}, & an integer K
  • Output: A partition S of the objects that minimize the sum of squared distance to the center of the cluster:

Where µj is the mean of cluster Sj.

44 of 49

Mean shift clustering

  • Random seed with kernel (radius = r)

  • Step through space until every step reduces the n in the kernel

  • Iterate, take mean center of mass; means outside r of M0 = M1, etc.

45 of 49

Density-Based Spatial Clustering of Applications with Noise DBSCAN

  • Random seed with kernel (radius = ε)

  • Step through space to the next point within ε.

  • If there are no new points w/in ε, start at a new point

46 of 49

47 of 49

Viswanath et al., Nat Dig Med, 2024

Physiotypes can be data-drive (unintuitive)

48 of 49

We can map graphs onto graphs to track instability of cluster identify

Weeks of sleep fall into clusters.

People live many weeks, so people

Live across clusters!

49 of 49

HW 4. Relational features

Groups of 2

Use your features to group days and individuals

Cluster days based on feature values and/or make a graph model relating days

Do clusters split more by female / male, or by estrous / non estrous?

Explain the way you assigned groups/clusters/edge weights.