Counting Words: Expectation = sample average Poisson sampling - - PowerPoint PPT Presentation

counting words
SMART_READER_LITE
LIVE PREVIEW

Counting Words: Expectation = sample average Poisson sampling - - PowerPoint PPT Presentation

LNRE models Baroni & Evert Computing expectations Counting Words: Expectation = sample average Poisson sampling LNRE Modelling Plugging in ZM LNRE models Pooling types Type density LNRE models Marco Baroni & Stefan Evert


slide-1
SLIDE 1

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Counting Words: LNRE Modelling

Marco Baroni & Stefan Evert M´ alaga, 9 August 2006

slide-2
SLIDE 2

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Outline

Computing expectations from the population model The type density function and LNRE modeling Zipf-Mandelbrot as LNRE model Wrapping up

slide-3
SLIDE 3

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Where we are at

◮ We justified an approach to lexical statistics based on

population models (e.g., Zipf-Mandelbrot)

slide-4
SLIDE 4

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Where we are at

◮ We justified an approach to lexical statistics based on

population models (e.g., Zipf-Mandelbrot)

◮ We discussed random samples and expected values

slide-5
SLIDE 5

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Where we are at

◮ We justified an approach to lexical statistics based on

population models (e.g., Zipf-Mandelbrot)

◮ We discussed random samples and expected values ◮ We showed how to estimate model parameters by

comparing observed / expected frequency spectrum

slide-6
SLIDE 6

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Where we are at

◮ We justified an approach to lexical statistics based on

population models (e.g., Zipf-Mandelbrot)

◮ We discussed random samples and expected values ◮ We showed how to estimate model parameters by

comparing observed / expected frequency spectrum ➥ We need an efficient way to calculate expected values

◮ for random samples of arbitrary size N ◮ given a model of the population type probabilities πk

slide-7
SLIDE 7

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

To calculate E[Vm(N)] . . .

slide-8
SLIDE 8

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

To calculate E[Vm(N)] . . .

◮ Average Vm over a large number (n) of samples,

all of them having the same size N E

  • Vm(N)
  • ≈ 1

n ·

  • V (1)

m

+ V (2)

m

+ · · · + V (n)

m

slide-9
SLIDE 9

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

To calculate E[Vm(N)] . . .

◮ Average Vm over a large number (n) of samples,

all of them having the same size N E

  • Vm(N)
  • ≈ 1

n ·

  • V (1)

m

+ V (2)

m

+ · · · + V (n)

m

  • ◮ Mathematically, E[Vm(N)] is the limit of this expression

for n → ∞ (but you can just think of n as very large)

slide-10
SLIDE 10

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

◮ We know how to calculate the probability that in a

sample of size N, a given type wk (with parameter πk)

  • ccurs exactly m times:
slide-11
SLIDE 11

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

◮ We know how to calculate the probability that in a

sample of size N, a given type wk (with parameter πk)

  • ccurs exactly m times:

pk,m := N m

  • (πk)m(1 − πk)N−m
slide-12
SLIDE 12

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

◮ We know how to calculate the probability that in a

sample of size N, a given type wk (with parameter πk)

  • ccurs exactly m times:

pk,m := N m

  • (πk)m(1 − πk)N−m

◮ Which means that it will be counted in class Vm in

approximately n · pk,m out of n samples

◮ if n is large enough, this estimate is very accurate

slide-13
SLIDE 13

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expected Vm for sample of size N

◮ We know how to calculate the probability that in a

sample of size N, a given type wk (with parameter πk)

  • ccurs exactly m times:

pk,m := N m

  • (πk)m(1 − πk)N−m

◮ Which means that it will be counted in class Vm in

approximately n · pk,m out of n samples

◮ if n is large enough, this estimate is very accurate

◮ Taking the sum over all types wk and dividing by n:

E

  • Vm(N)
  • =
  • k

pk,m =

  • k

N m

  • (πk)m(1 − πk)N−m
slide-14
SLIDE 14

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Binomial sampling vs. Poisson sampling

◮ What we have just calculated is a binomial expectation,

i.e. the average over samples of the same fixed size N

◮ arguably, statistically most appropriate

slide-15
SLIDE 15

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Binomial sampling vs. Poisson sampling

◮ What we have just calculated is a binomial expectation,

i.e. the average over samples of the same fixed size N

◮ arguably, statistically most appropriate

◮ But mathematically simpler to use Poisson expectation:

E

  • Vm(N)
  • =
  • k

(Nπk)m m! e−Nπk

◮ here, we sum over samples of various sizes close to N

slide-16
SLIDE 16

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Binomial sampling vs. Poisson sampling

