kilopop.mappings.tanaka_mean_fixed

class kilopop.mappings.tanaka_mean_fixed(*args, **kwargs)[source]

Bases: Model

Construct piece-wise mean function model based on Tanaka et al. 2019.

Mean model class to be used with the Gaussian process model of the opacity surface. This is based on the work of Tanaka et. al 2019.

__init__(*args, **kwargs)
__call__(**kwargs)

Call self as a function.

Methods

__init__(*args, **kwargs)

check_parameter_vector(vector)

compute_gradient(*args, **kwargs)

Compute the "gradient" of the model for the current parameters

freeze_all_parameters()

Freeze all parameters of the model

freeze_parameter(name)

Freeze a parameter by name

get_gradient(*args, **kwargs)

get_parameter(name)

Get a parameter value by name

get_parameter_bounds([include_frozen])

Get a list of the parameter bounds

get_parameter_dict([include_frozen])

Get an ordered dictionary of the parameters

get_parameter_names([include_frozen])

Get a list of the parameter names

get_parameter_vector([include_frozen])

Get an array of the parameter values in the correct order

get_value(kilonova_ejecta_array)

Get value function in george format.

log_prior()

Compute the log prior probability of the current parameters

parameter_sort(f)

set_parameter(name, value)

Set a parameter value by name

set_parameter_vector(vector[, include_frozen])

Set the parameter values to the given vector

thaw_all_parameters()

Thaw all parameters of the model

thaw_parameter(name)

Thaw a parameter by name

Attributes

full_size

The total number of parameters (including frozen parameters)

parameter_names

parameter_vector

An array of all parameters (including frozen parameters)

vector_size

The number of active (or unfrozen) parameters

compute_gradient(*args, **kwargs)

Compute the “gradient” of the model for the current parameters

The default implementation computes the gradients numerically using a first order forward scheme. For better performance, this method should be overloaded by subclasses. The output of this function should be an array where the first dimension is full_size.

freeze_all_parameters()

Freeze all parameters of the model

freeze_parameter(name)

Freeze a parameter by name

Parameters:

name – The name of the parameter

property full_size

The total number of parameters (including frozen parameters)

get_parameter(name)

Get a parameter value by name

Parameters:

name – The name of the parameter

get_parameter_bounds(include_frozen=False)

Get a list of the parameter bounds

Parameters:

include_frozen (Optional[bool]) – Should the frozen parameters be included in the returned value? (default: False)

get_parameter_dict(include_frozen=False)

Get an ordered dictionary of the parameters

Parameters:

include_frozen (Optional[bool]) – Should the frozen parameters be included in the returned value? (default: False)

get_parameter_names(include_frozen=False)

Get a list of the parameter names

Parameters:

include_frozen (Optional[bool]) – Should the frozen parameters be included in the returned value? (default: False)

get_parameter_vector(include_frozen=False)

Get an array of the parameter values in the correct order

Parameters:

include_frozen (Optional[bool]) – Should the frozen parameters be included in the returned value? (default: False)

get_value(kilonova_ejecta_array)[source]

Get value function in george format.

Parameters:
  • self (class instance) – Reference to class instance.

  • kilonova_ejecta_array (array) – Array of kilonova ejecta parameter pairs.

Returns:

mean_function_value – The mean function value at the given kilonova parameters.

Return type:

array

log_prior()

Compute the log prior probability of the current parameters

property parameter_vector

An array of all parameters (including frozen parameters)

set_parameter(name, value)

Set a parameter value by name

Parameters:
  • name – The name of the parameter

  • value (float) – The new value for the parameter

set_parameter_vector(vector, include_frozen=False)

Set the parameter values to the given vector

Parameters:
  • vector (array[vector_size] or array[full_size]) – The target parameter vector. This must be in the same order as parameter_names and it should only include frozen parameters if include_frozen is True.

  • include_frozen (Optional[bool]) – Should the frozen parameters be included in the returned value? (default: False)

thaw_all_parameters()

Thaw all parameters of the model

thaw_parameter(name)

Thaw a parameter by name

Parameters:

name – The name of the parameter

property vector_size

The number of active (or unfrozen) parameters