bestfitplane {geodiv} | R Documentation |
Finds the Best Fit Polynomial Surface
Description
Finds the best fit polynomial surface for a raster or matrix. This function tests least squares polynomial fits with orders of 0 - 3 and determines which order minimizes the error when the fit is subtracted from the original image.
Usage
bestfitplane(x)
Arguments
x |
A raster or matrix. |
Value
A raster or matrix of the same size as the input with values predicted from the best polynomial fit.
Examples
# import raster image
data(orforest)
orforest <- terra::unwrap(orforest)
# find the least squares polynomial surface
poly <- bestfitplane(orforest)
# plot the fit
terra::plot(poly)
[Package geodiv version 1.1.0 Index]