Switch to Poisson sampling can be motivated in two ways:

slide-17
SLIDE 17

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Binomial sampling vs. Poisson sampling

Switch to Poisson sampling can be motivated in two ways:

◮ Philosophical:

◮ Not as unreasonable as it seems: think of the frequency

distribution of nouns in text sample of 1 million running words (such as the Brown corpus) ➜ sample size N (= number of noun tokens) will be different for each sample

slide-18
SLIDE 18

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Binomial sampling vs. Poisson sampling

Switch to Poisson sampling can be motivated in two ways:

◮ Philosophical:

◮ Not as unreasonable as it seems: think of the frequency

distribution of nouns in text sample of 1 million running words (such as the Brown corpus) ➜ sample size N (= number of noun tokens) will be different for each sample

◮ Practical:

◮ When N is large and π small (as with word frequency

distributions), Poisson probabilities are a very good approximation to binomial probabilities

slide-19
SLIDE 19

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Binomial sampling vs. Poisson sampling

Switch to Poisson sampling can be motivated in two ways:

◮ Philosophical:

◮ Not as unreasonable as it seems: think of the frequency

distribution of nouns in text sample of 1 million running words (such as the Brown corpus) ➜ sample size N (= number of noun tokens) will be different for each sample

◮ Practical:

◮ When N is large and π small (as with word frequency

distributions), Poisson probabilities are a very good approximation to binomial probabilities

◮ In lexical statistics, word frequency distribution models

almost always use Poisson expectations

slide-20
SLIDE 20

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Poisson expectations for Vm and V

E

  • Vm(N)
  • =
  • k

(Nπk)m m! · e−Nπk E

  • V (N)
  • =
  • k
  • 1 − e−Nπk

◮ E[V ] sums over probabilities that wk occurs at least once

slide-21
SLIDE 21

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Poisson expectations for Vm and V

E

  • Vm(N)
  • =
  • k

(Nπk)m m! · e−Nπk E

  • V (N)
  • =
  • k
  • 1 − e−Nπk

◮ E[V ] sums over probabilities that wk occurs at least once

☞ Now we need to plug in population model for πk (we will use the Zipf-Mandelbrot model, of course)

slide-22
SLIDE 22

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in the population model

Zipf-Mandelbrot: πk = C (k + b)a E

  • Vm(N)
  • =
  • k

(Nπk)m m! · e−Nπk E

  • V (N)
  • =
  • k
  • 1 − e−Nπk
slide-23
SLIDE 23

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in the population model

Zipf-Mandelbrot: πk = C (k + b)a E

  • Vm(N)
  • =
  • k

(NC)m (k + b)a·m · m! · e−

NC (k+b)a

E

  • V (N)
  • =
  • k
  • 1 − e−Nπk
slide-24
SLIDE 24

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in the population model

Zipf-Mandelbrot: πk = C (k + b)a E

  • Vm(N)
  • =
  • k

(NC)m (k + b)a·m · m! · e−

NC (k+b)a

E

  • Vm(N)
  • =
  • k
  • 1 − e−

NC (k+b)a

slide-25
SLIDE 25

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in the population model

Zipf-Mandelbrot: πk = C (k + b)a E

  • Vm(N)
  • =
  • k

(NC)m (k + b)a·m · m! · e−

NC (k+b)a

E

  • Vm(N)
  • =
  • k
  • 1 − e−

NC (k+b)a

☞ This looks ugly even to a mathematician . . . . . . and to a computer

slide-26
SLIDE 26

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Outline

Computing expectations from the population model The type density function and LNRE modeling Zipf-Mandelbrot as LNRE model Wrapping up

slide-27
SLIDE 27

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The bad news

E

  • Vm(N)
  • =
  • k

(NC)m (k + b)a·m · m! · e−

NC (k+b)a

◮ This looks ugly even to a mathematician ◮ Are we stuck?

slide-28
SLIDE 28

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

An idea. . .

◮ Look back at the observed word frequency data ◮ Huge type frequency lists with many ties in the ranking

◮ and unstable ordering across different samples

slide-29
SLIDE 29

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

An idea. . .

◮ Look back at the observed word frequency data ◮ Huge type frequency lists with many ties in the ranking

◮ and unstable ordering across different samples

◮ More robust view on the data by pooling types with the

same frequency ➜ frequency spectrum

slide-30
SLIDE 30

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

An idea. . .

◮ Look back at the observed word frequency data ◮ Huge type frequency lists with many ties in the ranking

◮ and unstable ordering across different samples

◮ More robust view on the data by pooling types with the

same frequency ➜ frequency spectrum

◮ Perhaps we can use a similar approach for the

