parameter_space
parameter_space
ParameterSpace domain object for history matching.
Classes
ParameterSpace
Encapsulates parameter space information and operations.
ParameterSpace
parameter_space.ParameterSpace(parameters)
Encapsulates parameter space information and operations.
Represents the bounds and constraints for parameters in a history matching analysis. Supports operations like constraining the space based on samples and calculating volume reductions.
Methods
constrain_parameter
parameter_space.ParameterSpace.constrain_parameter(param_name, new_min, new_max)
Create new ParameterSpace with updated bounds for one parameter.
Parameters
param_name
str
Name of parameter to constrain
required
new_min
float
New minimum value
required
new_max
float
New maximum value
required
constrain_to_samples
parameter_space.ParameterSpace.constrain_to_samples(samples_df, percentile= 95 )
Create new ParameterSpace constrained to sample bounds.
Parameters
samples_df
pd .DataFrame
DataFrame containing parameter samples
required
percentile
float
Percentile to use for bounds (e.g., 95 means 2.5-97.5 range)
95
get_bounds
parameter_space.ParameterSpace.get_bounds(parameter_name)
Get bounds for a specific parameter.
Parameters
parameter_name
str
Name of the parameter
required
get_parameter_names
parameter_space.ParameterSpace.get_parameter_names()
Get list of all parameter names.
plot_bounds
parameter_space.ParameterSpace.plot_bounds(reference= None , ax= None , ** kwargs)
Plot each parameter’s bounds as a horizontal range, optionally against a reference ParameterSpace to show shrinkage (delegates to historymatching.plotting.plot_parameter_bounds ).
sample_uniformly
parameter_space.ParameterSpace.sample_uniformly(n_samples, seed= None )
Generate uniform random samples within parameter bounds.
Parameters
n_samples
int
Number of samples to generate
required
seed
Optional [int ]
Random seed for reproducibility
None
summary
parameter_space.ParameterSpace.summary()
Human-readable summary: one line per parameter with its bounds.
to_dataframe
parameter_space.ParameterSpace.to_dataframe()
Return the underlying parameters DataFrame.
validate_samples
parameter_space.ParameterSpace.validate_samples(samples_df)
Check if all samples fall within parameter bounds.
Parameters
samples_df
pd .DataFrame
DataFrame containing parameter samples
required
Returns
bool
True if all samples are valid, False otherwise
volume_fraction_remaining
parameter_space.ParameterSpace.volume_fraction_remaining(original_space)
Calculate remaining parameter space volume as fraction of original.
Parameters
original_space
ParameterSpace
Original ParameterSpace to compare against
required
Returns
float
Fraction of volume remaining (0.0 to 1.0)