fastmath.rbf

Radial Basis Function

Create with multifunction rbf.

All of them accept scaling factor scale. Only polyharmonic is defined with integer exponent k. See rbfs-list for all names.

rbf-obj returns SMILE library object for defined function.

Categories

Code snippets

Save graph

(defn save-graph
  [f params & opts]
  (let [fname (str "images/rbf/" (first opts) ".png")
        [x1 x2] params]
    (incanter.core/save (c/function-plot f x1 x2 :y-label "value")
                        (str "docs/" fname)
                        :width 250
                        :height 250)
    fname))

rbf

multimethod

Create Radial Basis Function

Optional parameter scale.

:polyharmonic has also exponent k parameter.

Examples

Linear

(save-graph (rbf :linear) -2.0 2.0 ...)

Gaussian

(save-graph (rbf :gaussian) -2.0 2.0 ...)

Multiquadratic

(save-graph (rbf :multiquadratic) -3.0 3.0 ...)

Inverse multiquadratic

(save-graph (rbf :inverse-multiquadratic) -3.0 3.0 ...)

Inverse quadratic

(save-graph (rbf :inverse-quadratic) -3.0 3.0 ...)

Thinplate

(save-graph (rbf :thinplate) -1.0 3.0 ...)

Polyharmonic 3

(save-graph (rbf :polyharmonic 3) -3.0 3.0 ...)

Polyharmonic 4

(save-graph (rbf :polyharmonic 4) -3.0 3.0 ...)

Wendland

(save-graph (rbf :wendland) -3.0 3.0 ...)

Wu

(save-graph (rbf :wu) -3.0 3.0 ...)

rbf-obj

(rbf-obj rbf-fn)

Create RBF Smile object.

Used to pass to Smile constructors/functions.

rbfs-list

Radial Basis function names

Examples

List of names

(sort rbfs-list)
;;=> (:gaussian :inverse-multiquadratic :inverse-quadratic
;;=>            :linear :multiquadratic
;;=>            :polyharmonic :thinplate
;;=>            :wendland :wu)