probabilities of the population model?

slide-31
SLIDE 31

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Pooling type probabilities

◮ Different from frequency spectrum because ZM model

stipulates different, unique probabiliy πk for each type k

slide-32
SLIDE 32

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Pooling type probabilities

◮ Different from frequency spectrum because ZM model

stipulates different, unique probabiliy πk for each type k

◮ Pool types with similar probabilities into cells

◮ intuition: contribution to E[Vm] should be similar ◮ e.g. for πk = .02501 vs. πl = .02504

☞ histogram for the distribution of type probabilities

slide-33
SLIDE 33

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Pooling type probabilities

◮ Different from frequency spectrum because ZM model

stipulates different, unique probabiliy πk for each type k

◮ Pool types with similar probabilities into cells

◮ intuition: contribution to E[Vm] should be similar ◮ e.g. for πk = .02501 vs. πl = .02504

☞ histogram for the distribution of type probabilities

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ cell j represents types

with πk ≈ j/L

◮ cell count cj = area

  • f bar in histogram
slide-34
SLIDE 34

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Produce histogram with L cells (e.g., L = 1000) ◮ Cell number j contains types wk with πk ≈ j/L ◮ The number of such types is the cell count cj

slide-35
SLIDE 35

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Produce histogram with L cells (e.g., L = 1000) ◮ Cell number j contains types wk with πk ≈ j/L ◮ The number of such types is the cell count cj ◮ Now plug this into the Poisson expectation formula:

E

  • Vm(N)
  • =
  • k

(Nπk)m m! · e−Nπk

slide-36
SLIDE 36

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Produce histogram with L cells (e.g., L = 1000) ◮ Cell number j contains types wk with πk ≈ j/L ◮ The number of such types is the cell count cj ◮ Now plug this into the Poisson expectation formula:

E

  • Vm(N)
  • =
  • k

(Nπk)m m! · e−Nπk ⇓ E

  • Vm(N)
  • =

L

  • j=1

(N · j)m Lm · m! · e− N·j

L · cj

slide-37
SLIDE 37

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Produce histogram with L cells (e.g., L = 1000) ◮ Cell number j contains types wk with πk ≈ j/L ◮ The number of such types is the cell count cj ◮ Now plug this into the Poisson expectation formula:

E

  • Vm(N)
  • =
  • k

(Nπk)m m! · e−Nπk ⇓ E

  • Vm(N)
  • =

L

  • j=1

(N · j)m Lm · m! · e− N·j

L · cj

☞ This looks much better (to a mathematician . . . )

slide-38
SLIDE 38

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Shorter summation for small L ➜ easier to calculate

slide-39
SLIDE 39

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Shorter summation for small L ➜ easier to calculate ◮ But then it is only a coarse approximation:

◮ for L = 1000, we pool all types with πk < .001 together ◮ some occcur once in a milion words, some once in 100

million words, some only once in a billion words

slide-40
SLIDE 40

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Shorter summation for small L ➜ easier to calculate ◮ But then it is only a coarse approximation:

◮ for L = 1000, we pool all types with πk < .001 together ◮ some occcur once in a milion words, some once in 100

million words, some only once in a billion words

◮ We can refine the histogram, i.e. increase number L of

cells, but then the summation becomes expensive again

slide-41
SLIDE 41

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Shorter summation for small L ➜ easier to calculate ◮ But then it is only a coarse approximation:

◮ for L = 1000, we pool all types with πk < .001 together ◮ some occcur once in a milion words, some once in 100

million words, some only once in a billion words

◮ We can refine the histogram, i.e. increase number L of

cells, but then the summation becomes expensive again

◮ The real advantage: we have moved the population

model equation from πk to cj, and thus out of the exponential and power functions

☞ this makes it much easier to plug in a population model

slide-42
SLIDE 42

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Plugging in, 2nd attempt

◮ Shorter summation for small L ➜ easier to calculate ◮ But then it is only a coarse approximation:

◮ for L = 1000, we pool all types with πk < .001 together ◮ some occcur once in a milion words, some once in 100

million words, some only once in a billion words

◮ We can refine the histogram, i.e. increase number L of

cells, but then the summation becomes expensive again

◮ The real advantage: we have moved the population

model equation from πk to cj, and thus out of the exponential and power functions

☞ this makes it much easier to plug in a population model

E

  • Vm(N)
  • =

N L m ·  

L

  • j=1

jm m!e− N

L j · cj

 

slide-43
SLIDE 43

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Refining the histogram

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ L = 2000 cells ◮ L = 5000 cells

slide-44
SLIDE 44

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Refining the histogram

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ L = 2000 cells ◮ L = 5000 cells

