Study file
Editor support
kipe schema prints the JSON schema of the study file. With it, an editor completes the keys,
shows their documentation and marks invalid options while you type:
kipe schema > study.schema.json
and as the first line of the study file:
# yaml-language-server: $schema=study.schema.json
This works in editors that use the YAML language server, e.g., VS Code with Red Hat’s YAML
extension, or Neovim and Helix with yaml-language-server. The path is relative to the study
file. The schema belongs to the installed kipe version: generate it again after an update.
The example study files have this line already, with the schema in examples/.
Overview
All keys of a study file: first as an overview, a commented study file, then section by
section, each key with its type, its default (or whether it is required) and what it does.
<name> stands for a name you choose, e.g., of a measurement. Anatomy of a study and
Measurements explain how the keys work together.
This page is generated from the study file’s options (kipe.options), so it describes
exactly what kipe accepts. Unknown keys are an error.
output: # required
path: <string> # required
log_level: info # debug | info | warning | error
forward_solver: # required
factory: <string> # required
arguments: <mapping> # optional
parameters:
reparameterization: <log | multiplicative | additive> # required
priors: # required
<name>: # a parameter of the solver
mean: <number> # required
relative_stddev: <number > 0> # optional
stddev: <number > 0> # optional
reparameterization: <log | multiplicative | additive> # optional
measurements:
<name>: # a name you choose
fields: <list of strings (at least 1)> # required
data: # required
type: numpy
path: <string> # required
noise: # required
stddev: <number > 0 or list of number > 0 (at least 1)> # required
seed: <integer ≥ 0> # optional
times: <list of numbers or {start, stop, step}> # optional
spatial_sampling: # one of, by type
type: array # the default
# or:
# type: fenicsx.mesh
# mesh: <string> # required
# mesh_name: mesh
# element: P1 # P1 | DG0
# projection: <list of numbers (at least 1) or surface_normal> # optional
# padding: 0.0
# or:
# type: fenicsx.points
# points: <list of lists of numbers (at least 1)> # required
# or:
# type: fenicsx.displaced_vertices
# tags: <list of integers (at least 1)> # required
# combine: <union | intersection> # required
model: # one of, by type
type: difference # the default
# or:
# type: plane
# normal_toward: <[number, number, number] (at least 3)> # optional
synthesis:
truth: # one of, by type
type: run # the default
# or:
# type: checkpoints
# path: <string> # required
# or:
# type: data
# path: <string> # required
noise:
<name>: # one of the measurements
stddev: <number ≥ 0 or list of number ≥ 0 (at least 1)> # required
realizations: 1
estimation:
sigma_points: simplex # simplex | canonical | unique
iterations: 1
sensitivity:
step: 0.01
output
Output location and logging.
key |
type |
default |
description |
|---|---|---|---|
string |
required |
Directory for all results. Subcommands write into subdirectories. |
|
|
|
Minimum level of the log messages kipe writes. |
forward_solver
Construction of the forward solver.
key |
type |
default |
description |
|---|---|---|---|
string |
required |
Import path of the factory, |
|
mapping |
optional |
Keyword arguments passed to the factory, as given (no path resolution). |
parameters
Estimated parameters.
key |
type |
default |
description |
|---|---|---|---|
|
required |
How the estimated parameter \(\theta\) relates to the physical value \(\phi\),
relative to the prior mean \(\phi_0\).
Default for all parameters in Available reparameterizations:
|
|
mapping: name → section, see below |
required |
Estimated parameters: parameter name -> prior (mean and standard deviation). All other parameters keep their nominal values. |
parameters.priors
Estimated parameters: parameter name -> prior (mean and standard deviation). All other parameters keep their nominal values.
Each parameters.priors.<name>, where <name> is a parameter of the solver:
key |
type |
default |
description |
|---|---|---|---|
number |
required |
Prior mean, as physical value: where the estimation starts. |
|
number > 0 |
optional |
Standard deviation relative to the The standard deviation of \(\theta\) is \(\sigma_\theta\) = |
|
number > 0 |
optional |
Absolute standard deviation, in the parameter’s physical unit. For |
|
|
optional |
The distribution of this prior: Gaussian in \(\theta\), i.e., log-normal in the
parameter for |
measurements
Measurements: name -> measurement. The names appear in logs, output and errors.
Each measurements.<name>, where <name> is a name you choose:
key |
type |
default |
description |
|---|---|---|---|
list of strings (at least 1) |
required |
State fields the measurement observes. |
|
section, see below |
required |
Where the measured data are: read by |
|
section, see below |
required |
Measurement noise. |
|
list of numbers or {start, stop, step}, see below |
optional |
Measurement times: a list or a range. Required by |
|
one of, by |
optional |
How the observed fields are brought to the measurement locations; the kind is selected
by |
|
one of, by |
optional |
How predicted data are computed from the sampled fields and compared with the data. |
measurements.<name>.data
Where the measured data are: read by estimation, written by synthesis.
key |
type |
default |
description |
|---|---|---|---|
|
required |
Data format. |
|
string |
required |
Path to the |
measurements.<name>.noise
Measurement noise.
key |
type |
default |
description |
|---|---|---|---|
number > 0 or list of number > 0 (at least 1) |
required |
Independent noise standard deviations: one scalar for all data entries, or a list with one positive value per entry, in the data’s global order and units. |
|
integer ≥ 0 |
optional |
Seed of the noise added by |
measurements.<name>.times
Measurement times: a list or a range. Required by synthesis (the times to
generate); for estimation a selection from the times in the data, all if not
given.
key |
type |
default |
description |
|---|---|---|---|
number |
required |
First time. |
|
number |
required |
Last time, included (up to round-off). |
|
number > 0 |
required |
Distance between successive times. |
measurements.<name>.spatial_sampling
How the observed fields are brought to the measurement locations; the kind is selected
by type, array by default.
type: array (the default)
Sample all entries of the observed fields, concatenated in the order of fields.
type: fenicsx.mesh
Interpolate the observed field onto a measurement mesh (FEniCSx backend).
The field must be a distributed field whose function space the forward solver provides
(kipe.fenicsx.forward_solver.SupportsFunctionSpaces). The measurement mesh need
not match the solver’s mesh. The data are in the order of the mesh file: by vertex for
P1, by cell for DG0, independent of the number of ranks; for a vector field without
projection, the components of each vertex or cell one after another.
key |
type |
default |
description |
|---|---|---|---|
string |
required |
Path to the measurement mesh, an XDMF file. |
|
string |
|
Name of the mesh in the XDMF file (its grid): |
|
|
|
Finite element on the measurement mesh: vertex values ( |
|
list of numbers (at least 1) or |
optional |
What is measured of a vector field; all components if not given. A direction, e.g.,
|
|
number ≥ 0 |
|
Distance, in mesh units, by which a measurement point may lie outside the solver’s mesh, e.g., where a surface mesh cuts slightly across the solver’s boundary. Such a point takes the value of the field in the nearest cell, extrapolated; a point farther out is an error. |
type: fenicsx.points
Evaluate the observed field at given points (FEniCSx backend).
The field must be a distributed field whose function space the forward solver provides
(kipe.fenicsx.forward_solver.SupportsFunctionSpaces). The data are in the order of
points; for a vector field, the components of each point one after another.
key |
type |
default |
description |
|---|---|---|---|
list of lists of numbers (at least 1) |
required |
Coordinates of the measurement points, one list per point, e.g., |
type: fenicsx.displaced_vertices
Return displaced vertices of tagged mesh facets (FEniCSx backend).
The observed field is a displacement vector with one component per spatial dimension. The mesh and facet tags are provided by the forward solver for the observed field. Vertices are ordered by their original geometry input indices.
key |
type |
default |
description |
|---|---|---|---|
list of integers (at least 1) |
required |
Tag IDs of the mesh facets whose vertices are selected. Cell tags are not supported. |
|
|
required |
|
measurements.<name>.model
How predicted data are computed from the sampled fields and compared with the data.
type: difference (the default)
Measured data are the sampled fields; innovation = measured - predicted.
type: plane (the default)
Fit z = a*x + b*y + c to sampled 3D vertices by orthogonal least squares.
The sampler must return flattened vertex coordinates, with x, y and z together for each
vertex. Predicted and measured data are the three coefficients, ordered [a, b, c].
The innovation is measured minus predicted coefficients.
key |
type |
default |
description |
|---|---|---|---|
[number, number, number] (at least 3) |
optional |
Optional reference point toward which the first fitted normal is oriented. Coordinates use the mesh’s coordinate system and units. The point must lie off the
first plane. Later normals align with the first normal, whether or not a point was
provided. This affects the exposed normal, not the predicted |
synthesis
Generation of synthetic measurement data.
key |
type |
default |
description |
|---|---|---|---|
one of, by |
optional |
Source of the true state the data are generated from: a run of the forward solver, its
checkpoints, or given data. From a run or checkpoints, synthesis also writes the noise-free
data, to |
|
mapping: name → section, see below |
optional |
Noise synthesis adds to the data of the listed measurements (measurement name ->
noise), instead of their |
|
integer > 0 |
|
Number of noise realizations, e.g., for the statistics of the estimates over the noise.
Synthesis computes the true state once and writes the data of realizations
\(r = 0, \dots, n - 1\), each to the |
synthesis.truth
Source of the true state the data are generated from: a run of the forward solver, its
checkpoints, or given data. From a run or checkpoints, synthesis also writes the noise-free
data, to <output.path>/synthesis/noise_free/<measurement>.npz.
type: run (the default)
Generate the data by running the forward solver with its nominal parameters.
type: checkpoints
Generate the data from the checkpoints of an earlier run of the forward solver.
The solver reads the true states at the measurement times from the checkpoints at
path; it needs kipe.forward_solver.SupportsCheckpoints. The run may differ
from the model of the forward_solver section (e.g., in its time step or parameters), as
long as the solver can read its checkpoints into the model’s state.
key |
type |
default |
description |
|---|---|---|---|
string |
required |
Location of the checkpoints, as the solver understands it (e.g., the output directory of the run). |
type: data
Generate the data from given true data, read from files, with noise added.
E.g., the noise-free data of an earlier synthesis (in <output.path>/synthesis/
noise_free/), for other noise levels, seeds or realizations without running the solver
again; or measured data, to test the estimation with more noise. A measurement’s times
select from the file’s times; without times, all of them are used. The forward solver is
built, for the layout of the measurements, but not run.
key |
type |
default |
description |
|---|---|---|---|
string |
required |
Path to the true data of each measurement, an |
synthesis.noise
Noise synthesis adds to the data of the listed measurements (measurement name ->
noise), instead of their noise.stddev, which estimation assumes: for noise-free data
(stddev: 0) or studies with misspecified noise. Measurements not listed get their
noise.stddev.
Each synthesis.noise.<name>, where <name> is one of the measurements:
key |
type |
default |
description |
|---|---|---|---|
number ≥ 0 or list of number ≥ 0 (at least 1) |
required |
Added independent noise: a scalar or one value per data entry; 0 means noise-free. |
estimation
Parameter estimation.
key |
type |
default |
description |
|---|---|---|---|
|
|
Sigma-point stencil, the pattern along which the estimates are perturbed. Each sigma point costs one forward run per measurement time:
|
|
integer ≥ 1 |
|
Number of passes over the measurements. Each pass after the first starts from the
previous estimate, with the prior’s uncertainty: relative to that estimate for |
sensitivity
Sensitivity analysis with the Fisher information (kipe sensitivity).
key |
type |
default |
description |
|---|---|---|---|
number > 0 |
|
Step of the finite differences: for |