Estimate properties of noise by fitting a Gaussian to a histogram of intensities
noise_estimate(
x,
height = TRUE,
thresh = 10,
plot_distributions = TRUE,
peak_intensities = NULL
)
numeric values for which to estimate noise.
logical indicating whether to use Gaussian function whose area is not fixed at one because of an additional height scaling factor.
numeric value specifying the factor by which to multiply the standard deviation to determine the threshold away from the mean value within which to include values for the next iteration and final histogram for fitting.
logical indicating whether to plot the distribution and Gaussian fit used to estimate the noise.
numeric values of peak intensities to determine the signal to noise.
a named numeric vector with values:
mean value from the Gaussian fit
standard deviation from the Gaussian fit
height of Gaussian fit (optional depending on value of height
parameter)
maximum value of x
This function estimates noise using iterative calculation of the mean and standard deviation, followed by fitting a Gaussian function to a histogram of the values within a range determined at the end of the iterations.
The iterative algorithm first calculates the mean and standard deviation of the values in x
. In the next iteration, only points within thresh
times the standard deviation of the mean value are used for calculating a new mean and standard deviation. This is repeated 20 times. A histogram with 512 bins is then computed within a range determined from the final mean and standard deviation. The returned parameters are based on a Gaussian fit to this histogram.