26 #ifndef LSST_AFW_MATH_GAUSSIAN_PROCESS_H
27 #define LSST_AFW_MATH_GAUSSIAN_PROCESS_H
29 #include <Eigen/Dense>
33 #include "boost/shared_ptr.hpp"
130 template <
typename T>
133 ,
private boost::noncopyable
167 template <
typename T>
202 template <
typename T>
240 template <
typename T>
243 :
private boost::noncopyable
286 T
getData(
int ipt,
int idim)
const;
451 void _count(
int where,
int *ct)
const;
498 template <
typename T>
501 :
private boost::noncopyable
603 int numberOfNeighbors)
const;
622 int numberOfNeighbors)
const;
645 int numberOfNeighbors)
const;
664 int numberOfNeighbors)
const;
834 #endif //#ifndef LSST_AFW_MATH_GAUSSIAN_PROCESS_H
ndarray::Array< T, 1, 1 > _max
virtual T operator()(ndarray::Array< const T, 1, 1 > const &, ndarray::Array< const T, 1, 1 > const &) const
Actually evaluate the covariogram function relating two points you want to interpolate from...
void addToEigen()
Adds time to _eigenTime.
T selfInterpolate(ndarray::Array< T, 1, 1 > variance, int dex, int numberOfNeighbors) const
This method will interpolate the function on a data point for purposes of optimizing hyper parameters...
void _count(int where, int *ct) const
A method which counts the number of nodes descended from a given node (used by removePoint(int)) ...
Eigen matrix objects that present a view into an ndarray::Array.
void setSigma0(double sigma0)
set the _sigma0 hyper parameter
void _organize(ndarray::Array< int, 1, 1 > const &use, int ct, int parent, int dir)
Find the daughter point of a node in the tree and segregate the points around it. ...
Stores values of a function sampled on an image and allows you to interpolate the function to unsampl...
void addToSearch()
Adds time to _searchTime.
This is a structure for keeping track of how long the interpolation methods spend on different parts ...
void setEllSquared(double ellSquared)
set the _ellSquared hyper parameter (the square of the characteristic length scale of the covariogram...
void addPoint(ndarray::Array< const T, 1, 1 > const &v)
Add a point to the tree. Allot more space in _tree and data if needed.
virtual T operator()(ndarray::Array< const T, 1, 1 > const &, ndarray::Array< const T, 1, 1 > const &) const
Actually evaluate the covariogram function relating two points you want to interpolate from...
The parent class of covariogram functions for use in Gaussian Process interpolation.
void Initialize(ndarray::Array< T, 2, 2 > const &dt)
Build a KD Tree to store the data for GaussianProcess.
T getData(int ipt, int idim) const
Return one element of one node on the tree.
void setLambda(T lambda)
set the value of the hyperparameter _lambda
int _testTree() const
Make sure that the tree is properly constructed. Returns 1 of it is. Return zero if not...
void addToIteration()
Adds time to _iterationTime.
ndarray::Array< T, 2, 2 > _data
int _findNode(ndarray::Array< const T, 1, 1 > const &v) const
Find the point already in the tree that would be the parent of a point not in the tree...
virtual T operator()(ndarray::Array< const T, 1, 1 > const &p1, ndarray::Array< const T, 1, 1 > const &p2) const
Actually evaluate the covariogram function relating two points you want to interpolate from...
void reset()
Resets all of the data members of GaussianProcessTimer to zero.
ndarray::Array< int, 2, 2 > _tree
void removePoint(int dex)
This will remove a point from the data set.
boost::shared_ptr< Covariogram< T > > _covariogram
void removePoint(int dex)
Remove a point from the tree. Reorganize what remains so that the tree remains self-consistent.
void setSigma1(double sigma1)
set the _sigma1 hyper parameter
void _reassign(int target)
Reassign nodes to the tree that were severed by a call to removePoint(int)
void setKrigingParameter(T kk)
Assign a value to the Kriging paramter.
int getPoints() const
return the number of data points stored in the tree
T interpolate(ndarray::Array< T, 1, 1 > variance, ndarray::Array< T, 1, 1 > const &vin, int numberOfNeighbors) const
Interpolate the function value at one point using a specified number of nearest neighbors.
The data for GaussianProcess is stored in a KD tree to facilitate nearest-neighbor searches...
a Covariogram that falls off as the negative exponent of the square of the distance between the point...
ndarray::Array< T, 1, 1 > _min
a Covariogram that recreates a neural network with one hidden layer and infinite units in that layer ...
GaussianProcessTimer _timer
Interface for DateTime class.
void _descend(int root)
Descend the tree from a node which has been removed, reassigning severed nodes as you go...
A multidimensional strided array.
Covariogram()
construct a Covariogram assigning default values to the hyper parameters
Citizen(const std::type_info &)
virtual ~SquaredExpCovariogram()
afw::table::Key< double > sigma1
ndarray::Array< T, 2, 2 > _function
void getTreeNode(ndarray::Array< int, 1, 1 > const &v, int dex) const
Return the _tree information for a given data point.
void display()
Displays the current values of all times and _interpolationCount.
void _lookForNeighbors(ndarray::Array< const T, 1, 1 > const &v, int consider, int from) const
This method actually looks for the neighbors, determining whether or not to descend branches of the t...
double _distance(ndarray::Array< const T, 1, 1 > const &p1, ndarray::Array< const T, 1, 1 > const &p2) const
calculate the Euclidean distance between the points p1 and p2
ndarray::Array< int, 1, 1 > _neighborCandidates
int _walkUpTree(int target, int dir, int root) const
A method to make sure that every data point in the tree is in the correct position relative to its pa...
void setCovariogram(boost::shared_ptr< Covariogram< T > > const &covar)
Assign a different covariogram to this GaussianProcess.
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
ndarray::Array< double, 1, 1 > _neighborDistances
ndarray::Array< int, 1, 1 > _inn
GaussianProcessTimer & getTimes() const
Give the user acces to _timer, an object keeping track of the time spent on various processes within ...
void start()
Starts the timer for an individual call to an interpolation routine.
void addToVariance()
Adds time to _varianceTime.
void addToTotal(int i)
Adds time to _totalTime and adds counts to _interpolationCount.
void addPoint(ndarray::Array< T, 1, 1 > const &vin, T f)
Add a point to the pool of data used by GaussianProcess for interpolation.
GaussianProcess(ndarray::Array< T, 2, 2 > const &dataIn, ndarray::Array< T, 1, 1 > const &ff, boost::shared_ptr< Covariogram< T > > const &covarIn)
This is the constructor you call if you do not wish to normalize the positions of your data points an...
virtual ~NeuralNetCovariogram()
Include files required for standard LSST Exception handling.
void batchInterpolate(ndarray::Array< T, 1, 1 > mu, ndarray::Array< T, 1, 1 > variance, ndarray::Array< T, 2, 2 > const &queries) const
Interpolate a list of query points using all of the input data (rather than nearest neighbors) ...
void findNeighbors(ndarray::Array< int, 1, 1 > neighdex, ndarray::Array< double, 1, 1 > dd, ndarray::Array< const T, 1, 1 > const &v, int n_nn) const
Find the nearest neighbors of a point.