Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UltraNest fitting method added to example_16 #145

Merged
merged 21 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
293c481
Implemented UltraNest to example_16, double checked until run_fit()
rapoliveira Aug 20, 2024
294a31a
Finished parsing fitting_parameters for UltraNest
rapoliveira Aug 21, 2024
fbb5885
Removed repeated check of self._fit_constraints, minor changes in des…
rapoliveira Aug 21, 2024
9e9b14e
Checked entire code for changes, only missing parse UltraNest results
rapoliveira Aug 22, 2024
2e29836
Replaced _un to _UltraNest, started to parse results
rapoliveira Aug 22, 2024
b590824
Finished parse_results for UltraNest, still make a separate YAML file
rapoliveira Aug 22, 2024
5e31f20
Added separate YAML file for UltraNest
rapoliveira Aug 22, 2024
d63d644
Minor corrections to UltraNest parsing
rapoliveira Aug 23, 2024
f351096
Last changes before PR, added parameters to UltraNest, yaml files
rapoliveira Aug 26, 2024
a05311e
Minor changes before pull request
rapoliveira Aug 26, 2024
cd3d78b
Minor corrections to comments in yaml files
rapoliveira Aug 27, 2024
74d944b
ex16 - UltraNest, adding Radek comments 1 to 5
rapoliveira Sep 9, 2024
38372d4
ex16 - UltraNest, added Radek comments, except 8
rapoliveira Sep 9, 2024
315b0d9
ex16: param -> parameters
rpoleski Sep 15, 2024
b489b2b
ex16 - version update
rpoleski Sep 15, 2024
3f5b367
Added UltraNest to make transform in same function as MultiNest
rapoliveira Sep 16, 2024
31e2cfb
Added prior in blending_flux and t_E for UltraNest
rapoliveira Sep 17, 2024
d0376cf
Declare _parse_posterior_abs when posterior parsing is not used
rapoliveira Sep 17, 2024
adad769
Added check of derived parameter names for UltraNest
rapoliveira Sep 17, 2024
1a211e5
Minor changes to full YAML file, removed _n_walkers=None
rapoliveira Sep 17, 2024
d45acf2
ex16 - minor
rpoleski Sep 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions examples/example_16/ob03235_2_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ photometry_files:
# - {file_name: some_K2_data.txt, phot_fmt: flux, bandpass: 'Kp', ephemerides_file: K2_ephemeris_01.dat}
# For files with time starting with 245...:
# - {..., add_2450000: False}
fit_method: EMCEE
# Options: EMCEE, MultiNest, UltraNest.
# If fit_method is not given, EMCEE is used if starting_parameters are given;
# and MultiNest or UltraNest is used if prior_limits are given, depending on
# the combination of fitting_parameters.
# If MultiNest/UltraNest is used, this file cannot have starting_parameters,
# fit_constraints (except negative_blending_flux_sigma_mag and prior->t_E for
# UltraNest), min_values, max_values and plots->trace.
model:
methods: 2452800. point_source 2452833. VBBL 2452845. point_source 2452860.
default method: point_source_point_lens
Expand Down Expand Up @@ -36,6 +44,17 @@ starting_parameters:
# file: ob08092-o4_starting_file_input.txt
# parameters: t_0 u_0 t_E
# See also ob08092-o4_starting_file.yaml
# prior_limits:
# t_0: [2452847.5, 2452848.5]
# u_0: [0.08, 0.18]
# t_E: 58.7 64.7
# rho: [0.0004, 0.0018]
# pi_E_N: [-0.05, 0.05]
# pi_E_E: [-0.05, 0.05]
# s: [1.077, 1.125]
# q: [0.001, 0.02]
# alpha: [219.4, 229.4]
# # Only MultiNest and UltraNest, cannot be given with starting_parameters
fit_constraints:
negative_blending_flux_sigma_mag: 20.
#one can specify for which dataset soft constrain on blending flux should be applied: sigma dataset_label(s)
Expand Down Expand Up @@ -76,12 +95,27 @@ max_values:
s: 2.
alpha: 360.
fitting_parameters:
## EMCEE only
n_walkers: 20
n_steps: 4
n_burn: 2
progress: True
posterior file: ob03235_2_models.npy
posterior file fluxes: all
## MultiNest only (basename, multimodal, evidence tolerance=0.5)
# basename: out_ob08092_O4_MN-
# multimodal: True
# evidence tolerance: 0.5
## UltraNest only (log directory, derived parameter names, show_status,
## dlogz=0.5, frac_remain=0.01, max_num_improvement_loops=-1)
# log directory: ultranest_outputs/
# derived parameter names: flux_s_1 flux_b_1 flux_s_2 flux_b_2
# show_status: True
# dlogz: 2.
# frac_remain: 0.5
# max_num_improvement_loops: 0
## Both for MultiNest and UltraNest (number of live points)
# n_live_points: 20
plots:
best model:
# You can skip the line below - the light curve will be plotted on screen.
Expand Down
8 changes: 6 additions & 2 deletions examples/example_16/ob08092-o4_MN.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
photometry_files:
data/OB08092/phot_ob08092_O4.dat
fit_method: MultiNest
prior_limits:
t_0: [2455379.4, 2455379.76]
u_0: [0.3, 0.65]
t_E: 16. 19.6
fitting_parameters:
basename: out_ob08092_O4_MN-
multimodal: True
# Default settings of other parameters:
# evidence tolerance: 0.5
n_live_points: 1000
# Default settings of other parameters:
# evidence tolerance: 0.5
plots:
best model:
file: out_ob08092_O4_MN_model.png
triangle:
file: out_ob08092_O4_MN_triangle.png
other_output:
yaml output:
file name: ob08092_O4_MN_all_results.yaml
35 changes: 35 additions & 0 deletions examples/example_16/ob08092-o4_UN.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
photometry_files:
data/OB08092/phot_ob08092_O4.dat
fit_method: UltraNest
prior_limits:
t_0: [2455379.4, 2455379.76]
u_0: [0.3, 0.65]
t_E: 16. 19.6
fit_constraints:
negative_blending_flux_sigma_mag: 20.
prior:
t_E: Mroz et al. 2020
fitting_parameters:
log directory: outputs_ultranest/
derived parameter names: flux_s_1 flux_b_1
show_status: True
n_live_points: 1000
# `n_live_points` can also be named `min_num_live_points`
# If it is smaller than 40, `cluster_num_live_points` is also reduced.
# UltraNest may increase n_live_points if it is too low to achieve the
# logz accuracy (default=0.5). It can be avoided increasing dlogz:
dlogz: 2.
# The parameters below can reduce runtime (default is 0.01 and -1)
# frac_remain: 0.5
# max_num_improvement_loops: 0
plots:
best model:
file: out_ob08092_O4_UN_model.png
second Y scale:
magnifications: optimal
triangle:
file: out_ob08092_O4_UN_triangle.png
shift t_0: False
other_output:
yaml output:
file name: ob08092_O4_UN_all_results.yaml
2 changes: 2 additions & 0 deletions examples/example_16/ob08092-o4_minimal_MN.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
photometry_files:
data/OB08092/phot_ob08092_O4.dat
fit_method: MultiNest
# fit_method options if prior_limits are given: MultiNest and UltraNest
prior_limits:
t_0: [2455379.4, 2455379.76]
u_0: [0.46, 0.65]
Expand Down
Loading
Loading