Description Usage Arguments Details Value Author(s) Examples
View source: R/autofit_gaussian_2D.R
Automatically determine the bestfitting 2D Gaussian for a data set
1 2 3 4 5 6  autofit_gaussian_2D(
data,
comparison_method = "rmse",
maxiter = 1000,
simplify = TRUE
)

data 
A data.frame that contains the raw data (generally rectilinearly
gridded data, but this is not a strict requirement). Columns must be named

comparison_method 
One of "rmse", "rss", or "AIC"; what metric should be used to determine the "bestfitting" Gaussian? 
maxiter 
Default 1000. A positive integer specifying the maximum number
of iterations allowed. See 
simplify 
TRUE or FALSE. If TRUE, return only the coefficients, model,
model_error_stats, and fit_method for the bestfitting model. If FALSE, a
model comparison table is also included in the returned list as

This function runs fit_gaussian_2D()
three times: once for
each of the "main" types of models: 1) elliptical, unconstrained; 2)
elliptical, log; 3) circular. In all three cases, amplitudes and
orientations are unconstrained. The function compare_gaussian_fits()
is then used to determine which of these three models is the bestfitting,
using the comparison_method
argument to make the decision.
If simplify = TRUE
, a list with the components:
"coefs" A data.frame of fitted model parameters.
"model" The model object, fitted by stats::nls()
.
"model_error_stats" A data.frame detailing the rss, rmse, deviance, and AIC of the fitted model.
"fit_method" A character vector that indicates which method and orientation strategy was used by this function.
If simplify = FALSE
, a model comparison table is also included
in the returned list as $model_comparison
. This table is obtained
via compare_gaussian_fits()
.
Vikram B. Baliga
1 2  if (interactive()) {
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.