function [kp] = krls_init( kfunc, kparam, thresh, state, target )
% function [kp] = krls_init( kfunc, kparam, thresh, state, target )
%
% Part of my Kernel Recursive Least Squares implementation.
%
% INPUT:
% kfunc - handle to the kernel function. This function should
% take three arguments: X, Y, and some sort of parameter
% (which is kernel specific). It should return a matrix K,
% where K_ij is kernel(X_i,Y_j,kparam). X and Y are matrices,
% where data points are stored as columns.
% kparam - this will passed to the kernel function on every call.
% thresh - the almost-linearly-independent threshold
% state - the initial data point (a column vector)
% target - the initial target (a scalar)
%
% OUTPUT:
% kp - a data structure containing everything needed for
% subsequent KRLS calls.
%
% D. Wingate 10/25/2006
%
kp.kfunc = kfunc;
kp.kparam = kparam;
kp.thresh = thresh;
kp.dp = dict_init( kfunc, kparam, thresh, state );
kp.P = 1;
kp.Alpha = target/kp.dp.K;
return;