24 Commits

Author SHA1 Message Date
2e25934348 Finish theory for exercise 2 2026-02-13 02:02:51 +01:00
948523c1b5 Add first part of theory for exercise two 2026-02-12 23:50:32 +01:00
e39ae190f3 Add complete theory for exercise 1 2026-02-12 23:21:15 +01:00
771fa14b20 Add slide transitions to exercise solutions 2026-02-12 17:51:31 +01:00
345cedd2fb Add solutions to exercise 2 2026-02-12 16:57:19 +01:00
649ddf751e Add solutions for exercise 1 2026-02-12 16:25:15 +01:00
bc9ce46507 Add first slides explaining point estimators and their properties 2026-02-10 18:12:30 +01:00
40ff354ed9 Add slide explaining prob. theory vs statistics 2026-02-10 16:33:15 +01:00
aa159c8777 Fix symbol not in math mode 2026-02-10 09:25:18 +01:00
f46373d061 Add exercises 1 and 2 for tutorial 7 2026-02-10 09:23:42 +01:00
000749add1 Fix typos 2026-01-30 13:01:57 +01:00
3fc312ba9d Add gen_histogram.py and finish theory for exercise 2 2026-01-22 13:35:38 +01:00
0716f02766 Add most theory for exercise 2 2026-01-21 17:51:32 +01:00
7b0fbb0262 Add gen_correlated_data.py and finish theory for exercise 1 2026-01-21 16:39:01 +01:00
31b40de191 Add summary slide for theory 1 2026-01-21 10:26:08 +01:00
41294cf3bf Change slide overlays 2026-01-21 10:09:53 +01:00
e8c8f0ed13 Formatting 2026-01-21 09:53:48 +01:00
dfc558ca16 Add solution for exercise 2c 2026-01-21 09:53:26 +01:00
6098da86fa Add solution to exercise 2b 2026-01-20 17:13:02 +01:00
f92ed7d66d Change decimal points to commas 2026-01-20 16:49:19 +01:00
e8781c5ef4 Add solution to exercise 2a 2026-01-20 16:45:49 +01:00
e19254a82f Remove unnecessary text, split title into multiple lines 2026-01-20 15:13:56 +01:00
15ca83ca76 Add solution for exercise 1 2026-01-20 15:09:50 +01:00
a1fb10842d Add exercises 1 and 2 2026-01-20 14:01:54 +01:00
5 changed files with 2795 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import numpy as np
import matplotlib.pyplot as plt
from numpy.typing import NDArray
import argparse
def twodim_array_to_pgfplots_table_string(a: NDArray):
return (
" \\\\\n".join([" ".join([str(vali) for vali in val]) for val in a]) + "\\\\\n"
)
def main():
# Parse command line arguments
parser = argparse.ArgumentParser()
parser.add_argument("--correlation", "-c", type=np.float32, required=True)
parser.add_argument("-N", type=np.int32, required=True)
parser.add_argument("--plot", "-p", action="store_true")
args = parser.parse_args()
# Generate & plot data
means = np.array([0, 0])
cov = np.array([[1, args.correlation], [args.correlation, 1]])
x = np.random.multivariate_normal(means, cov, size=args.N)
print(twodim_array_to_pgfplots_table_string(x))
if args.plot:
plt.scatter(x[:, 0], x[:, 1])
plt.show()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,40 @@
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import binom
def array_to_pgfplots_table_string(a):
return " ".join([f"({k}, {val})" for (k, val) in enumerate(a)]) + f" ({len(a)}, 0)"
def P_binom(N, p, k):
return binom(N, k) * p**k * (1 - p) ** (N - k)
def main():
# Parse command line arguments
parser = argparse.ArgumentParser()
parser.add_argument("-N", type=np.int32, required=True)
parser.add_argument("-p", type=np.float32, required=True)
parser.add_argument("--show", "-s", action="store_true")
args = parser.parse_args()
# Generate and show data
N = args.N
p = args.p
bars = np.array([P_binom(N, p, k) for k in range(N + 1)])
print(array_to_pgfplots_table_string(bars))
if args.show:
plt.stem(bars)
plt.show()
if __name__ == "__main__":
main()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.