You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
## basic example codelibrary(CGGP)d<-4CG<- CGGPcreate(d=d,200)print(CG)#> CGGP object#> d = 4#> output dimensions = 1#> CorrFunc = PowerExponential#> number of design points = 193#> number of unevaluated design points = 193#> Available functions:#> - CGGPfit(CGGP, Y) to update parameters with new data#> - CGGPpred(CGGP, xp) to predict at new points#> - CGGPappend(CGGP, batchsize) to add new design points#> - CGGPplot<name>(CGGP) to visualize CGGP model
A newCGGP object has design points that should be evaluated next,either fromCG$design orCG$design_unevaluated.
Once you have evaluated the design points, you can fit the object withCGGPfit.
CG<- CGGPfit(CG,Y)CG#> CGGP object#> d = 4#> output dimensions = 1#> CorrFunc = PowerExponential#> number of design points = 193#> number of unevaluated design points = 0#> Available functions:#> - CGGPfit(CGGP, Y) to update parameters with new data#> - CGGPpred(CGGP, xp) to predict at new points#> - CGGPappend(CGGP, batchsize) to add new design points#> - CGGPplot<name>(CGGP) to visualize CGGP model
If you want to use the model to make predictions at new input points,you can useCGGPpred.
To add new design points to the already existing design, useCGGPappend. It will use the data already collected to find the mostuseful set of points to evaluate next.
# To add 100 pointsCG<- CGGPappend(CG,100)
Now you will need to evaluate the points added toCG$design, and refitthe model.
There are a few functions that will help visualize the CGGP design.
CGGPplotblocks
CGGPplotblocks shows the block structure when projected down to allpairs of two dimensions. The plot is symmetric. The facet labels be alittle bit confusing. The first column has the label 1, and it lookslike it is saying that the x-axis for each plot in that column is forX1, but it is actually the y-axis that isX1 for each plot in thatcolumn.
CGGPplotblocks(CG)
CGGPplotheat
CGGPplotheat is similar toCGGPplotblocks and can be easier to readsince it is only a single plot. The$(i,j)$ entry shows the maximumvalue for which a block was selected with$X_i$ and$X_j$ at least thatlarge. The diagonal entries,$(i, i)$, show the maximum depth for$X_i$.A diagonal entry must be at least as large as any entry in its column orrow. This plot is also symmetric.
CGGPplotheat(CG)
CGGPhist
CGGPhist shows histograms of the block depth in each direction. Thedimensions that have more large values are dimensions that have beenexplored more. These should be the more active dimensions.
CGGPplotcorr gives an idea of what the correlation structure in eachdimension is. The values plotted do not represent the actual data givento CGGP. Each wiggly line represents a random Gaussian process drawnusing the correlation parameters for that dimension from the given CGGPmodel. Dimensions that are more wiggly and have higher variance are themore active dimensions. Dimensions with nearly flat lines mean that thecorresponding input dimension has a relatively small effect on theoutput.
CGGPplotcorr(CG)
CGGPplotvariogram
CGGPplotvariogram shows something similar to the semi-variogram forthe correlation parameters found for each dimension. Really it is justshowing how the correlation function decays for points that are furtheraway. It should always start aty=1 forx=0 and decrease iny asx gets larger
CGGPplotvariogram(CG)
CGGPplotslice
CGGPplotslice shows what the predicted model along each individualdimension when the other input dimensions are held constant, i.e., aslice along a single dimension. By default the slice is done holding allother inputs at 0.5, but this can be changed by changing the argumentproj. The black dots are the data points that are in that slice If youchangeproj to have values not equal to 0.5, you probably won’t seeany black dots. The pink regions are the 95% prediction intervals.
This plot is the best for giving an idea of what the higher dimensionfunction look like. You can see how the output changes as each input isvaried.
CGGPplotslice(CG)
The next plot changes so that all the other dimensions are held constantat 0.15 for each slice plot. When moving from the center line, the errorbounds generally should be larger since it is further from the data, butwe should see similar patterns unless the function is highly nonlinear.
CGGPplotslice(CG,proj= rep(.15,CG$d))
CGGPplottheta
CGGPplottheta is useful for getting an idea of how the samples for thecorrelation parameters (theta) vary compared to the maximum a posteriori(MAP). This may be helpful when usingUCB orTS inCGGPappend toget an idea of how much uncertainty there is in the parameters. Notethat there are likely multiple parameters for each input dimension.
CGGPplottheta(CG)
CGGPplotsamplesneglogpost
CGGPplotsamplesneglogpost shows the negative log posterior for each ofthe different samples for theta. The value for the MAP is shown as ablue line. It should be at the far left edge if it is the true MAP.