slide-45
SLIDE 45

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Refining the histogram

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ L = 2000 cells ◮ L = 5000 cells

slide-46
SLIDE 46

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Refining the histogram

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ L = 2000 cells ◮ L = 5000 cells ◮ type density function

g(π) ≥ 0

slide-47
SLIDE 47

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The type density function

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ L = 2000 cells ◮ L = 5000 cells ◮ type density function

g(π) ≥ 0

◮ Number of types wk with A ≤ πk ≤ B

= area under curve g(π) between A and B

slide-48
SLIDE 48

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The type density function

0.010 0.012 0.014 0.016 0.018 0.020 π

◮ L = 1000 cells ◮ L = 2000 cells ◮ L = 5000 cells ◮ type density function

g(π) ≥ 0

◮ Number of types wk with A ≤ πk ≤ B

= area under curve g(π) between A and B = B

A

g(π) dπ

slide-49
SLIDE 49

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The integral form of expectations

E

  • Vm(N)
  • =

L

  • j=1
  • N·j

L

m m! · e− N·j

L · cj

slide-50
SLIDE 50

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The integral form of expectations

E

  • Vm(N)
  • =

L

  • j=1
  • N·j

L

m m! · e− N·j

L · cj

◮ Mathematically, for L → ∞ this converges to an integral,

with j/L ↔ π and cj ↔ g(π) dπ:

slide-51
SLIDE 51

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The integral form of expectations

E

  • Vm(N)
  • =

L

  • j=1
  • N·j

L

m m! · e− N·j

L · cj

◮ Mathematically, for L → ∞ this converges to an integral,

with j/L ↔ π and cj ↔ g(π) dπ: E

  • Vm(N)
  • =

1 (Nπ)m m! · e−Nπ · g(π) dπ

slide-52
SLIDE 52

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The integral form of expectations

E

  • Vm(N)
  • =

L

  • j=1
  • N·j

L

m m! · e− N·j

L · cj

◮ Mathematically, for L → ∞ this converges to an integral,

with j/L ↔ π and cj ↔ g(π) dπ: E

  • Vm(N)
  • =

1 (Nπ)m m! · e−Nπ · g(π) dπ

◮ Beautiful! :-)

slide-53
SLIDE 53

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Summary time

What did we just do?

◮ Initial formula was too complex ◮ Histogram approximation: simpler but coarse ◮ Get nuances back by increasing number of cells ◮ . . . but this time we end up with a convenient integral

that we can compute efficiently!

slide-54
SLIDE 54

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

LNRE models

E

  • Vm(N)
  • =

1 (Nπ)m m! · e−Nπ · g(π) dπ E

  • V (N)
  • =

1

  • 1 − e−Nπ

· g(π) dπ

slide-55
SLIDE 55

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

LNRE models

E

  • Vm(N)
  • =

1 (Nπ)m m! · e−Nπ · g(π) dπ E

  • V (N)
  • =

1

  • 1 − e−Nπ

· g(π) dπ

◮ We can plug in any function g defined on [0, 1] ◮ Population model expressed in terms of a type density

function g is what we call a LNRE model (for Large Number of Rare Events, Baayen 2001)

slide-56
SLIDE 56

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

LNRE models

◮ You can’t just use any old function, of course – g must

satisfy the following conditions:

slide-57
SLIDE 57

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

LNRE models

◮ You can’t just use any old function, of course – g must

satisfy the following conditions:

◮ g ≥ 0 ◮

1 π · g(π) dπ = 1

☞ Do they look familiar to you?

slide-58
SLIDE 58

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

LNRE models

◮ You can’t just use any old function, of course – g must

satisfy the following conditions:

◮ g ≥ 0 ◮

1 π · g(π) dπ = 1

☞ Do they look familiar to you?

◮ Moreover, we want to use a function that can be derived

from a plausible population model, e.g. Zipf-Mandelbrot

slide-59
SLIDE 59

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Outline

Computing expectations from the population model The type density function and LNRE modeling Zipf-Mandelbrot as LNRE model Wrapping up

slide-60
SLIDE 60

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The Zipf-Mandelbrot law as a LNRE model

◮ We need to reformulate the Zipf-Mandelbrot law in terms

  • f a type density function (to calculate expectations)
slide-61
SLIDE 61

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The Zipf-Mandelbrot law as a LNRE model

◮ We need to reformulate the Zipf-Mandelbrot law in terms

  • f a type density function (to calculate expectations)

◮ ZM has 2 parameters (and fZM has 3 parameters)

➜ type density function will also have parameters

◮ same number of parameters, but different interpretation ◮ cannot use parameter values of the population model!

