File: probability-and-statistics.chapt.txt

package info (click to toggle)
yacas 1.3.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 7,176 kB
  • ctags: 3,520
  • sloc: cpp: 13,960; java: 12,602; sh: 11,401; makefile: 552; perl: 517; ansic: 381
file content (120 lines) | stat: -rw-r--r-- 3,292 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
			Probability and Statistics

		Probability

*INTRO
Each distribution is represented as an entity. For each distribution
known to the system the consistency of parameters is checked. If
the parameters for a distribution are invalid, the functions return
{Undefined}.
For example, {NormalDistribution}{(a,-1)} evaluates to
{Undefined}, because of negative variance.

*CMD BernoulliDistribution --- Bernoulli distribution
*STD
*CALL 
	BernoulliDistribution(p)

*PARMS

{p} -- number, probability of an event in a single trial

*DESC 
A random variable has a Bernoulli distribution with probability {p} if
it can be interpreted as an indicator of an event, where {p} is the
probability to observe the event in a single trial.

Numerical value of {p} must satisfy $0<p<1$.

*SEE BinomialDistribution

*CMD BinomialDistribution --- binomial distribution
*STD
*CALL
	BinomialDistribution(p,n)

*PARMS
{p} -- number, probability to observe an event in single trial

{n} -- number of trials

*DESC
Suppose we repeat a trial {n} times, the probability to observe an
event in a single trial is {p} and outcomes in all trials are mutually
independent. Then the number of trials when the event occurred
is distributed according to the binomial distribution. The probability
of that is {BinomialDistribution}{(p,n)}.

Numerical value of {p} must satisfy $0<p<1$. Numerical value
of {n} must be a positive integer. 

*SEE BernoulliDistribution

*CMD tDistribution --- Student's $t$ distribution
*STD
*CALL
	{tDistribution}(m)

*PARMS 
{m} -- integer, number of degrees of freedom

*DESC

*REM what does it do???
The function {tDistribution} returns the ...

Let $Y$ and $Z$ be independent random variables, $Y$ have the 
NormalDistribution(0,1), {Z} have ChiSquareDistribution(m). Then 
$Y/Sqrt(Z/m)$ has tDistribution(m).

Numerical value of {m} must be positive integer.

*CMD PDF --- probability density function
*STD
*CALL
	PDF(dist,x)

*PARMS
{dist} -- a distribution type

{x} -- a value of random variable

*DESC
If {dist} is a discrete distribution, then {PDF} returns the
probability for a random variable with distribution {dist} to take a
value of {x}. If {dist} is a continuous distribution, then {PDF}
returns the density function at point $x$.

*SEE CDF

		Statistics

*CMD ChiSquareTest --- Pearson's ChiSquare test
*STD

*CALL
	ChiSquareTest(observed,expected)
	ChiSquareTest(observed,expected,params)

*PARMS
{observed} -- list of observed frequencies

{expected} -- list of expected frequencies

{params} -- number of estimated parameters

*DESC
{ChiSquareTest} is intended to find out if our sample was drawn from a
given distribution or not. To find this out, one has to calculate
observed frequencies into certain intervals and expected ones. To
calculate expected frequency the formula $n[i]:=n*p[i]$ must be used,
where $p[i]$ is the probability measure of $i$-th interval, and $n$ is
the total number of observations. If any of the parameters of the
distribution were estimated, this number is given as
{params}.

The function returns a list of three local substitution rules. First
of them contains the test statistic, the second contains the value of the parameters, and
the last one contains the degrees of freedom. 

The test statistic is distributed as ChiSquareDistribution.