An Improved Treed Gaussian Process

Many black box functions and datasets have regions of different variability. Models such as the Gaussian process may fall short in giving the best repre-sentation of these complex functions. One successful approach for modeling this type of nonstationarity is the Treed Gaussian process [1], which extended the Gaussian process by dividing the input space into different regions using a binary tree algorithm. Each region became its own Gaussian process. This iterative inference process formed many different trees and thus, many different Gaussian processes. In the end these were combined to get a posterior predictive distribution at each point. The idea was that when the iterations were combined, smoothing would take place for the surface of the predicted points near tree boundaries. We introduce the Improved Treed Gaussian process, which divides the input space into a single main binary tree where the different tree regions have different variability. The parameters for the Gaussian process for each tree region are then determined. These parameters are then smoothed at the region boundaries. This smoothing leads to a set of parameters for each point in the input space that specify the covariance matrix used to predict the point. The advantage is that the prediction and actual errors are estimated better since the standard deviation and range parameters of each point are related to the variation of the region it is in. Further, smoothing between regions is better since each point prediction uses its parameters over the whole input space. Examples are given in this paper which show these advantages for lower-dimensional problems.


Introduction
A common complication in the analysis of data is changes in variability, either in How to cite this paper: Guenther, J. and Lee, H.K.H. (2020) An Improved Treed Gaussian Process. Applied Mathematics, the smoothness of the underlying function or as heteroscedasticity. Fully modeling this variability can be computationally prohibitive. The Gaussian process is commonly used as a nonparametric model for complex data, especially in the context of computer simulation modeling or estimation of black box functions, as discussed in [2] [3]. A limitation of the Gaussian process is that it may not represent all regions of the functional domain well when there are regions of different variability. The Treed Gaussian process was developed to handle this situation in a computationally efficient manner [1].
Other examples of non-stationary Gaussian processes include [4]- [11]. Many of these are more computationally intensive than the Treed Gaussian process. [4] uses non-stationary spatial dependence as explained through a constructive "process-convolution" approach, ensuring the resulting covariance structure is valid. [5] introduces a new class of nonstationary covariance functions which allow the model to adapt to spatial surfaces whose variability changes with location. [6] uses a process convolutions-based GP model by convolving a smoothing kernel with a partitioned nonstationarity latent process in the Gaussian process obtained by allowing the variability of the latent process and the kernel size to change across partitions. [7] uses a method which automatically decomposes the spatial domain into disjoint regions within which the process is assumed to be stationary but across regions the data is assumed independent. Uncertainty in the number of disjoint regions, their shapes, and the model within regions is dealt with in a fully Bayesian fashion. [8] uses clustering to determine different regions of variability and a nonstationary Gaussian process across the clusters. [9] uses an approach described as spatially clustered coefficient regression to model variable functions. [10] uses a nonstationary covariance function constructed based on selected partitions to model functions of variability. [11] uses piecewise Gaussian processes to model sharp changes in the covariance matrix due to the change in rock types for geological structures.
The Treed Gaussian process [1], which we compare to our Improved Treed Gaussian process in this paper, models functions with regions of different variability by an iterative inference process which divides up the input space into regions using a binary tree approach to isolate the regions of different variability. Each tree region, for a given iteration, has its own Gaussian process. In the end, the predictions for points in the input space for each iteration are combined to get a posterior predictive distribution for each point. There can be these problems with the Treed Gaussian Process (TGP): 1) The results can vary considerably for different calls to the Treed Gaussian Process (TGP); 2) The smoothing of the different sets of tree iterations near tree boundaries may not emulate the function as well as desired; 3) The errors of the predictions and the error estimates may be larger than desirable in some cases. It does have the advantage that the processing is very efficient with regard to the time it takes for results.
Our Improved Treed Gaussian process takes into account the different regions of variability by dividing the different regions of variability based on a set of gridded training points. This is done using a binary tree algorithm. It differs from the Treed Gaussian process in that we use a single main tree. The Gaussian process for each tree region is determined providing the process variance and the range parameters. Then the parameters of the different regions are smoothed where they interface each other. This way, each predicted point has its own parameters, whether it lies within a tree region or on the boundary between tree regions. Now each point is predicted based on its own unique covariance matrix.
Although the time for processing is increased, there are these advantages: 1) The results can be reproduced with only minor random variation; 2) Smoothing occurs at the region boundaries which emulates the function nicely since the prediction process uses the whole input space; 3) The estimated errors (σ values) are closer to the actual errors. This approach works well in low-dimensional problems, one or two dimensions, although we expect that further research can extend this method to larger dimensions.
The details of this Improved Treed Gaussian emulator are discussed in Section 2. After these details are discussed, Section 3 presents two illustrations of the Improved Treed Gaussian process (herein called the Improved TGP) and compares its results with those of the Treed Gaussian Process (TGP). Lastly, in Section 4, the Improved TGP is applied to real data. Conclusions follow in Section 5.