slide-62
SLIDE 62

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The Zipf-Mandelbrot law as a LNRE model

◮ We need to reformulate the Zipf-Mandelbrot law in terms

  • f a type density function (to calculate expectations)

◮ ZM has 2 parameters (and fZM has 3 parameters)

➜ type density function will also have parameters

◮ same number of parameters, but different interpretation ◮ cannot use parameter values of the population model!

➥ Goal is to find a function g(π) that corresponds to a very fine histogram of the ZM (or fZM) type population

0.010 0.012 0.014 0.016 0.018 0.020 π π

slide-63
SLIDE 63

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Zipf-Mandelbrot as a LNRE model

◮ Find a function g(π) that matches a very fine histogram

  • f the Zipf-Mandelbrot law (as a population model)
slide-64
SLIDE 64

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Zipf-Mandelbrot as a LNRE model

◮ Find a function g(π) that matches a very fine histogram

  • f the Zipf-Mandelbrot law (as a population model)

◮ This could be done directl by trial and error for every

possible combination of ZM parameters a and b: ugly

◮ we don’t even know which family of functions to use ◮ there must be a better way!

slide-65
SLIDE 65

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Zipf-Mandelbrot as a LNRE model

◮ Find a function g(π) that matches a very fine histogram

  • f the Zipf-Mandelbrot law (as a population model)

◮ This could be done directl by trial and error for every

possible combination of ZM parameters a and b: ugly

◮ we don’t even know which family of functions to use ◮ there must be a better way!

◮ Luckily, there is an analytical solution

slide-66
SLIDE 66

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Summary of the next few steps . . .

for the less mathematically inclined among us

◮ Plug together g(π) and the ZM law for πk

slide-67
SLIDE 67

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Summary of the next few steps . . .

for the less mathematically inclined among us

◮ Plug together g(π) and the ZM law for πk ◮ Math happens

slide-68
SLIDE 68

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Summary of the next few steps . . .

for the less mathematically inclined among us

◮ Plug together g(π) and the ZM law for πk ◮ Math happens ◮ Out comes ZM formulated in terms of g(π)

slide-69
SLIDE 69

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Summary of the next few steps . . .

for the less mathematically inclined among us

◮ Plug together g(π) and the ZM law for πk ◮ Math happens ◮ Out comes ZM formulated in terms of g(π) ◮ And now . . . another detour (sorry!)

slide-70
SLIDE 70

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Meet G, the type distribution

◮ There is a way to derive ZM’s g analytically

. . . but it requires another detour

slide-71
SLIDE 71

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Meet G, the type distribution

◮ There is a way to derive ZM’s g analytically

. . . but it requires another detour

◮ We can easily calculate the number of types with π ≥ ρ,

which we call the type distribution G(ρ)

slide-72
SLIDE 72

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Meet G, the type distribution

◮ There is a way to derive ZM’s g analytically

. . . but it requires another detour

◮ We can easily calculate the number of types with π ≥ ρ,

which we call the type distribution G(ρ)

◮ According to the ZM law, for ρ = πk there are exactly

k types with π ≥ ρ (viz. the types w1, . . . , wk), i.e.: G(πk) = k

slide-73
SLIDE 73

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Meet G, the type distribution

◮ There is a way to derive ZM’s g analytically

. . . but it requires another detour

◮ We can easily calculate the number of types with π ≥ ρ,

which we call the type distribution G(ρ)

◮ According to the ZM law, for ρ = πk there are exactly

k types with π ≥ ρ (viz. the types w1, . . . , wk), i.e.: G(πk) = k

◮ From this equation we will be able to work out G

slide-74
SLIDE 74

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Meet G, the type distribution

◮ There is a way to derive ZM’s g analytically

. . . but it requires another detour

◮ We can easily calculate the number of types with π ≥ ρ,

which we call the type distribution G(ρ)

◮ According to the ZM law, for ρ = πk there are exactly

k types with π ≥ ρ (viz. the types w1, . . . , wk), i.e.: G(πk) = k

◮ From this equation we will be able to work out G ◮ With the help of G we can then derive the LNRE

formulation of ZM in terms of a type density function g

◮ NB: upper case G stands for the type distribution, lower

case g for the type density function (standard notation)

slide-75
SLIDE 75

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Sneak preview: from G to g

◮ G(ρ) =

1

ρ

g(π) dπ

slide-76
SLIDE 76

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Sneak preview: from G to g

◮ G(ρ) =

1

ρ

g(π) dπ

◮ B

A g(π) dπ = number of types with A ≤ πk ≤ B

◮ G(ρ) = number of types with ρ ≤ πk ◮ there are no types with πk > 1

