


preProcessIfNeeded Some RBF types require working on scaled
data and/or scaled parameters, this is the function where
these special cases are handled

0001 function epsilon = scaleEpsilonAccordingToRbfType(rbfType, epsilon, x, y, z) 0002 %preProcessIfNeeded Some RBF types require working on scaled 0003 % data and/or scaled parameters, this is the function where 0004 % these special cases are handled 0005 0006 if strcmpi(rbfType, 'greenwithtension') || strcmpi(rbfType, 'greenregularizedwithtension') 0007 % greenWithTensionRBF expects the epsilon (tension parameter) to be between 0..1 0008 if epsilon < 0 || epsilon >= 1 0009 error('greenWithTensionRBF expects the tension parameter (epsilon) to be 0 <= epsilon < 1!'); 0010 end 0011 0012 % Length scale 0013 % DevNote: This parameter (\alpha in the original reference) is an 0014 % heuristic, and in GMT is computed from the range of values in of the 0015 % QUERY points, so if you are using this formula with the data points 0016 % that is a different approximation! 0017 IM = sqrt (-1); 0018 lengthScale = 50/abs(max(x(:)) - min(x(:)) + IM * (max(y(:)) - min(y(:)))); 0019 0020 % With the following transformation, epsilon changes to be the 0021 % parameter 'p' in the original reference (Wessel and Bercovici, 1998) 0022 epsilon = sqrt(epsilon/(1-epsilon)); 0023 epsilon = epsilon*lengthScale; 0024 end 0025 0026 end