Improved Treed Gaussian Process
The algorithm begins with the evaluation of gridded training points covering the function's input space. The reason for such a grid is that now the point values can be used to get a variance matrix. This variance matrix is made up of the variances of each grid point. The variance of each grid point is the variance of the function values for the given point and all neighboring points within the grid distance including those on the diagonals. Next the variance matrix and the gridded training points are displayed in perspective views to give the user an idea of what the binary tree might be. There are four types of functions: 1) Irregular, 2) variable, 3) smooth, and 4) very smooth. Figure 1 shows an example of each type of function.
The user decides which type of function he/she is emulating. Then the binary tree algorithm is run to determine the binary tree that suits the function best.
This algorithm is explained in Subsection 2.2 with details given in Subsection 2.3.
After the binary tree is obtained, the individual regions of the binary tree are processed. This is a straightforward application of the Metropolis-Hastings algorithm. For each region, this algorithm determines the process variance, σ 2 , the range parameters θ 1 and θ 2 for 1 x and 2 x (or just for 1 x if one dimensional), and the nugget, τ. A prior for the range parameters has been developed for this processing step which will be explained in Subsection 2.4. The parameters for each region are smoothed at their interfaces of other tree regions to obtain a covariance matrix for each predicted point. Smoothing is discussed in Subsection 2.1. The final step is the prediction of points and their errors. This is discussed in Subsection 2.5. Figure 1. Illustration of four function types: the irregular function is the motorcycle stopping data discussed in Section 4; the variable function is discussed in Section 3.1; the third function is an example of a smooth function; the fourth function is the very smooth Rosenbrock Banana function.

Smoothing Process Parameters at Region Interfaces
For the Treed Gaussian process [1], smoothing depends on averaging many iterations of different binary trees which center around the regions of different variability of the function. Now we have a single tree and we want smoothing at the interface of specific tree regions. There are two types of smoothing: 1) Smoothing for the process variance; 2) Smoothing for the range parameters. The difference between these two types is due to the fact that we expect a region with a larger process variance should raise the process variance of a smaller process variance region at their interface. The reason for this is that, at the interface of the two regions, errors are likely to be larger than predicted by the smaller process variance. If this smoothing is left out, errors at the boundaries are often underestimated. Figure 2 shows how smoothing takes place at this interface between a region with a larger process variance than the region it interfaces with. At the interface of two regions with different range values, a smooth transition is made in which both regions are modified at the interface. The region with larger range has its range reduced while the region with smaller range has its range increased. The idea is that the points predicted at the region boundary should share equally in the two ranges. This smoothing allows for the Gaussian process points near the boundary region to better share in the final estimation of points near the boundary. Figure 3 shows this smoothing.
Two dimensional smoothing is more complicated since the smoothed value at a point near a boundary depends on more neighboring points. However, at two region boundaries it turns out to be the same as the one dimensional case. Figure 2. Smoothing for the process variance: the one dimensional view shows how smoothing is done for the interface between a region with a larger process variance and one with a smaller process variance. The larger process variance region modifies the smaller process variance region by raising its variance near the interface.