slide-77
SLIDE 77

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Sneak preview: from G to g

◮ G(ρ) =

1

ρ

g(π) dπ

◮ B

A g(π) dπ = number of types with A ≤ πk ≤ B

◮ G(ρ) = number of types with ρ ≤ πk ◮ there are no types with πk > 1

➥ G ′ = −g, or equivalently g = −G ′

slide-78
SLIDE 78

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Sneak preview: from G to g

◮ G(ρ) =

1

ρ

g(π) dπ

◮ B

A g(π) dπ = number of types with A ≤ πk ≤ B

◮ G(ρ) = number of types with ρ ≤ πk ◮ there are no types with πk > 1

➥ G ′ = −g, or equivalently g = −G ′

◮ This is the second fundamental theorem of calculus

slide-79
SLIDE 79

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Sneak preview: from G to g

◮ G(ρ) =

1

ρ

g(π) dπ

◮ B

A g(π) dπ = number of types with A ≤ πk ≤ B

◮ G(ρ) = number of types with ρ ≤ πk ◮ there are no types with πk > 1

➥ G ′ = −g, or equivalently g = −G ′

◮ This is the second fundamental theorem of calculus ◮ Intuitively:

◮ If you increase ρ, say from ρ to ρ + x, G decreases

(fewer types ➜ minus sign)

◮ The amount by which it decreases (number of types

between ρ and ρ + x) is proportional to g(ρ)

slide-80
SLIDE 80

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

◮ According to the ZM law, for ρ = πk there are exactly

k types with π ≥ ρ (viz. the types w1, . . . , wk), i.e.: G(πk) = k

slide-81
SLIDE 81

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

◮ According to the ZM law, for ρ = πk there are exactly

k types with π ≥ ρ (viz. the types w1, . . . , wk), i.e.: G(πk) = k

◮ Insert ZM formula for the type probabilities πk:

G

  • C

(k + b)a

  • = k
slide-82
SLIDE 82

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

◮ According to the ZM law, for ρ = πk there are exactly

k types with π ≥ ρ (viz. the types w1, . . . , wk), i.e.: G(πk) = k

◮ Insert ZM formula for the type probabilities πk:

G

  • C

(k + b)a

  • = k

☞ Find a function G that satisfies this equation

◮ err . . .

slide-83
SLIDE 83

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

G

  • C

(k + b)a

  • = k
slide-84
SLIDE 84

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

G

  • C

(k + b)a

  • = k

◮ ZM: k → πk = C (k+b)a ⇐

⇒ G: πk → k

slide-85
SLIDE 85

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

G

  • C

(k + b)a

  • = k

◮ ZM: k → πk = C (k+b)a ⇐

⇒ G: πk → k

◮ To get back from πk to k, all we have to do is to solve

the Zipf-Mandelbrot equation for k, obtaining: k = C

1 a · (πk)− 1 a − b

slide-86
SLIDE 86

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Calculating G from the Zipf-Mandelbrot law

G

  • C

(k + b)a

  • = k

◮ ZM: k → πk = C (k+b)a ⇐

⇒ G: πk → k

◮ To get back from πk to k, all we have to do is to solve

the Zipf-Mandelbrot equation for k, obtaining: k = C

1 a · (πk)− 1 a − b

◮ We can now define G by

G(ρ) := C

1 a · ρ− 1 a − b

and have found a function that satisfies G(πk) = k

slide-87
SLIDE 87

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

From G to g

g(π) = −G ′(π) with G(π) = C

1 a · π− 1 a − b

slide-88
SLIDE 88

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

From G to g

g(π) = −G ′(π) with G(π) = C

1 a · π− 1 a − b

☞ (trivial) math happens

slide-89
SLIDE 89

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

From G to g

g(π) = −G ′(π) with G(π) = C

1 a · π− 1 a − b

☞ (trivial) math happens g(π) = (C

1 a /a) · π− 1 a −1

slide-90
SLIDE 90

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

From G to g

g(π) = −G ′(π) with G(π) = C

1 a · π− 1 a − b

☞ (trivial) math happens g(π) = (C

1 a /a) · π− 1 a −1

◮ Simplify by renaming constants:

g(π) = C ∗ · π−α−1

slide-91
SLIDE 91

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

From G to g

g(π) = −G ′(π) with G(π) = C

1 a · π− 1 a − b

☞ (trivial) math happens g(π) = (C

1 a /a) · π− 1 a −1

◮ Simplify by renaming constants:

g(π) = C ∗ · π−α−1

◮ α = 1 a replaces ZM’s a as “slope” parameter (0 < α < 1)

