Class interpm_krige_optim (o2scl)

O2scl : Class List

template<class func_vec_t, class vec_t = boost::numeric::ublas::vector<double>, class mat_x_t = o2scl::matrix_view_table<>, class mat_x_row_t = const matrix_row_gen<o2scl::matrix_view_table<>>, class mat_y_t = o2scl::matrix_view_table_transpose<>, class mat_y_row_t = const matrix_row_gen<o2scl::matrix_view_table_transpose<>>, class mat_inv_kxx_t = boost::numeric::ublas::matrix<double>, class mat_inv_t = o2scl_linalg::matrix_invert_det_cholesky<boost::numeric::ublas::matrix<double>>, class vec3_t = std::vector<std::vector<std::vector<double>>>>
class interpm_krige_optim

Multi-dimensional interpolation using an optimized covariance function.

See also the Higher-dimensional Interpolation section of the User’s guide.

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)

static const size_t mode_loo_cv_bf = 1

Leave-one-out cross validation (brute force version)

static const size_t mode_max_lml = 2

Minus Log-marginal-likelihood.

static const size_t mode_loo_cv = 3

Leave-one-out cross validation (default)

static 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 interpm_krige_optim<func_vec_t, vec_t, mat_x_t, mat_x_row_t, mat_y_t, mat_y_row_t, mat_inv_kxx_t, mat_inv_t, vec3_t> class_t

Public Functions

inline void set_mmin(mmin_base<multi_funct, multi_funct, ubvector> &mb)

Set the minimizer to use.

inline virtual int addl_const(size_t iout, double &ret)

Additional constraints to add to the fit.

inline virtual double qual_fun(size_t iout, int &success)

Function to optimize the covariance parameters.

inline double min_fun(size_t iout, size_t n, const ubvector &v, double max_val)

Minimization function for the covariance parameters.

inline interpm_krige_optim()
inline virtual ~interpm_krige_optim()
inline int set_covar(func_vec_t &covar, vec3_t &param_lists)

Set the covariance function and parameter lists.

inline int set_data_internal(size_t n_in, size_t n_out, size_t n_points, mat_x_t &user_x, mat_y_t &user_y, bool rescale = false, bool err_on_fail = true)

Initialize interpolation routine.

template<class vec2_t, class vec4_t>
inline void eval(const vec2_t &x0, vec4_t &y0)

Given input vector x store the result of the interpolation in y.

template<class vec2_t, class vec4_t>
inline void sigma(const vec2_t &x0, vec4_t &dy0)

Return the interpolation uncertainty from the Gaussian process.

template<class vec2_t, class vec4_t>
inline void deriv(const vec2_t &x0, vec4_t &y0, size_t ix)

Given input vector x store the result of the interpolation in y.

template<class vec2_t, class vec4_t>
inline void deriv2(const vec2_t &x0, vec4_t &y0, size_t ix, size_t iy)

Given input vector x store the result of the interpolation in y.

inline int set_data(size_t n_in, size_t n_out, size_t n_points, mat_x_t &user_x, mat_y_t &user_y, bool rescale = false, bool err_on_fail = true)

Initialize the data for the interpolation.

Public Members

bool err_nonconv

If true, throw exceptions on convergence errors.

bool keep_matrix

If true, keep \( K^{-1} \) (default true)

int verbose

Verbosity parameter (default 0)

mmin_simp2<multi_funct, ubvector> def_mmin

Default minimizer.

diff_evo_adapt alt_mmin

Alternate minimizer.

bool use_alt_mmin

If true, use the alternate minimizer.

func_vec_t *cf

Pointer to the covariance function.

bool timing

If true, output timing results.

bool full_min

If true, use the full minimizer.

bool skip_optim

If true, skip optimization.

Protected Attributes

std::vector<ubvector> Kinvf

Inverse covariance matrix times function vector.

std::vector<mat_inv_kxx_t> inv_KXX

The inverse of the covariance matrix for each output quantity.

mat_inv_t mi

The matrix inversion object.

vec3_t plists

List of parameter values to try.

std::vector<double> qual

The quality factor of the optimization for each output function.

mmin_base<multi_funct, multi_funct, ubvector> *mp

Pointer to the user-specified minimizer.

size_t np

The number of points.

size_t nd_in

The number of dimensions of the inputs.

size_t nd_out

The number of dimensions of the outputs.

mat_x_t x

The data.

mat_y_t y

The data.

bool data_set

True if the data has been specified.

ubvector mean_y

The output means.

ubvector std_y

The output standard deviations.

bool rescaled

True if the data needs to be rescaled.