Overview of the Binary Tree Algorithm
The Gaussian process does not model a function very well that has regions of different variability. Many approaches have been taken to circumvent this difficulty [1] [4]- [11]. Our method divides the function input space into different regions using a variance matrix determined by a set of gridded points over the function's input space. This is illustrated by a simple case where the function varies by only a small amount in one region and varies by a large amount in the other region. The function is shown in Figure 4 on the left side. The variance matrix is on the right side. There is a significant change in the variance of points moving from x . This change divides the function space into two regions as shown in the perspectives. Two Gaussian functions with smoothing at the region boundary are expected to be a better fit to the surface than one Gaussian function. The proposed binary tree algorithm divides the function into two regions of differing variability. The function is: The binary tree algorithm uses the log of the variance matrix and sums the log values of 2 x moving from 1 0 x = to 1 2 x = . When a significant change in the log sum occurs, a region boundary is determined. In this case, the log sum changes by a difference of 0.847 between 1 0.8 x = and 1 1 x = and by a difference of 1.386 from 1 1 x = and 1 1.2 x = . A binary tree boundary can be established either at 1 Having divisions at both 1 x values is not desirable because there would be two boundaries as close as one grid distance. The binary tree algorithm determines where the boundary should be on the basis of an optimization function. There are two considerations for an optimal binary tree: 1) variability of the tree regions; 2) the number and sizes of the tree regions. Of the many trees computed by the algorithm, the tree chosen is the one with the best balance between variability and complexity. The first step is to sum the mean variances of the two regions formed by making a tree division at 1 1 x = as opposed to making a tree division at 1 1.2 x = . This approximation holds: s is the mean variance of the input space, and A is the area of the input space. The area is computed by multiplying the number of grid distances of length times the number of grid distances in width. Raising the 2 i s and 2 s to the power 3/2, increases as the differences in the 2 i s increase. Powers greater than 3/2 would further increase the differences in these two sums. The power of 3/2 was selected based on experimentation with several functions. In this example, the first division at 1 1 x = with two areas of 50 grid distances squared has a sum ( ) ( ) The second division at 1 1.2 x = with two areas of 40 and 60 grid distances squared has a sum ( ) ( ) 1 s is used as a normalizing factor. This indicates, by this criterion, that the division at 1 1.2 x = may be the better choice. However, we need to consider tree complexity which involves the number of regions and the sizes of regions. A smaller number of similarly sized regions may represent a function better than a large number of regions with different sizes. The trade off can be determined by computing a penalty for complexity. The penalty assessed for different size regions and the number of regions is given by to get the optimal value. For the first tree boundary with the division 1  ∑ and the Penalty to get different results. We found, based on several functions, that equal weights for both provided trees for several different functions that were reasonable. The algorithm for dividing the input space into binary trees supplies many different trees. It does so by looping through a vector of lower cutoff values. Then, for each lower cutoff value it loops through a vector of step sizes. For each cutoff value and step size a binary tree is computed. Each binary tree created is assessed for its optimal value. The one with the highest optimal value is the one selected. The details of this are discussed in Subsection 2.3.

Binary Tree Algorithm in Detail
The binary tree algorithm is composed of five functions: optimize.tree.regions, get.tree.regions, split, split.region, and get.optimum.value.
The main function optimize.tree.regions is called with the input space dimension (1 or 2), the variance matrix, and input region size. It does the following steps: • 1) Computes the logs of the variance matrix maximum and minimum. Sets the maximum lower cutoff to the maximum log of the variance matrix. Sets the minimum lower cutoff to the maximum of the minimum log of the variance matrix or the maximum lower cutoff minus 10. Computes a vector of lower cutoff values by incrementing from the minimum lower cutoff to the maximum lower cutoff. Does the following for each lower cutoff: • 2) Sets a minimum step size (δ) and a maximum step size. The maximum step size is half the maximum lower cutoff minus the minimum lower cutoff.
Computes a vector of step sizes by incrementing from the minimum step size to the maximum step size. Loops through all step sizes of this vector for the current lower cutoff.
• 3) Calls get.tree.regions with input space dimension, variance matrix, lower cutoff, and step size, which returns the tree regions.
• 4) Calls get.optimum.value with the input space dimension, tree leaf regions, variance matrix. It returns the optimum value for the tree.
• 5) If the optimum value returned is larger than any previous value, stores this optimum value and the associated tree regions. • 6) When processing is completed, returns the regions with the optimum value to the main program.
The function get.tree.regions is called with the input space dimension, variance matrix, lower cutoff, and step size. It does the following steps: • 1) Initializes the tree regions matrix with the grid size of the variance matrix.
Randomly selects a split direction if it is a two-dimensional space. Initializes the whole input space as a binary tree node with starting and ending indices for each dimension. Sets the region count to 1.
• 2) Calls split with the input space dimension, current region index, tree regions, variance matrix, cutoff, and step size. The function split is called with input space dimension, current region index, tree regions, variance matrix, lower cutoff, step size. It does the following: • 1) Sets the starting, ending and extents for the current region indices.
• 2) Calls split.region with input space dimension, current region index, tree regions, current split direction, starting, ending, and extents for the current region, lower cutoff, step size.
• 3) Returns the current tree regions to get.tree.regions.
The function split.region is called with the input space dimension, current region index, tree regions, current split direction, starting, ending and extents for the current region, variance matrix, lower cutoff, step size. It does the following: • 1) Computes the sums for the trace of the variance matrix in the specified direction for the current region.
• 2) Computes the logs of these trace sums and gets the maximum log of these sums. Smooths the log sums of the trace using R's "lowess" function.
• 3) If the trace extents are ≥5 and the maximum log sum > lower cutoff, determines if there is a step size difference between adjacent log sums. If such a difference exists, it splits the region at that index where the difference occurs provided the difference occurs after (starting index +1) and before the (ending index −1). • 4) Sets the two new regions to leafs and the split region to a node. Sets the two new leaf split directions opposite to the direction of the split region.
• 5) Returns the tree regions including any newly split regions to split.
After the tree regions are determined, the function get.optimum.value is called with input space dimension, regions (only leaf regions at this point) and variance matrix. It does the following: • 1) Determines the means of the variance matrix for each leaf.
• 2) Sums the means raised to the 3/2 power times the tree region areas/lengths divided by the mean of the input space variance raised to the power 3/2. This result is component one of the optimal value.

