New in Wolfram
Mathematica
8: Nonparametric, Derived, and Formula Distributions
◄
previous
|
next
►
Core Algorithms
Use Nonparametric Distributions Like Any Other Distribution
The word-length distributions of English parts of speech are estimated and the expected length of a noun is computed from a
HistogramDistribution
.
In[1]:=
X
partOfSpeech = WordData[All, "PartsOfSpeech"]; data = Table[ StringLength /@ i, {i, (WordData[All, #] & /@ partOfSpeech)}];
In[2]:=
X
Framed[Grid[ Partition[ Table[Plot[ Evaluate[PDF[HistogramDistribution[data[[i]]], x]], {x, 0, 30}, PlotLabel -> Style[partOfSpeech[[i]], Bold, FontFamily -> "Verdana"], PlotRange -> All, Exclusions -> None, PlotPoints -> 500, Filling -> Axis, PlotStyle -> {Thick, Black}, FillingStyle -> ColorData[14, 8], ImageSize -> 175, Ticks -> {Range[0, 30, 10], None}, Axes -> {True, False}], {i, Length[partOfSpeech]}], 3]], RoundingRadius -> 10, FrameMargins -> 10, Background -> GrayLevel[.95]]
Out[2]=
In[3]:=
X
Expectation[len, len \[Distributed] HistogramDistribution[data[[1]]]] // N
Out[3]=