|
1003 | 1003 | }
|
1004 | 1004 | ],
|
1005 | 1005 | "source": [
|
1006 |
| - "rng = np.random.default_rng()\n", |
1007 |
| - "\n", |
1008 |
| - "a = rng.normal(loc=0, scale=1, size=1_000)\n", |
| 1006 | + "a = np.random.normal(loc=0, scale=1, size=1_000)\n", |
1009 | 1007 | "\n",
|
1010 | 1008 | "fig, ax = plt.subplots(figsize=(8, 6))\n",
|
1011 | 1009 | "ax.hist(a, color=\"C0\", bins=15)\n",
|
|
1025 | 1023 | },
|
1026 | 1024 | {
|
1027 | 1025 | "cell_type": "code",
|
1028 |
| - "execution_count": 24, |
| 1026 | + "execution_count": 57, |
1029 | 1027 | "metadata": {
|
1030 | 1028 | "pycharm": {
|
1031 | 1029 | "name": "#%%\n"
|
|
1035 | 1033 | {
|
1036 | 1034 | "data": {
|
1037 | 1035 | "text/plain": [
|
1038 |
| - "aesara.tensor.var.TensorVariable" |
| 1036 | + "TensorType(float64, ())" |
1039 | 1037 | ]
|
1040 | 1038 | },
|
1041 |
| - "execution_count": 24, |
| 1039 | + "execution_count": 57, |
1042 | 1040 | "metadata": {},
|
1043 | 1041 | "output_type": "execute_result"
|
1044 | 1042 | }
|
1045 | 1043 | ],
|
1046 | 1044 | "source": [
|
1047 | 1045 | "y = at.random.normal(loc=0, scale=1, name=\"y\")\n",
|
1048 |
| - "type(y)" |
| 1046 | + "y.type" |
1049 | 1047 | ]
|
1050 | 1048 | },
|
1051 | 1049 | {
|
|
1436 | 1434 | }
|
1437 | 1435 | },
|
1438 | 1436 | "source": [
|
1439 |
| - "We are just creating random variables like we saw before, but now registering them in a PyMC model. To extract the list of random variables we can simply do:" |
| 1437 | + "We are just creating random variables like we saw before, but now registering them in a `pymc` model. To extract the list of random variables we can simply do:" |
1440 | 1438 | ]
|
1441 | 1439 | },
|
1442 | 1440 | {
|
|
1673 | 1671 | }
|
1674 | 1672 | },
|
1675 | 1673 | "source": [
|
1676 |
| - "PyMC is able to convert `RandomVariable`s to their respective probability functions. One simple way is to use {func}`~pm.distributions.logprob.logp`, which takes as first input a RandomVariable, and as second input the value at which the logp is evaluated (we will discuss this in more detail later)." |
| 1674 | + "`pymc` is able to convert `RandomVariable`s to their respective probability functions. One simple way is to use {func}`~pymc.distributions.logprob.logp`, which takes as first input a RandomVariable, and as second input the value at which the logp is evaluated (we will discuss this in more detail later)." |
1677 | 1675 | ]
|
1678 | 1676 | },
|
1679 | 1677 | {
|
|
1765 | 1763 | },
|
1766 | 1764 | "source": [
|
1767 | 1765 | ":::{tip}\n",
|
1768 |
| - "There is also a handy PyMC function to compute the log cumulative probability of a random variable {func}`~pm.distributions.logprob.logcdf`." |
| 1766 | + "There is also a handy `pymc` function to compute the log cumulative probability of a random variable {func}`~pymc.distributions.logprob.logcdf`." |
1769 | 1767 | ]
|
1770 | 1768 | },
|
1771 | 1769 | {
|
|
1846 | 1844 | }
|
1847 | 1845 | },
|
1848 | 1846 | "source": [
|
1849 |
| - "PyMC Models provide some helpful routines to facilitating the conversion of `RandomVariable`s to probability functions. {meth}`~pymc.Model.logpt`, for instance can be used to extract the joint probability of all variables in the model:" |
| 1847 | + "`pymc` models provide some helpful routines to facilitating the conversion of `RandomVariable`s to probability functions. {meth}`~pymc.Model.logpt`, for instance can be used to extract the joint probability of all variables in the model:" |
1850 | 1848 | ]
|
1851 | 1849 | },
|
1852 | 1850 | {
|
|
0 commit comments