Tree Region Processing
Each tree region is processed individually using the Metropolis-Hastings algorithm to get its individual process variance, σ 2 , range parameter(s), θ 1 and θ 2 if two dimensional, and nugget, τ. The posterior distribution for each region is given as The posterior distribution, except for the priors for θ 1 and θ 2 , is a standard Gaussian process with a 0 mean. The priors are determined for four types of functions: 1) irregular, 2) variable, 3) smooth, and 4) very smooth. (The user estimates the type of function at the beginning of processing when the variance grid and training point perspectives are displayed.) There are four considerations in the choice of the range priors: • The grid distance is prominent in the prior selection. Grid points (also referred to as training points) near the point being predicted are the most influential in determining the predicted point. So the range parameters are often close to this distance squared except for regions where the functions are smooth or very smooth. When the function values are relatively small with little variation, the best predictions often use only the very nearest grid points.
• For cases where tree regions have variances much smaller than the region with the maximum process variance, it was discovered that an exponential prior with a mean of 1 λ dominates their range values.
• There are two classes of smooth functions: 1) smooth and 2) very smooth.
These functions need larger range values and smaller nuggets to increase the accuracy of the emulator.
• Irregular functions require larger nuggets since actual points are scattered discontinuously through the function domain.
These considerations lead to the following priors for θ for each type of functions. The prior for θ for all but very smooth functions is: We will proceed to define the parameters and constants appearing in this prior.
What this says is when λ is close to 1, min prior K K = and the θ values are dominated by the Gamma prior. As the current process σ 2 gets smaller compared to 2 max σ , λ gets larger and the exponential prior with λ dominates. For functions estimated to be very smooth, the prior for θ 1 and θ 2 is: where the mean of the Gamma function is 2 w , the square of the size of the domain, and its standard variance is 2 1000 w . This allows the ranges to include most of the whole domain.
After each tree region is processed to get their parameters σ 2 , θ 1 , θ 2 , and τ, the parameters are smoothed (except for τ which is set to the average of τ's for the regions) at the region interfaces. Smoothing has been discussed previously in Subsection 2.1.

Prediction and Error Analysis
The smoothed parameters for the whole input space are now used to construct the covariance matrices for each predicted point. Standard Kriging formulas are then used to predict the point and its standard deviation. The formulas for prediction of the point ( ) In the formulas above, the subscripts , i j are for the predicted point and the subscripts , k l are for the training point data. For the error prediction (σ) we have: For a one dimensional input space, the formulas are simplified since there is only one vector, 1 x , one range vector, 1 θ , and one standard deviation vector σ .

Illustrations of the Improved Treed Gaussian Process
Two illustrations of the Improved Treed Gaussian process are discussed in this section and their results compared to the Treed Gaussian process.

First Illustration of the Improved Treed Gaussian Process
Here we demonstrate how the Improved Treed Gaussian process (abbreviated Improved TGP) produces better predictions and error estimates than the Treed Gaussian process (abbreviated TGP) for the variable function shown in Figure 5.
The equation of the function is For this function, a 10 by 10 grid of training points is computed. (This grid size is chosen by the user.) Next the variance matrix is computed. Figure 6 shows perspectives of the variance matrix and the training points for the function. Then the binary tree algorithm is run to get the binary tree shown in Figure 7. Each region is now processed with the Metropolis-Hastings algorithm to get its process variance (σ 2 ), ranges (θ 1 , θ 2 ), and nugget τ. The smoothing is done on the prediction grid. In this case, the prediction grid is a 41 by 41 grid of points. (This is chosen by the user based on what size he/she thinks represents the function best.) The last step is the prediction of these gridded data points and their standard deviations. A covariance matrix is computed for each predicted point and the standard kriging formulas discussed in Section 2.5 are used to compute the point estimates and their error estimates, σ. Figure 8 illustrates the perspective of the predicted points, the perspective of the actual point values, the perspective of the standard deviations (error estimates), and the perspective of the actual errors.   Comparing the results for our Improved TGP with those for TGP, Figure 9 shows TGP results for the perspective of the predicted points, the perspective of the actual point values, the perspective of the standard deviations, and the perspective of the actual errors. Notice that on the side of the region with variation, the predicted surface varies from the actual surface. There is a little wave which is sort of like a speed bump. Also, it can be seen that there is a large difference in TGP estimated errors (σ) and its actual errors. The Improved TGP estimated errors are more closely related to its actual errors.
The main difference between our emulator results and TGP lies in the errors and error estimates. A simulation study of the errors and error estimates was done using 100 runs of both the Improved TGP and TGP. Table 1 shows the Improved TGP models the surface better than TGP. The Improved TGP mean absolute error is much smaller than that of TGP. The maximum absolute error for Improved TGP is smaller by nearly a factor of 4 and the estimated errors are smaller for the Improved TGP than for TGP. Also of interest, the Improved TGP had 0 points with absolute error to σ ratios > 2.5 while TGP had an average of 6.07 points with ratios > 2.5. We note that the standard deviations for all these   statistics are considerably smaller for the Improved TGP compared to TGP conveying the superior stability of the Improved TGP.

Second Illustration of the Improved Gaussian Process
Here we demonstrate how the Improved TGP produces better predictions and error estimates than TGP for the variable function shown in the perspective view ( Figure 10). For this function, 1 x and 2 x are translated and rotated by 45˚ to get the variables u and v. The function is then expressed in terms of u and v. In these variables, it is similar to the first function illustrated. The equations for the function are: For this function a 10 by 10 grid of training points is computed. Next the variance matrix is computed. Figure 11 shows the perspectives of the variance matrix and the training points for the function. Then a binary tree algorithm is run to get the binary tree in Figure 12.
Each region is now processed with the Metropolis-Hastings algorithm to get its process variance (σ 2 ), ranges (θ 1 , θ 2 ), and nugget τ. The smoothing is done on a prediction grid of 41 by 41 points. The last step is the prediction of these gridded data points and their standard deviations. A covariance matrix is computed for each predicted point and the standard Kriging formulas discussed in Section 2 are used to compute the point estimates and their error estimates, σ. Figure 13 shows the perspective of the predicted points, the perspective of the actual point values, the perspective of the standard deviations (estimated errors), and the perspective of the actual errors.
Comparing the results with what we get from TGP, Figure 14 shows the TGP results for the perspective of the predicted points, the perspective of the actual point values, the perspective of the standard deviations, and the perspective of the actual errors.
There are some differences in the TGP surface and the actual surface around the edges of the variable region. However, the main difference compared to the     Improved TGP lies in the errors and error estimates, σ. A comparison of the errors and error estimates was done for 100 runs of both the Improved TGP and TGP. Table 2 shows the Improved TGP models the surface better than TGP. The Improved TGP mean absolute error is much smaller than that of TGP. The maximum absolute error for the Improved TGP is smaller by about a factor of 10. Also, the estimated errors are smaller for the Improved TGP than for TGP, and, the Improved TGP had 0 points with absolute error to σ ratios > 2.5 while TGP had an average of 7.87 points with ratios > 2.5. The standard deviations for all these statistics are considerably smaller for the Improved TGP over the TGP conveying the superior stability of the Improved TGP.

Analysis of Motorcycle Stopping Data with Improved Treed Gaussian Process
Here we compare the Improved TGP predictions and error estimates to those of the TGP for the function represented by the data of time versus acceleration for the stopping of a motorcycle. The data from [12] has been modified to have increments of 0.2 seconds. The modified data is shown in Figure 15. Where more than one data point existed in a time increment, the average of these points is used. For increments where no data existed, the acceleration has been determined as a weighted average of the closest time accelerations. This irregular function has no associated analytic function. For this irregular function a grid of 19 data points is used. Next the variance matrix is computed. Below, plots are shown in Figure 16 of the variance matrix and the training points for a 19 point grid of the irregular function's data.
The binary tree algorithm returned a binary tree with one leaf. The input space is now processed with the Metropolis-Hastings algorithm to get its process variance σ 2 , range θ 1 , and nugget, τ. No smoothing is required for one leaf. Next the 265 data points are predicted along with their standard deviations. A single covariance matrix is computed for all data points predicted. Figure 17 shows the plot of the predicted points, the plot of the actual point values, the plot of the standard deviations, and the plot of the actual errors.
For comparison to the Improved TGP, Figure 18 shows the plots of the predicted points, the actual point values, the standard deviations, and the actual errors for TGP.
The predicted surfaces of the Improved TGP and TGP are very similar. Our Improved TGP and TGP were run 100 times to get the data in Table 3. On average, the Improved TGP has a lower value for the absolute mean error and absolute maximum error. Furthermore, the mean for σ is a closer estimate of the mean absolute error. The means for the number of points with ratios of absolute error to σ greater than 2.5 are both 0.  Figure 15. Plot of one dimensional motorcycle stopping data: this represents an irregular function with the first portion being uniform speed followed by abrupt deceleration. The last portion slowly approaches zero acceleration. Figure 16. Plots for motorcycle stopping variance matrix and data points: the plots of both the variance matrix and the training points, which give a rough view of the function, reveal an irregular variable function.

Conclusions
We propose an improved TGP for efficiently modeling functions with regions of different variability.
• It has been shown that the improved TGP gives better results than TGP for low-dimensional functions with regions of different variability. • The predictions of points and their associated standard deviations are stable.
TGP can vary considerably from one call to another for the same target function and training points.
• The improved TGP has better smoothing between the predicted points in different tree regions than TGP.
• For functions with multiple regions, there is a different covariance matrix for each predicted point providing predictions with smaller actual errors and error estimates more compatible with those actual errors than TGP. • Although processing time is greater, processing time can be benefited by making use of a more accurate and efficient matrix inverter. Future research needs to be done to extend the binary tree algorithm for higher dimensional applications.

Appendix A-Pseudo Code for Improved Treed Gaussian Process and Binary Tree Functions
Pseudo Code for the Improved Treed Gaussian Process: Compute grid of training points and the associated variance matrix.
Set flag to process the function as irregular, variable, smooth, or very smooth.
Call optimize.tree.regions to compute binary tree.
For each tree region run Metropolis-Hastings to compute ranges, process variance and nugget.
Smooth range parameters and process variance between regions.
Predict points and standard deviations for each point.
Pseudo Code for Binary Tree Algorithm Functions: Call optimize.tree.regions with input space dimension (1 or 2), variance matrix, and input space size.
Compute the logs of the variance matrix maximum and minimum and set an increment (δ) for the lower cutoffs.
Set the maximum lower cutoff to the log of the variance matrix maximum.
Set the minimum lower cutoff to the maximum of the log of the variance matrix minimum or the maximum lower cutoff minus 10.
Make a lower cutoff vector by incrementing from the minimum lower cutoff to the maximum lower cutoff.
For each lower cutoff value from the vector of lower cutoff values do the following: Set a minimum step size (δ) and maximum step size and a step size increment (δ).

Note:
Step size maximum is 1/2 times the maximum lower cutoff minus the minimum lower cutoff. Make a step size vector by incrementing from the minimum step size to the maximum step size.
For each step size and current cutoff value do the following: Call get.tree.regions with input space dimension, variance matrix, lower cutoff, and step size, returning tree regions.
Call get.optimum.value with the input space dimension, tree regions, variance matrix, returning optimal value. If optimal value returned is larger than any previous value, store optimum value and tree regions.
End step size loop.
End lower cutoff loop and return tree regions with optimal value to the main function.
Call get.tree.regions with input space dimension, variance matrix, lower cutoff, and step size.
Initialize the tree regions matrix with the grid size of the variance matrix.