slide-92
SLIDE 92

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

From G to g

g(π) = −G ′(π) with G(π) = C

1 a · π− 1 a − b

☞ (trivial) math happens g(π) = (C

1 a /a) · π− 1 a −1

◮ Simplify by renaming constants:

g(π) = C ∗ · π−α−1

◮ α = 1 a replaces ZM’s a as “slope” parameter (0 < α < 1) ◮ C ∗ is normalizing constant determined from constraint

1 π · g(π) dπ = 1

slide-93
SLIDE 93

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The cutoff parameter B

◮ We are not quite done yet: we lost one parameter (b)

g(π) = C ∗ · π−α−1

slide-94
SLIDE 94

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The cutoff parameter B

◮ We are not quite done yet: we lost one parameter (b)

g(π) = C ∗ · π−α−1

◮ According to the Zipf-Mandelbrot law, there are no types

with π > π1 (where typically π1 ≪ 1), but g(π = 1) > 0 no matter what value α takes

slide-95
SLIDE 95

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The cutoff parameter B

◮ We are not quite done yet: we lost one parameter (b)

g(π) = C ∗ · π−α−1

◮ According to the Zipf-Mandelbrot law, there are no types

with π > π1 (where typically π1 ≪ 1), but g(π = 1) > 0 no matter what value α takes

◮ We need an “upper threshold” parameter ◮ Obvious choice: π1, but for mathematical reasons the

threshold parameter B close rather than equal to π1

slide-96
SLIDE 96

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The cutoff parameter B

◮ We are not quite done yet: we lost one parameter (b)

g(π) = C ∗ · π−α−1

◮ According to the Zipf-Mandelbrot law, there are no types

with π > π1 (where typically π1 ≪ 1), but g(π = 1) > 0 no matter what value α takes

◮ We need an “upper threshold” parameter ◮ Obvious choice: π1, but for mathematical reasons the

threshold parameter B close rather than equal to π1

◮ Surprise, surprise: B = a − 1

b

☞ b is back!

slide-97
SLIDE 97

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The LNRE ZM model

g(π) =

  • C · π−α−1

0 ≤ π ≤ B π > B

◮ shape parameter 0 < α < 1 (“slope”) ◮ (upper) cutoff parameter 0 < B ≤ 1 ◮ C = 1 − α

B1−α

◮ relation to Zipf-Mandelbrot law:

a = 1 α S = ∞ b = 1 − α B · α

slide-98
SLIDE 98

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expectations under the LNRE ZM model

E

  • Vm(N)
  • =

1 (Nπ)m m! e−Nπg(π) dπ = C m! · B (Nπ)me−Nππ−α−1 dπ = . . . = C m! · Nα · γ(m − α, NB)

slide-99
SLIDE 99

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expectations under the LNRE ZM model

E

  • Vm(N)
  • =

1 (Nπ)m m! e−Nπg(π) dπ = C m! · B (Nπ)me−Nππ−α−1 dπ = . . . = C m! · Nα · γ(m − α, NB)

◮ The (lower) incomplete Gamma function γ is a so-called

special function ➜ well-understood by mathematicians

slide-100
SLIDE 100

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Expectations under the LNRE ZM model

E

  • Vm(N)
  • =

1 (Nπ)m m! e−Nπg(π) dπ = C m! · B (Nπ)me−Nππ−α−1 dπ = . . . = C m! · Nα · γ(m − α, NB)

◮ The (lower) incomplete Gamma function γ is a so-called

special function ➜ well-understood by mathematicians

◮ γ and m! = Γ(m + 1) can be computed efficiently ◮ This and several similar properties make the LNRE

formulations of ZM and fZM convient and robust

slide-101
SLIDE 101

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

The LNRE fZM model

g(π) =

  • C · π−α−1

A ≤ π ≤ B

  • therwise

◮ shape parameter 0 < α < 1 (“slope”) ◮ cutoff parameters 0 < A < B ≤ 1

◮ fZM with A = 0 ➜ ZM model

◮ C =

1 − α B1−α − A1−α

◮ relation to Zipf-Mandelbrot law:

a = 1 α S = 1 − α α · A−α − B−α B1−α − A1−α b = C Bα · α

slide-102
SLIDE 102

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Outline

Computing expectations from the population model The type density function and LNRE modeling Zipf-Mandelbrot as LNRE model Wrapping up

slide-103
SLIDE 103

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Wrapping up

◮ Wake up! Math is done

slide-104
SLIDE 104

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Wrapping up

◮ Wake up! Math is done ◮ In principle, you can forget about all this

and use LNRE models as black boxes (says Marco)

slide-105
SLIDE 105

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Wrapping up

