Class KrigingInterpolator

java.lang.Object
com.irurueta.numerical.interpolation.KrigingInterpolator

public class KrigingInterpolator extends Object
Interpolates sparsely defined points using D.G. Krige method.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Variogram function.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.irurueta.algebra.Matrix
     
    private double
    Most recently computed error.
    private double
    Most recently computed value.
    private final int
    Number of dimensions of each point.
    private final int
    Number of provided points.
    Variogram of provided data.
    private final com.irurueta.algebra.LUDecomposer
    LU decomposer.
    private final com.irurueta.algebra.Matrix
     
    private final com.irurueta.algebra.Matrix
    Data to compute interpolations from.
    private final double[]
    Values of i-th point.
    private final com.irurueta.algebra.Matrix
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    KrigingInterpolator(com.irurueta.algebra.Matrix xx, double[] yy)
    Constructor.
    KrigingInterpolator(com.irurueta.algebra.Matrix xx, double[] yy, KrigingInterpolator.Variogram vargram)
    Constructor.
    KrigingInterpolator(com.irurueta.algebra.Matrix xx, double[] yy, KrigingInterpolator.Variogram vargram, double[] err)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets most recently computed error.
    double
    Gets most recently computed interpolated value.
    int
    Gets number of dimensions of each point.
    int
    Gets number of provided points.
    double
    interpolate(double[] xstar)
    Returns interpolated value at provided point.
    double
    interpolate(double[] xstar, double[] esterr)
    Returns interpolated value at provided point, and estimated error.
    private double
    rdist(double[] x1, double[] x2)
    Computes euclidean distance between two points.
    private static double
    sqr(double value)
    Computes squared value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • x

      private final com.irurueta.algebra.Matrix x
      Data to compute interpolations from. Each row corresponds to a point. The number of columns determines the number of dimensions of provided points.
    • vgram

      private final KrigingInterpolator.Variogram vgram
      Variogram of provided data.
    • ndim

      private final int ndim
      Number of dimensions of each point.
    • npt

      private final int npt
      Number of provided points.
    • lastval

      private double lastval
      Most recently computed value.
    • lasterr

      private double lasterr
      Most recently computed error.
    • dstar

      private final com.irurueta.algebra.Matrix dstar
    • vstar

      private final com.irurueta.algebra.Matrix vstar
    • yvi

      private final com.irurueta.algebra.Matrix yvi
    • vi

      private final com.irurueta.algebra.LUDecomposer vi
      LU decomposer.
    • xi

      private final double[] xi
      Values of i-th point.
  • Constructor Details

    • KrigingInterpolator

      public KrigingInterpolator(com.irurueta.algebra.Matrix xx, double[] yy, KrigingInterpolator.Variogram vargram, double[] err) throws InterpolationException
      Constructor.
      Parameters:
      xx - Data to compute interpolations from. Each row corresponds to a point. The number of columns determines the number of dimensions of provided points.
      yy - Function values for each provided point.
      vargram - Variogram to use.
      err - array containing estimated error of function values.
      Throws:
      InterpolationException - if initialization fails for numerical reasons.
    • KrigingInterpolator

      public KrigingInterpolator(com.irurueta.algebra.Matrix xx, double[] yy, KrigingInterpolator.Variogram vargram) throws InterpolationException
      Constructor.
      Parameters:
      xx - Data to compute interpolations from. Each row corresponds to a point. The number of columns determines the number of dimensions of provided points.
      yy - Function values for each provided point.
      vargram - Variogram to use.
      Throws:
      InterpolationException - if initialization fails for numerical reasons.
    • KrigingInterpolator

      public KrigingInterpolator(com.irurueta.algebra.Matrix xx, double[] yy) throws InterpolationException
      Constructor.
      Parameters:
      xx - Data to compute interpolations from. Each row corresponds to a point. The number of columns determines the number of dimensions of provided points.
      yy - Function values for each provided point.
      Throws:
      InterpolationException - if initialization fails for numerical reasons.
  • Method Details

    • getNdim

      public int getNdim()
      Gets number of dimensions of each point.
      Returns:
      number of dimensions of each point.
    • getNpt

      public int getNpt()
      Gets number of provided points.
      Returns:
      number of provided points.
    • getLastVal

      public double getLastVal()
      Gets most recently computed interpolated value.
      Returns:
      most recently computed interpolatd value.
    • getLastErr

      public double getLastErr()
      Gets most recently computed error.
      Returns:
      most recently computed error.
    • interpolate

      public double interpolate(double[] xstar) throws InterpolationException
      Returns interpolated value at provided point.
      Parameters:
      xstar - point where interpolation is computed.
      Returns:
      computed interpolation.
      Throws:
      InterpolationException - if interpolation fails.
    • interpolate

      public double interpolate(double[] xstar, double[] esterr) throws InterpolationException
      Returns interpolated value at provided point, and estimated error.
      Parameters:
      xstar - point where interpolation is computed.
      esterr - array where estimated error will be stored on its first position.
      Returns:
      computed interpolation.
      Throws:
      InterpolationException - if interpolation fails.
    • rdist

      private double rdist(double[] x1, double[] x2)
      Computes euclidean distance between two points.
      Parameters:
      x1 - 1st point.
      x2 - 2nd point.
      Returns:
      euclidean distance.
    • sqr

      private static double sqr(double value)
      Computes squared value.
      Parameters:
      value - a value.
      Returns:
      computed square value.