Anatomy of a study

In kipe, a study is a parameter estimation problem defined by a study file. It specifies the forward model, parameters and priors, measurement settings and data paths, and Kalman filter settings. Data can be measured or synthesized, and synthesized data can include multiple independent noise realizations.

For instance, using a single study file, twin experiments can be conducted:

kipe synthesis study.yaml                # generates noisy data from known parameters
kipe estimation study.yaml               # recovers them from an inaccurate prior using ROUKF
kipe plot-estimation study.yaml --truth  # compares estimates with the true parameters

synthesis writes data to the measurements’ data.path; estimation writes results to output.path.

        flowchart TB
    study[/"study.yaml"/] --> synthesis["kipe synthesis"]
    synthesis --> data[/"data files (data.path)"/]
    measured[/"measured data"/] -.-> data
    study --> estimation["kipe estimation"]
    data --> estimation
    estimation --> results[/"estimates & uncertainties (output.path)"/]
    

Measurements explains how kipe compares the model with measured data, while Architecture describes the data flow and code structure for readers who want to extend kipe.

The study file

The FitzHugh–Nagumo example (kipe.examples.fitzhugh_nagumo) has all the sections of a study file:

# yaml-language-server: $schema=../study.schema.json
# FitzHugh-Nagumo twin experiment. Run from this directory:
#   kipe synthesis study.yaml  # generates data/v.npz, data/w.npz with the nominal parameters
#   kipe estimation study.yaml  # estimates a, b, c from them, starting from a wrong guess
#   kipe sensitivity study.yaml  # the Cramér-Rao bounds of a, b, c at the true parameters
output:
  path: results
  log_level: info

forward_solver:
  factory: kipe.examples.fitzhugh_nagumo:Solver
  arguments: {dt: 0.05}  # nominal parameter values in solver: a = 0.2, b = 0.2, c = 3

parameters:
  reparameterization: log
  priors:
    a: {mean: 0.3, relative_stddev: 0.1}
    b: {mean: 0.3, relative_stddev: 0.1}
    c: {mean: 2.0, relative_stddev: 0.1}

measurements:  # each at its own times: w less often, in between those of v
  v:
    fields: [v]
    times: {start: 0.5, stop: 20.0, step: 0.5}
    data: {type: numpy, path: data/v.npz}
    noise: {stddev: 0.01, seed: 0}
  w:
    fields: [w]
    times: {start: 0.75, stop: 20.0, step: 1.0}
    data: {type: numpy, path: data/w.npz}
    noise: {stddev: 0.01, seed: 1}

synthesis:
  truth: {type: run}  # run the solver with its nominal parameters (the default)

estimation:
  sigma_points: simplex  # shape of the UKF's sigma-point stencil
  iterations: 5  # outer iterations: restart from the previous estimate

# end-of-study-file

Study file lists every option and its default.