Skip to content

Commit 21c279f

Browse files
committed
DOC: Fix image rendering on README file and update contents.
1. The distribution plots were not rendered correctly in table format on github. Fixed that by adding extra vertical bars enclosing the image. 2. Used `_bit_generator` instead of `bit_generator` for RandomState in example code. 3. Remove the redundant python version entry in requirements list since NumPy v1.19 supports Python>=3.6, so there requirement is met implicitely by successfully installing 1.19.
1 parent 6ed21b4 commit 21c279f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ from polyagamma import random_polyagamma
5858
# generate a PG(1, 0) sample
5959
o = random_polyagamma()
6060

61-
# Get a 5 by 10 array of PG(1, 2) variates.
62-
o = random_polyagamma(z=2, size=(5, 10))
61+
# Get a 5 by 1 array of PG(1, 2) variates.
62+
o = random_polyagamma(z=2, size=5)
6363

6464
# We can pass sequences as input. Numpy's broadcasting rules apply here.
6565
# Get a 10 by 2 array where column 1 is PG(2, -10) and column 2 is PG(1, 10)
@@ -90,7 +90,7 @@ o = random_polyagamma(random_state=rng)
9090

9191
# If one is using a `numpy.random.RandomState` instance instead of the `Generator`
9292
# class, the object's underlying bitgenerator can be passed as the value of random_state
93-
bit_gen = np.random.RandomState(12345).bit_generator
93+
bit_gen = np.random.RandomState(12345)._bit_generator
9494
o = random_polyagamma(random_state=bit_gen)
9595

9696
# When passing a large input array for the shape parameter `h`, parameter value
@@ -148,7 +148,6 @@ For an example of how to use `polyagamma` in a C program, see [here][1].
148148

149149

150150
## Dependencies
151-
- Python >= 3.6
152151
- Numpy >= 1.19.0
153152

154153

@@ -182,10 +181,10 @@ and `z`, using each method. We restrict `h` to integer values to accomodate the
182181
`devroye` method, which cannot be used for non-integer `h`. The version of the
183182
package used to generate them is `v1.3.1`.
184183

185-
![](./scripts/img/perf_methods_0.0.svg) | ![](./scripts/img/perf_methods_2.5.svg)
184+
|![](./scripts/img/perf_methods_0.0.svg) | ![](./scripts/img/perf_methods_2.5.svg)|
186185
| --- | --- |
187186

188-
![](./scripts/img/perf_methods_5.0.svg) | ![](./scripts/img/perf_methods_10.0.svg)
187+
|![](./scripts/img/perf_methods_5.0.svg) | ![](./scripts/img/perf_methods_10.0.svg)|
189188
| --- | --- |
190189

191190
Generally:
@@ -205,10 +204,10 @@ sampler to the `pgdrawv` functions provided by the package. Below are runtime pl
205204
samples for each value of `h` and `z`. Values of `h` range from 0.1 to 50, while `z` is set
206205
to 0, 2.5, 5, and 10.
207206

208-
![](./scripts/img/perf_samplers_0.0.svg) | ![](./scripts/img/perf_samplers_2.5.svg)
207+
|![](./scripts/img/perf_samplers_0.0.svg) | ![](./scripts/img/perf_samplers_2.5.svg)|
209208
| --- | --- |
210209

211-
![](./scripts/img/perf_samplers_5.0.svg) | ![](./scripts/img/perf_samplers_10.0.svg)
210+
|![](./scripts/img/perf_samplers_5.0.svg) | ![](./scripts/img/perf_samplers_10.0.svg)|
212211
| --- | --- |
213212

214213
It can be seen that when generating many samples at once for any given combination of
@@ -239,12 +238,12 @@ is ran on.
239238
## Distribution Plots
240239
Below is a visualization of the Cumulative distribution and density functions for
241240
various values of the parameters.
242-
![](./scripts/img/pdf.svg) | ![](./scripts/img/cdf.svg)
241+
|![](./scripts/img/pdf.svg) | ![](./scripts/img/cdf.svg)|
243242
| --- | --- |
244243

245244
We can compare these plots to the Kernel density estimate and empirical CDF plots
246245
generated from 20000 random samples using each of the available methods.
247-
![](./scripts/img/kde.svg) | ![](./scripts/img/ecdf.svg)
246+
|![](./scripts/img/kde.svg) | ![](./scripts/img/ecdf.svg)|
248247
| --- | --- |
249248

250249

0 commit comments

Comments
 (0)