Hello, I'm trying to fit a two dimensional Gaussian function to many measured data points D(x,y,z) which x and y are position coordinates and z is the value of point (x,y). However there are some questions about data dimension.
I use "GSL nonlinear least squares fitting" to do the fitting. The two dimensional Gaussian G(x,y,p1,p2,...,pn) is matrix which p1,p2,..pn are parameters. However the f is gsl_vector * datatype in the function int (* f) (const gsl_vector * x, void * params, gsl_vector * f) of gsl_multifit_function_fdf. I'm wondering that if the nonlinear least squares fitting only can deal with one-dimensional data?? If data is higher dimensional, we need flat the higher-dimensional data into one dimension? for two dimensional Gaussian model, the Jacobian is a cube which is (x,y,p). However If we flat the higher-dimensional data into one dimension, when we fit the position parameter (x,y ...), Can I get the fitted parameters from nonlinear least squares fitting directly? Bests Li