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.

  1. Fill out proxy data and age constraint tables according to the data formatting specifications.

  2. 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')
    
  3. Build a pymc.model.core.Model with build_model(sample_data, age_data, proxies = ['proxy'])

    from stratmc.model import build_model
    
    model, gp = build_model(sample_data, age_data, proxies = ['d13c'])
    
  4. Sample the model posterior using a JAX-assisted MCMC sampling algorithm with get_trace(model, gp, ages).

    import pymc as pm
    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)
    
  5. Plot and analyze the results with the stratmc.plotting library.

    from stratmc import plotting
    
    plotting.proxy_inference(sample_data, age_data, trace)
    

    (Source code, png, hires.png, pdf)

    _images/quickstart-1.png