swiftemulator.emulators.gaussian_process_one_dim module
Gaussian Process Emulator for emulating single values
- class swiftemulator.emulators.gaussian_process_one_dim.GaussianProcessEmulator1D(kernel: Optional[Kernel] = None, mean_model: Optional[MeanModel] = None)[source]
Bases:
BaseEmulatorGenerator for emulators for individual values. In this case no independent values are used. The prediction is based on the model parameters and model values only.
- Parameters:
kernel – The
georgekernel to use. The GPE here uses a copy of this instance. By default, this is theExpSquaredKernelin Georgegeorge.kernels.Kernel – The
georgekernel to use. The GPE here uses a copy of this instance. By default, this is theExpSquaredKernelin Georgeoptional – The
georgekernel to use. The GPE here uses a copy of this instance. By default, this is theExpSquaredKernelin Georgemean_model – A mean model conforming to the
swiftemulatormean model protocol (several pre-made models are available in theswiftemulator.mean_modelsmodule).MeanModel – A mean model conforming to the
swiftemulatormean model protocol (several pre-made models are available in theswiftemulator.mean_modelsmodule).optional – A mean model conforming to the
swiftemulatormean model protocol (several pre-made models are available in theswiftemulator.mean_modelsmodule).
- kernel: Optional[Kernel]
- model_specification: Optional[ModelSpecification] = None
- model_parameters: Optional[ModelParameters] = None
- model_values: Optional[ModelValues] = None
- ordering: Optional[List[Hashable]] = None
- parameter_order: Optional[List[str]] = None
- independent_variables: Optional[array] = None
- dependent_variables: Optional[array] = None
- dependent_variable_errors: Optional[array] = None
- emulator: Optional[GP] = None
- fit_model(model_specification: ModelSpecification, model_parameters: ModelParameters, model_values: ModelValues)[source]
Fits the gaussian process model, as determined by the initialiser variables of the class (i.e. the kernel and the mean model).
- Parameters:
model_specification (ModelSpecification) – Full instance of the model specification.
model_parameters (ModelParameters) – Full instance of the model parameters.
model_values (ModelValues) – Full instance of the model values describing this individual scaling relation.
Notes
This method uses copies of the internal kernel and mean model objects, as those objects contain slightly unhelpful state information.
- predict_values(model_parameters: Dict[str, float]) array[source]
Predict a value from the trained emulator contained within this object. returns the value at the input model parameters.
- Parameters:
model_parameters (Dict[str, float]) – The point in model parameter space to create predicted values at.
- Returns:
dependent_prediction, float – Value of predictions, if the emulator is a function f, this is the predicted value of f(independent) evaluted at the position of the input model_parameters.
dependent_prediction_error, float – Error on the model prediction.