Auto Gaussian & Gabor fits

版本 1.6.0.0 (12.4 KB) 作者: Patrick Mineault
Fit 1D/2D Gaussian or Gabor to a curve/surface without start guesses for params
3.4K 次下载
更新时间 2011/11/2

查看许可证

Auto Gaussian & Gabor Surface fit
---
Functions to fit a 1D Gaussian to a curve and a 2D Gaussian or Gabor to a surface. The routines are automatic in the sense that they do not require the specification of starting guesses for the model parameters. This is done by evaluating the quality of fit for many different choices of parameters then refining the most promising set of params through least-squares (exhaustive search followed by refinement).

All functions support 2 methods for computing error bars on the parameters: bootstrapping and MCMC.

autoGaussianSurf(xi,yi,zi) fits a 2D Gaussian to a surface, defined as:

zi = a*exp(-((xi-x0).^2/2/sigmax^2 + (yi-y0).^2/2/sigmay^2)) + b

It can also fit a tilted 2d Gaussian or isotropic 2d Gaussian.

autoGaborSurf(xi,yi,zi) fits a Gabor, defined as:

zi = a*exp(-(xip,.^2+yip.^2)/2/sigma^2)*cos(2*pi*xip/lambda + phase) + b

Where:
xip = (xi-x0)*cos(theta) + (yi-i0)*sin(theta);
yip =-(xi-x0)*sin(theta) + (yi-i0)*cos(theta);

The Gabor fit calls autoGaussianSurf internally, using the fact that the absolute value of a Gabor in the Fourier domain is a Gaussian.

autoGaussianCurve(xi,zi) fits a 1D Gaussian to a curve.

引用格式

Patrick Mineault (2024). Auto Gaussian & Gabor fits (https://www.mathworks.com/matlabcentral/fileexchange/31485-auto-gaussian-gabor-fits), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.6.0.0

Bug fixes in autoGaussianCurve, doFinalOptimization

1.5.0.0

Added Gaussian curve fitting. Added MCMC and bootstrap based error bars for every function. Added support for tilted Gaussian

1.4.0.0

Added Metropolis-Hastings method of estimating model params

1.3.0.0

Removed Gibbs sampling version of Gaussian surface fit (was unreliable). Added Gabor fitting. Changed function names. Uses better limits for sigmax, sigmay for Gaussian fit.

1.2.0.0

Added mex version of Gibbs sampler and basic convergence diagnostics for MCMC

1.0.0.0