◮ Wake up! Math is done ◮ In principle, you can forget about all this

and use LNRE models as black boxes (says Marco)

◮ However. . .

slide-106
SLIDE 106

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ LNRE models: mathematical apparatus with ultimate

goal to derive expectations for V and frequency spectrum Vm of extremely type-rich populations

slide-107
SLIDE 107

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ LNRE models: mathematical apparatus with ultimate

goal to derive expectations for V and frequency spectrum Vm of extremely type-rich populations

◮ The components of a LNRE model:

slide-108
SLIDE 108

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ LNRE models: mathematical apparatus with ultimate

goal to derive expectations for V and frequency spectrum Vm of extremely type-rich populations

◮ The components of a LNRE model:

◮ Population model, expressed as family of type density

functions (determines overall shape of distribution)

slide-109
SLIDE 109

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ LNRE models: mathematical apparatus with ultimate

goal to derive expectations for V and frequency spectrum Vm of extremely type-rich populations

◮ The components of a LNRE model:

◮ Population model, expressed as family of type density

functions (determines overall shape of distribution)

◮ Parameters of the type density function (determine how

steep the curve is and other aspects of its shape)

slide-110
SLIDE 110

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ LNRE models: mathematical apparatus with ultimate

goal to derive expectations for V and frequency spectrum Vm of extremely type-rich populations

◮ The components of a LNRE model:

◮ Population model, expressed as family of type density

functions (determines overall shape of distribution)

◮ Parameters of the type density function (determine how

steep the curve is and other aspects of its shape)

◮ Formulas to compute expectations for V and spectrum

elements Vm in samples of arbitrary size N (we used Poisson sampling, but there are other options)

slide-111
SLIDE 111

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ In order to apply LNRE model to real-life data you need

a way to estimate model parameters (typically by matching expected and observed frequency spectrum)

slide-112
SLIDE 112

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Things it would be good for you to remember

◮ In order to apply LNRE model to real-life data you need

a way to estimate model parameters (typically by matching expected and observed frequency spectrum)

◮ Aspects you might actively intervene in:

◮ choose a LNRE model ◮ details of parameter estimation (cost function etc.)

slide-113
SLIDE 113

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

slide-114
SLIDE 114

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

◮ spc <- read.spc("Brown100k.spc")

☞ load observed frequency spectrum from file

slide-115
SLIDE 115

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

◮ spc <- read.spc("Brown100k.spc")

☞ load observed frequency spectrum from file

◮ model <- lnre("zm", spc)

☞ pick ZM model and estimate parameters from spectrum

slide-116
SLIDE 116

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

◮ spc <- read.spc("Brown100k.spc")

☞ load observed frequency spectrum from file

◮ model <- lnre("zm", spc)

☞ pick ZM model and estimate parameters from spectrum

◮ summary(model)

☞ displays model parameters & goodness-of-fit

slide-117
SLIDE 117

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

◮ spc <- read.spc("Brown100k.spc")

☞ load observed frequency spectrum from file

◮ model <- lnre("zm", spc)

☞ pick ZM model and estimate parameters from spectrum

◮ summary(model)

☞ displays model parameters & goodness-of-fit

◮ EV(model, 1e+6)

☞ expected V at 1 million word sample size

slide-118
SLIDE 118

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

◮ spc <- read.spc("Brown100k.spc")

☞ load observed frequency spectrum from file

◮ model <- lnre("zm", spc)

☞ pick ZM model and estimate parameters from spectrum

◮ summary(model)

☞ displays model parameters & goodness-of-fit

◮ EV(model, 1e+6)

☞ expected V at 1 million word sample size

◮ spc.exp <- lnre.spc(model, 1e+6)

☞ expected spectrum at 1 million word sample size

slide-119
SLIDE 119

LNRE models Baroni & Evert Computing expectations

Expectation = sample average Poisson sampling Plugging in ZM

LNRE models

Pooling types Type density LNRE models

Zipf-Mandelbrot as LNRE model

The problem Type distribution Zipf-Mandelbrot The ZM & fZM LNRE models

Wrapping up

Performing a LNRE analysis

in zipfR

◮ spc <- read.spc("Brown100k.spc")

☞ load observed frequency spectrum from file

◮ model <- lnre("zm", spc)

☞ pick ZM model and estimate parameters from spectrum

◮ summary(model)

☞ displays model parameters & goodness-of-fit

◮ EV(model, 1e+6)

☞ expected V at 1 million word sample size

◮ spc.exp <- lnre.spc(model, 1e+6)

☞ expected spectrum at 1 million word sample size

◮ plot(spc.exp)

☞ plot expected spectrum