-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUMVE_one_sample_poisson_cut_distribution.qmd
More file actions
61 lines (42 loc) · 1.06 KB
/
UMVE_one_sample_poisson_cut_distribution.qmd
File metadata and controls
61 lines (42 loc) · 1.06 KB
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
---
title: "UMVUE one sample cut poisson distributin"
format:
html:
code-fold: true
jupyter: python3
---
$$
\begin{align*}
& \text{if} ~~f_X(x) = \frac{\exp(-\theta)\times \theta^x}{(1 - \exp(-\theta)) \times x!}, \quad x = 1, 2, 3, \dots\quad \theta > 0, \\
& \gamma(\theta) = 1 - \exp(-), \\
& \text{1. calculate UVMUE for} ~\gamma(\theta) ~\text{and Variance of this estimator}.\\
& \text{2. calculate Crammer-Rao Bound for above estimator}.
\end{align*}
$$
```{python}
from sympy.stats import DiscreteRV, P, E, variance
from sympy import Symbol, factorial, exp, S, simplify, init_printing
x = Symbol('x', integer = True, positive = True)
t = Symbol('theta', real = True, positive = True)
pdf = exp(-t) * t**(x) /(factorial(x) * (1-exp(-t)))
D = DiscreteRV(x, pdf, set = S.Naturals)
# get expectation of X
E(D)
```
# get variance of X
```{python}
variance(D)
```
## get probability of P(X >= 1)
```{python}
temp1 = P(D >= 1)
simplify(temp1)
```
```{python}
temp1 = P(D >= 2)
simplify(temp1)
```
```{python}
temp1 = P(D >= 3)
simplify(temp1)
```