aspcol.kernelinterpolation.get_krr_params
- aspcol.kernelinterpolation.get_krr_params(data, pos, wave_num, reg_param, kernel_func=None, kernel_args=None)
Calculates the kernel ridge regression parameter vector a for a standard l2 KRR problem
The optimal estimate according to KRR is u(r) = sum_{m=1}^{M} kernel_func(r, r_m) a_m This function returns the parameter vector a.
- Parameters:
data (ndarray of shape (num_freq, num_pos)) – the data measured at pos
pos (ndarray of shape (num_pos, 3)) – positions where the function has been measured
wave_num (ndarray of shape (num_freq))
reg_param (float) – positive value to regularize the problem. Corresponds to lambda in the optimization problem.
kernel_func (callable) – with calling signature kernel_func(pos1, pos2, *kernel_args) should return ndarray (…, num_pos1, num_pos2)
kernel_args (list) – extra arguments that are needed for the kernel function
Notes
The optimal parameter a is of course dependent on what optimization problem is being solved. In this case we assume that the problem is sum_{m=1}^{M} vert h(r_m) - u(r_m) vert_2^2 + lambda lVert u rVert_H^2