autofit_gaussian_2D: Automatically determine the best-fitting 2D-Gaussian for a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/autofit_gaussian_2D.R

Description

Automatically determine the best-fitting 2D-Gaussian for a data set

Usage

1
2
3
4
5
6
autofit_gaussian_2D(
  data,
  comparison_method = "rmse",
  maxiter = 1000,
  simplify = TRUE
)

Arguments

data

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

comparison_method

One of "rmse", "rss", or "AIC"; what metric should be used to determine the "best-fitting" Gaussian?

maxiter

Default 1000. A positive integer specifying the maximum number of iterations allowed. See stats::nls.control() for more details.

simplify

TRUE or FALSE. If TRUE, return only the coefficients, model, model_error_stats, and fit_method for the best-fitting model. If FALSE, a model comparison table is also included in the returned list as $model_comparison. This table is obtained via compare_gaussian_fits().

Details

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 best-fitting, using the comparison_method argument to make the decision.

Value

If simplify = TRUE, a list with the components:

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().

Author(s)

Vikram B. Baliga

Examples

1
2
if (interactive()) {
}

gaussplotR documentation built on May 3, 2021, 1:07 a.m.