Skip to content

Instantly share code, notes, and snippets.

@hyamamoto
Created October 16, 2015 12:04
Show Gist options
  • Save hyamamoto/cd21f5d413b345d1a22a to your computer and use it in GitHub Desktop.
Save hyamamoto/cd21f5d413b345d1a22a to your computer and use it in GitHub Desktop.
Self-study note: Multivariate Analysis with Mathmatica. (Multinomial distribution)
n = 10;
p1 = 0.3;
p2 = 0.4;
ListPointPlot3D[
Table[
(
Factorial[n] /(Factorial[y1]*Factorial[y2]*Factorial[n - y1 - y2])
) * p1^y1* p2^y2* (1 - p1 - p2)^(n - y1 - y2),
{y1, 0, n},
{y2, 0, n}
],
Filling -> Axis,
PlotRange -> All,
FillingStyle -> Thickness[0.008]
]
r = 0.5;
Plot3D[
PDF[
BinormalDistribution[
{0, 0}, {1, 1}, r
], {x, y}
], {x, -3, 3}, {y, -3, 3}, PlotRange -> All
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment