Class KrigingInterpolator
java.lang.Object
com.irurueta.numerical.interpolation.KrigingInterpolator
Interpolates sparsely defined points using D.G. Krige method.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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.private final KrigingInterpolator.Variogram
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
ConstructorsConstructorDescriptionKrigingInterpolator
(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 TypeMethodDescriptiondouble
Gets most recently computed error.double
Gets most recently computed interpolated value.int
getNdim()
Gets number of dimensions of each point.int
getNpt()
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.
-
Field Details
-
x
private final com.irurueta.algebra.Matrix xData to compute interpolations from. Each row corresponds to a point. The number of columns determines the number of dimensions of provided points. -
vgram
Variogram of provided data. -
ndim
private final int ndimNumber of dimensions of each point. -
npt
private final int nptNumber of provided points. -
lastval
private double lastvalMost recently computed value. -
lasterr
private double lasterrMost 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 viLU decomposer. -
xi
private final double[] xiValues 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
Returns interpolated value at provided point.- Parameters:
xstar
- point where interpolation is computed.- Returns:
- computed interpolation.
- Throws:
InterpolationException
- if interpolation fails.
-
interpolate
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.
-