Class interpm_krige_optim (o2scl)

O2scl : Class List

template<class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::vector<double>, class mat_row_t = boost::numeric::ublas::matrix_row<boost::numeric::ublas::vector<double>>>
class o2scl::interpm_krige_optim : public o2scl::interpm_krige<boost::numeric::ublas::vector<double>, boost::numeric::ublas::vector<double>, boost::numeric::ublas::matrix_row<boost::numeric::ublas::vector<double>>>

One-dimensional interpolation using an optimized covariance function.

See also the intp_section section of the User’s guide.

Note

This class is experimental.

Function to minimize and various option

size_t mode

Function to minimize (default mode_loo_cv)

size_t loo_npts

Number of points to test for cross validation (default 100)

const size_t mode_loo_cv = 1

Leave-one-out cross validation.

const size_t mode_max_lml = 2

Minus Log-marginal-likelihood.

const size_t mode_final = 10

No optimization (for internal use)

Public Types

typedef boost::numeric::ublas::vector<double> ubvector
typedef boost::numeric::ublas::matrix<double> ubmatrix
typedef boost::numeric::ublas::matrix_column<ubmatrix> ubmatrix_column

Public Functions

interpm_krige_optim()
void set_len_range(double min2, double max2)

Set the range for the length parameter.

template<class mat2_row_t, class mat2_t, class vec2_t, class vec3_t>
int set_data_noise(size_t n_in, size_t n_out, size_t n_points, mat_t &user_x, mat2_t &user_y, const vec2_t &noise_var, const vec3_t &len_precompute, bool rescale = false, bool err_on_fail = true)

Initialize interpolation routine.

template<class mat2_row_t, class mat2_t, class vec2_t>
int set_data(size_t n_in, size_t n_out, size_t n_points, mat_t &user_x, mat2_t &user_y, const vec2_t &len_precompute, bool rescale = false, bool err_on_fail = true)

Initialize the data for the interpolation.

Note

This function works differently than o2scl::interpm_idw::set_data() . See this class description for more details.

Public Members

std::vector<std::function<double(const mat_row_t&, const vec_t&)>> ff2

Function objects for the covariance.

int verbose

Verbosity parameter.

size_t nlen

Number of length scale points to try when full minimizer is not used (default 20)

min_brent_gsl def_min

Default minimizer.

bool full_min

If true, use the full minimizer.

Protected Functions

template<class vec2_t, class vec3_t>
double covar(const vec2_t &x1, const vec3_t &x2, size_t sz, double len2)

The covariance function.

template<class vec3_t>
double qual_fun(double xlen, double noise_var, size_t iout, vec3_t &y, int &success)

Function to optimize the covariance parameters.

Protected Attributes

std::vector<std::function<double(const mat_row_t&, const mat_row_t&)>> ff1

Function objects for the covariance.

std::vector<double> len

The covariance function length scale for each output function.

std::vector<double> qual

The quality factor of the optimization for each output function.

bool len_guess_set

If true, min and max has been set for the length parameter.

double len_min

Minimum for length parameter range.

double len_max

Maximum for length parameter range.

min_base *mp

Pointer to the user-specified minimizer.