gam.helpers {UCS}R Documentation

Helper Functions for GAM Equations (gam)

Description

gam.yates and gam.yates.inv implement an invertible version of the discounting function used by Yates' correction. signed.sqrt, b.star, b.norm and e.bar are standard abbreviations used in the definition of generalised association measures in terms of ebo-coordinates.

Usage

  gam.yates(d)
  gam.yates.inv(d.corr)

  signed.sqrt(x)

  b.star(b)
  b.norm(b)
  e.bar(e, b, N)

Arguments

d difference between observed and expected frequency, to which the generalised Yates' correction is applied
d.corr difference between observed and expected frequency with generalised Yates' correction applied, from which the original difference can uniquely be reconstructed
x a vector of positive or negative real numbers
b a vector of balance (b) values in the ebo coordinate system
e a vector of expectation (e) values in the ebo coordinate system
N sample size N

Details

The standard discounting function for Yates' correction is d* := d - 1/2 for d ≥ 0 and d* := d + 1/2 for d < 0, where d is the difference between observed and expected frequency. This definition does not lead to a continuous and invertible function of d, so a GAM with Yates' correction applied does not satisfy the soundness conditions. The generalised Yates' correction implemented by gam.yates and gam.yates.inv is a monotonic (and hence invertible) function that is identical to the standard discounting function for d >= 1 and uses linear interpolation for -1 < d < 1.

The functions signed.sqrt, b.star, b.norm and e.bar compute the standard abbreviation +/- sqrt(x), b*, ||b|| and \bar{e} (“e bar”) used by Evert (2004) for the definition of GAMs in terms of ebo-coordinates.

Value

all functions return a vector of real numbers

References

Evert, Stefan (2004). The Statistics of Word Cooccurrences: Word Pairs and Collocations. PhD Thesis, IMS, University of Stuttgart.

Examples

d <- runif(20, -2, 2)
d.corr <- gam.yates(d)
all(d == gam.yates.inv(d.corr))

signed.sqrt(-4:4)

[Package UCS version 0.5 Index]