|
1949 | 1949 | " )\n",
|
1950 | 1950 | "\n",
|
1951 | 1951 | "# plot hogg outlier posterior distribution\n",
|
1952 |
| - "gd.ax.plot(\n", |
1953 |
| - " x,\n", |
1954 |
| - " subsample_helper(trc_hogg.posterior[\"outlier_mean\"], 400),\n", |
1955 |
| - " color=\"C3\",\n", |
1956 |
| - " linewidth=0.5,\n", |
1957 |
| - " alpha=0.2,\n", |
1958 |
| - " zorder=1,\n", |
1959 |
| - ")\n", |
| 1952 | + "outlier_mean = subsample_helper(trc_hogg.posterior[\"outlier_mean\"], 400)\n", |
| 1953 | + "gd.ax.plot(x, outlier_mean, color=\"C3\", linewidth=0.5, alpha=0.2, zorder=1)\n", |
1960 | 1954 | "\n",
|
1961 | 1955 | "# plot the 3 model (inlier) posterior distributions\n",
|
1962 | 1956 | "y_mean = subsample_helper(trc_ols.posterior[\"y_mean\"], 200)\n",
|
1963 | 1957 | "gd.ax.plot(x, y_mean, color=\"C0\", linewidth=0.5, alpha=0.2, zorder=2)\n",
|
1964 | 1958 | "\n",
|
1965 | 1959 | "y_mean = subsample_helper(trc_studentt.posterior[\"y_mean\"], 200)\n",
|
1966 |
| - "gd.ax.plot(\n", |
1967 |
| - " x,\n", |
1968 |
| - " y_mean,\n", |
1969 |
| - " color=\"C1\",\n", |
1970 |
| - " linewidth=0.5,\n", |
1971 |
| - " alpha=0.2,\n", |
1972 |
| - " zorder=3,\n", |
1973 |
| - ")\n", |
| 1960 | + "gd.ax.plot(x, y_mean, color=\"C1\", linewidth=0.5, alpha=0.2, zorder=3)\n", |
1974 | 1961 | "\n",
|
1975 | 1962 | "y_mean = subsample_helper(trc_hogg.posterior[\"y_mean\"], 200)\n",
|
1976 |
| - "gd.ax.plot(\n", |
1977 |
| - " x,\n", |
1978 |
| - " y_mean,\n", |
1979 |
| - " color=\"C2\",\n", |
1980 |
| - " linewidth=0.5,\n", |
1981 |
| - " alpha=0.2,\n", |
1982 |
| - " zorder=4,\n", |
1983 |
| - ")\n", |
| 1963 | + "gd.ax.plot(x, y_mean, color=\"C2\", linewidth=0.5, alpha=0.2, zorder=4)\n", |
1984 | 1964 | "\n",
|
1985 | 1965 | "# add legend for regression lines plotted above\n",
|
1986 | 1966 | "line_legend = plt.legend(\n",
|
|
0 commit comments