kriging.js is a Javascript library for mapping and predicting spatial data using the kriging algorithm. This library allows one to model and map spatial data.
The easiest way to get started is to download the Javascript library (or link directly to krigingjs.com/kriging.js) and attach it to your html code. Then, to train a model with coordinates (x, y) and values t on parameters σ^{2} and α:
var model = "exponential"; var sigma2 = 0, alpha = 100; var fitModel = kriging.train(t, x, y, model, sigma2, alpha);
To predict points at a new point in space (x_{new}, y_{new}):
var tnew = kriging.predict(xnew, ynew, fitModel);

Creating Maps

Documentation

Probability Model
The model used is a 2dimensional gaussian process, y, with a prior on the parameters of the kernel function. One of a variety of different kernel functions (or variogram models) generate the Gram matrix K. The variance σ^{2} of the noise process is adjustable, providing a smoothing effect by increasing the uncertainty of the likelihood t.
y ~ N(0, K) ty ~ N(ty, σ^{2}I)

Variogram
The various variogram models can be interpreted as kernel functions for 2dimensional coordinates a, b and parameters nugget, range, sill and A. Reparameterized as a linear function, with w = [nugget, (sillnugget)/range], this becomes:
Gaussian: k(a,b) = w[0] + w[1] * ( 1  exp{ ( ab / range )^{2} / A } ) Exponential: k(a,b) = w[0] + w[1] * ( 1  exp{ ( ab / range ) / A } ) Spherical: k(a,b) = w[0] + w[1] * ( 1.5 * ( ab / range )  0.5 * ( ab / range )^{3} )
Bayesian regression is used to estimate the parameters with the prior:
w ~ N(w0, αI)

Mapping methods
Grid and vector based mapping methods are available within the instantiated kriging object.