Skip to content

Commit bf6f3b6

Browse files
committed
rejection sampling
1 parent f87929e commit bf6f3b6

File tree

3 files changed

+616
-9
lines changed

3 files changed

+616
-9
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ If you have any suggestions or want to make additions, I would be very happy if
2929

3030
- Linear regression via the least squares fit method [[ IPython nbviewer ](http://nbviewer.ipython.org/github/rasbt/algorithms_in_ipython_notebooks/blob/master/ipython_nbs/statistics/linregr_least_squares_fit.ipynb)]
3131

32-
- Dixon's Q test to identify outliers for small sample sizes [[ IPython nbviewer ](http://nbviewer.ipython.org/github/rasbt/algorithms_in_ipython_notebooks/blob/master/ipython_nbs/statistics/dixon_q_test.ipynb?create=1)]
32+
- Dixon's Q test to identify outliers for small sample sizes [[ IPython nbviewer ](http://nbviewer.ipython.org/github/rasbt/algorithms_in_ipython_notebooks/blob/master/ipython_nbs/statistics/dixon_q_test.ipynb)]
33+
34+
- Rejection sampling [[ IPython nbviewer ](http://nbviewer.ipython.org/github/rasbt/algorithms_in_ipython_notebooks/blob/master/ipython_nbs/statistics/rejection_sampling)]
35+
3336

3437

3538

ipython_nbs/statistics/dixon_q_test.ipynb

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:72ce647875bce795f311cf79fa5121b828fa08e8583099ccfada08c0b0c240dd"
4+
"signature": "sha256:44d2aa8ef5d85aec0081655c5f05c38e8c1b6ee3879de1a46ad0476ef3f11c98"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -19,8 +19,18 @@
1919
"cell_type": "code",
2020
"collapsed": false,
2121
"input": [
22-
"import time\n",
23-
"print('Last updated: %s' %time.strftime('%d/%m/%Y'))"
22+
"%load_ext watermark"
23+
],
24+
"language": "python",
25+
"metadata": {},
26+
"outputs": [],
27+
"prompt_number": 1
28+
},
29+
{
30+
"cell_type": "code",
31+
"collapsed": false,
32+
"input": [
33+
"%watermark -v -d -u"
2434
],
2535
"language": "python",
2636
"metadata": {},
@@ -29,11 +39,21 @@
2939
"output_type": "stream",
3040
"stream": "stdout",
3141
"text": [
32-
"Last updated: 14/06/2014\n"
42+
"Last updated: 18/07/2014 \n",
43+
"\n",
44+
"CPython 3.4.1\n",
45+
"IPython 2.1.0\n"
3346
]
3447
}
3548
],
36-
"prompt_number": 14
49+
"prompt_number": 3
50+
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"<font size=\"1.5em\">[More information](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/ipython_magic/watermark.ipynb) about the `watermark` magic command extension.</font>"
56+
]
3757
},
3858
{
3959
"cell_type": "markdown",
@@ -687,8 +707,6 @@
687707
"assert(dixon_test(test_data2) == [None, None]), 'expect [None, None]'\n",
688708
"assert(dixon_test(test_data2, q_dict=Q90) == [None, 0.542]), 'expect [None, 0.542]'\n",
689709
"\n",
690-
"\n",
691-
"\n",
692710
"print('ok')"
693711
],
694712
"language": "python",
@@ -1109,7 +1127,6 @@
11091127
"source": [
11101128
"A more useful plot in my opinion is Tukey's boxplot<sup> 4</sup>. Boxplots are in facts one of my preferred approaches to quickly and visually indicate outliers in a Gaussian data set. However, also boxplots have to be used with real caution and might also not very informative for small sample sizes.\n",
11111129
"\n",
1112-
"Q1 = Quartile 1\n",
11131130
"\n",
11141131
"\n",
11151132
"<sup> 4</sup> Robert McGill, John W. Tukey and Wayne A. Larsen: \"[The American Statistician](http://www.jstor.org/discover/10.2307/2683468?uid=3739256&uid=2&uid=4&sid=21104147331297)\"\n",

0 commit comments

Comments
 (0)