glearn.Covariance.set_imate_options#

Covariance.set_imate_options(imate_options)#

Updates the dictionary of options that is passed to the imate package.

Note

This function is intended to be used internally.

Parameters:
imate_optionsdict

A dictionary of options to be passed to the functions in imate package.

Notes

This function updates the attribute imate_options which is a dictionary of options configuring the functions of the imate package. The existing options in the dictionary imate_option are overwritten, and new options will be added (if they do not already exist in the current dictionary).

Examples

Create a covariance object and set imate_options:

>>> # Generate a set of points
>>> from glearn.sample_data import generate_points
>>> x = generate_points(num_points=30, dimension=1)

>>> # Define imate options
>>> options = {
...     'method': 'cholesky',
... }

>>> # Create a covariance object
>>> from glearn import Covariance
>>> cov = Covariance(x, imate_options=options)

>>> # Check default imate options
>>> cov.get_imate_options()
{
    'method': 'cholesky'
}

Now, change the imate_options of the above covariance object:

>>> # Define new imate options
>>> options = {
...     'method': 'slq',
...     'min_num_samples': 30,
...     'max_num_samples': 100
... }
>>> cov.set_imate_options(options)

>>> # Check again the updated options
>>> cov.get_imate_options()
{
    'method': 'slq',
    'min_num_samples': 30,
    'max_num_samples': 100
}