Multiquadric

Multiquadric

Multiquadric kernel: k(x,y) = sqrt(‖x−y‖² + c²).

Faithful to Rust, this class preserves THREE latent bugs (PORT_SPEC §4.2):

  1. nbParameters() returns 2, but there is really only one parameter c.
  2. kernel() uses the SQUARED distance inside hypot (‖x−y‖².hypot(c) = sqrt(‖x−y‖⁴ + c²)), while gradient() uses the NON-squared distance (‖x−y‖.hypot(c)) — the two are inconsistent.
  3. setParameters() reads parameters[1] although getParameters() returns [c] at index 0. None are "fixed" — consistency with Rust 0.6.0 is the requirement.

Parameters: [c] (default c = 0). Not scalable.

Constructor

new Multiquadric(copt)

Source:
Parameters:
Name Type Attributes Default Description
c number <optional>
0

Classes

Multiquadric

Members

c :number

Description:
  • constant added to the square of the difference

Source:

constant added to the square of the difference

Type:
  • number

Methods

gradient(x1, x2) → {Array.<number>}

Description:
  • gradient = [grad_c]: grad_c = c / hypot(‖x−y‖, c) NOTE: faithful to Rust latent bug — uses the NON-squared norm here (inconsistent with kernel()'s squared norm).

Source:
Parameters:
Name Type Description
x1 Array.<number>
x2 Array.<number>
Returns:
Type
Array.<number>

kernel(x1, x2) → {number}

Description:
  • k(x,y) = hypot(‖x−y‖², c) = sqrt(‖x−y‖⁴ + c²). NOTE: faithful to Rust latent bug — uses the SQUARED norm inside hypot (inconsistent with gradient()'s non-squared norm).

Source:
Parameters:
Name Type Description
x1 Array.<number>
x2 Array.<number>
Returns:
Type
number

setParameters(parameters)

Source:
Parameters:
Name Type Description
parameters Array.<number>

NOTE: faithful to Rust latent bug — reads index 1, while getParameters returns c at index 0.