Skip to content

Commit

Permalink
mcmc test
Browse files Browse the repository at this point in the history
  • Loading branch information
Farrmol committed Oct 18, 2024
1 parent ddd6820 commit 4d14d01
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions mcmc_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import numpy as np

import orbitize
from orbitize import driver
import multiprocessing as mp

filename = "{}/GJ504.csv".format(orbitize.DATADIR)

# system parameters
num_secondary_bodies = 1
total_mass = 1.75 # [Msol]
plx = 51.44 # [mas]
mass_err = 0.05 # [Msol]
plx_err = 0.12 # [mas]

# MCMC parameters
num_temps = 5
num_walkers = 20
num_threads = 2 # or a different number if you prefer, mp.cpu_count() for example


my_driver = driver.Driver(
filename,
"MCMC",
num_secondary_bodies,
total_mass,
plx,
mass_err=mass_err,
plx_err=plx_err,
mcmc_kwargs={
"num_temps": num_temps,
"num_walkers": num_walkers,
"num_threads": num_threads,
},
)
total_orbits = 6000 # number of steps x number of walkers (at lowest temperature)
burn_steps = 10 # steps to burn in per walker
thin = 2 # only save every 2nd step

my_driver.sampler.run_sampler(total_orbits, burn_steps=burn_steps, thin=thin)

0 comments on commit 4d14d01

Please sign in to comment.