Quick start guide#
Here, we provide a basic example of importing data and running the inference model. More complex examples are available on the example notebooks page.
Fill out
proxy dataandage constrainttables according to the data formatting specifications.Pre-process your data for model construction with
load_data()from stratmc.data import load_data sample_data, age_data = load_data('path_to_proxy_data.csv', 'path_to_age_data.csv')
Build a
pymc.model.core.Modelwithbuild_model(sample_data, age_data, proxies = ['proxy'])from stratmc.model import build_model model, gp = build_model(sample_data, age_data, proxies = ['d13c'])
Sample the model posterior using a JAX-assisted MCMC sampling algorithm with
get_trace(model, gp, ages, sample_data, age_data).from stratmc.inference import get_trace # array of ages at which to sample the posterior proxy curve predict_ages = np.linspace(lower_age, upper_age, number_ages) trace = get_trace(model, gp, predict_ages, sample_data, age_data)
Plot and analyze the results with the
stratmc.plottinglibrary.from stratmc import plotting plotting.proxy_inference(sample_data, age_data, trace)
(
Source code,png,hires.png,pdf)