|
12 | 12 |
|
13 | 13 | # Number of samples to be generated
|
14 | 14 | N = 10000
|
15 |
| -saveplot = False |
16 |
| -showplot = True |
| 15 | +saveplot = True |
| 16 | +showplot = False |
17 | 17 |
|
18 | 18 | if not os.path.exists('./examples') and saveplot:
|
19 | 19 | os.makedirs('./examples')
|
|
65 | 65 | lm = kllr_model(kernel_type = 'gaussian', kernel_width = 0.2)
|
66 | 66 |
|
67 | 67 | # Compute regression parameters
|
68 |
| -x, y_exp, intercept_exp, slope_exp, scatter_exp = lm.fit(df['x'], df['y1'], xrange=[2, 8], nbins=11) |
| 68 | +x, y_exp, intercept_exp, slope_exp, scatter_exp, _, _ = lm.fit(df['x'], df['y1'], xrange=[2, 8], bins=11) |
69 | 69 |
|
70 | 70 | # Generate and save fiducial analyses plots
|
71 |
| -data, ax = Plot_Fit(df, 'x', 'y1', show_data=True, kernel_width = 0.4) |
72 |
| -data, ax = Plot_Fit(df, 'x', 'y2', show_data=True, kernel_width = 0.4, ax = ax) |
| 71 | +data, ax = Plot_Fit_Summary(df, 'x', 'y1', show_data=True, kernel_width = 0.4) |
| 72 | +data, ax = Plot_Fit_Summary(df, 'x', 'y2', show_data=True, kernel_width = 0.4, ax = ax) |
73 | 73 | if saveplot: plt.savefig("./examples/Fit.pdf", bbox_inches='tight')
|
74 | 74 |
|
75 |
| -data, ax = Plot_Fit_Split(df, 'x', 'y1', 'y3', split_mode = 'Residuals', split_bins=3, kernel_width = 0.4) |
| 75 | +data, ax = Plot_Fit_Summary_Split(df, 'x', 'y1', 'y3', split_mode = 'Residuals', split_bins=3, kernel_width = 0.4) |
76 | 76 | if saveplot: plt.savefig("./examples/Fit_split.pdf", bbox_inches='tight')
|
77 | 77 |
|
78 |
| -data, ax = Plot_Fit_Params(df, 'x', 'y1', xlog=False, kernel_width = 0.4) |
79 |
| -data, ax = Plot_Fit_Params(df, 'x', 'y2', xlog=False, kernel_width = 0.4, ax=ax) |
80 |
| -data, ax = Plot_Fit_Params(df, 'x', 'y3', xlog=False, kernel_width = 0.4, ax=ax) |
81 |
| -if saveplot: plt.savefig("./examples/Fit_Params.pdf", bbox_inches='tight') |
82 |
| - |
83 |
| -data, ax = Plot_Fit_Params_Split(df, 'x', 'y1', 'y3', split_bins = 2, split_mode = 'Residuals', kernel_width = 0.4) |
84 |
| -if saveplot: plt.savefig("./examples/Fit_Params_Split.pdf", bbox_inches='tight') |
85 |
| - |
86 | 78 | ax = Plot_Cov_Corr_Matrix(df, 'x', ['y1', 'y2', 'y3'], Output_mode = 'corr', kernel_width = 0.4)
|
87 | 79 | if saveplot: plt.savefig("./examples/Corr_Matrix.pdf", bbox_inches='tight')
|
88 | 80 |
|
|
0 commit comments