You would provide the t_i values in the "struct data" parameter in that example. So you could add another array: double * t; into struct data and supply your t values in there.

Patrick

On 12/10/2015 11:06 AM, Xeelee Xeelee wrote:
Hi,

I need to fit a data set in the form of { t ,f(t) }
(t is the argument f(t) is the value of function at t):

t_0, y_0
t_1,  y_1
...  ,  ...
t_n,  y_n

but the t_i is not equally spaced, e.g.
T_my = {t_0, t_1, t_2, ...} = {0.1, 0.2, 0.4, 0.45, 0.7, 1.1, 1.21, ...}

In the example program:
http://www.gnu.org/software/gsl/manual/gsl-ref.html#Example-programs-for-Nonlinear-Least_002dSquares-Fitting

The input data is simply in the form
T_eg = {t_0, t_1, t_2, ...} = {0, 1, 2, 3, 4, 5, 6, 7, ....}
and {y_0,....,y_n}

Is there any place to provide T_my to the fitting program?

Thanks a lot,

X.N.


Reply via email to