pmi: Pointwise Mutual Information

Description Usage Arguments Value See Also Examples

View source: R/svs.r

Description

A function for computing the pointwise mutual information of every entry in a table.

Usage

1
2
3
pmi(x, normalize = FALSE, base = 2)

PMI(x, normalize = FALSE, base = 2)

Arguments

x

A table (i.e. an object which can be converted to an array).

normalize

Logical indicating whether to normalize the pointwise mutual information.

base

Numeric specification of the base with respect to which logarithms are computed.

Value

An array with the pointwise mutual information of every entry.

See Also

MI.

Examples

1
2
3
4
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
   header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8")
tab.SndT_Fra <- table(SndT_Fra)
pmi(tab.SndT_Fra)

Example output

                target_Fra
source_Dut         <U+00E0> partir de   commencer     d'abord   d<U+00E9>but
  aanvang                0.00000000  0.00000000  0.00000000   1.62424358
  begin                  0.00000000 -3.84857173  0.00000000   2.14371036
  beginnen              -3.47480653  1.67581617 -2.99367984  -2.37395192
  eerst                  0.00000000 -0.91970491  2.88936649  -3.41927591
  gaan                   0.00000000 -0.22668266  0.00000000   0.00000000
  komen                  0.00000000 -1.67734407  0.00000000   0.00000000
  krijgen                0.00000000  0.00000000  0.00000000   0.00000000
  ontstaan               0.00000000  0.00000000  0.00000000   0.44367133
  openen                 0.00000000 -4.33101932  0.00000000   0.00000000
  oprichten              0.00000000  0.00000000  0.00000000   0.00000000
  opstarten              0.00000000 -2.27398837  0.00000000   0.00000000
  opzetten               0.00000000  0.00000000  0.00000000   0.00000000
  start                  0.00000000  0.00000000  0.00000000   1.91760252
  starten               -2.75671895  1.08074587 -3.59752035  -3.46321926
  van start gaan         0.00000000 -0.22668266  0.00000000   0.00000000
  vanaf                  2.88713724  0.00000000  0.00000000   0.00000000
  worden                 0.00000000 -0.02023178  0.00000000   0.00000000
                target_Fra
source_Dut         d<U+00E9>butant   d<U+00E9>buter   d<U+00E9>marrer     entamer
  aanvang             0.00000000    -0.17175645      0.00000000  2.48834038
  begin               0.00000000    -2.05667992      0.00000000  0.00000000
  beginnen            1.66167199     1.46770797     -0.30180214  1.30630570
  eerst               0.00000000     0.00000000      0.00000000  0.00000000
  gaan                0.00000000    -1.01975335      0.00000000  0.00000000
  komen               0.00000000    -0.30048976     -0.10476529  0.00000000
  krijgen             0.00000000     0.00000000      2.66782421  0.00000000
  ontstaan            0.00000000     0.00000000      0.00000000  0.48834038
  openen              0.00000000     0.00000000      0.00000000  0.00000000
  oprichten           0.00000000     0.00000000      0.00000000  2.81026848
  opstarten           0.00000000     1.51790343      2.88355290  1.44103467
  opzetten            0.00000000     0.00000000      0.00000000  0.00000000
  start               0.00000000     0.30217474      0.00000000  0.00000000
  starten             2.15736715     0.82824355      3.00124795  1.62584391
  van start gaan      0.00000000     2.88713724      2.34589612  0.90337788
  vanaf               0.00000000     0.00000000      0.00000000  0.00000000
  worden              0.00000000     0.00000000      0.00000000  2.10982876
                target_Fra
source_Dut       entreprendre      entrer      lancer  lancer, se  mettre, se
  aanvang          0.00000000 -0.39106948  0.00000000  0.00000000  0.00000000
  begin            0.00000000  0.00000000 -3.24797858  0.00000000  0.00000000
  beginnen         1.36889024 -2.52419456 -0.17425209  1.46575178  0.67374482
  eerst            0.00000000  0.00000000  0.00000000  0.00000000  0.00000000
  gaan             3.23898091  0.34589612  0.00000000  1.87641083  3.86576359
  komen            0.00000000  3.84943102  1.09317409  0.00000000  1.09317409
  krijgen          0.00000000  3.25278671  0.00000000  0.00000000  2.86576359
  ontstaan         0.00000000  0.00000000  0.00000000  0.00000000  0.00000000
  openen           0.00000000  0.00000000 -2.14546367  0.00000000  0.00000000
  oprichten        0.00000000  0.00000000  4.45072609  0.00000000  0.00000000
  opstarten        2.77663770  0.00000000  3.91156728  0.00000000  0.00000000
  opzetten         0.00000000  0.00000000  2.86576359  4.36826393  0.00000000
  start            0.00000000  0.00000000  0.69583859  0.00000000  0.00000000
  starten          0.00000000 -2.39106948  1.22190740  0.72440774  0.00000000
  van start gaan   0.00000000  0.34589612  2.95887299  0.00000000  0.00000000
  vanaf            0.00000000  0.00000000  0.00000000  0.00000000  0.00000000
  worden           0.00000000  2.55234700  0.00000000  3.66782421  2.75028637
                target_Fra
source_Dut            ouvrir      partir prendre cours recommencer
  aanvang         0.00000000  0.00000000    3.57240465  0.00000000
  begin           0.00000000  0.00000000    0.00000000  0.00000000
  beginnen       -3.08114268  0.06076794    1.85431706  1.85431706
  eerst           0.00000000  0.00000000    0.00000000  0.00000000
  gaan            0.00000000  4.34589612    0.00000000  0.00000000
  komen          -3.07675092  0.00000000    0.00000000  0.00000000
  krijgen         0.69583859  0.00000000    0.00000000  0.00000000
  ontstaan        2.65931271  0.00000000    0.00000000  0.00000000
  openen          3.25825852  0.00000000    0.00000000  0.00000000
  oprichten       0.00000000  0.00000000    0.00000000  0.00000000
  opstarten       0.00000000  0.00000000    0.00000000  0.00000000
  opzetten        2.28080109  0.00000000    0.00000000  0.00000000
  start           0.00000000  1.66782421    0.00000000  0.00000000
  starten        -1.04112701  0.77885552    0.00000000  0.00000000
  van start gaan  0.00000000  0.00000000    0.00000000  0.00000000
  vanaf           0.00000000  0.00000000    0.00000000  0.00000000
  worden          0.00000000  0.00000000    0.00000000  4.51582112

svs documentation built on May 29, 2017, 10:25 a.m.