*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit f98824d9 authored by Patrick Kappl's avatar Patrick Kappl
Browse files

Add comments to main.py

parent d93ffcd5
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,8 @@ def f(x):
return 1 / x
#%%
# Generate a list of n normal distributed x-values and apply f() on each
# x-value to obtain the list of y-values.
n = 100
mu = 2
sigma = 1
......@@ -22,6 +24,8 @@ y_list = [f(x) for x in x_list]
y_generator = jackknife.get_sample_generator(y_list)
#%%
# Do a Jackknife estimation with the x-values and f() and print the
# results
output = jackknife.do_jackknife_estimation(x_generator, f)
x_mean = sum(i for i in x_list) / n
print("{}{}".format("f(mean(x)) = ", f(x_mean)))
......@@ -30,6 +34,9 @@ print("{}{}".format("variance(y') = ", output[1]))
print("{}{}".format("standard deviation(y') = ", output[2]))
#%%
# Do a Jackknife estimation with the y-values and the identity function
# and print the results. This means that statistics are done on a
# transformed sample set y, that is not bias corrected.
output = jackknife.do_jackknife_estimation(y_generator, lambda x: x)
print("{}{}".format("mean(y) = ", output[0]))
print("{}{}".format("variance(y) = ", output[1]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment