Hello, I'm trying to use Mathematica to fit a function, but have an error, can someone tell me what the problem is?
I first define the data table that will be fitted.
xmdatapar =
ReadList["/home/roberto/F?ica/Pesquisa/<X^m>/kaon/lib/pares/xm_\
pares.dat", {Number}];
xmpardata = Table[{xmdatapar[[i, 1]]}, {i, 1, Length[xmdatapar]}]
{{0.243098}, {0.127303}, {0.0834994}, {0.0609518}, {0.0473757}, \
{0.0384113}, {0.0320716}, {0.027407}, {0.0237647}, {0.020894}, \
{0.0185901}, {0.0167308}, {0.0151393}, {0.013839}, {0.0127182}, \
{0.0117066}, {0.0108577}, {0.0101237}, {0.00948312}, {0.00887854}, \
{0.00834716}, {0.00788257}, {0.00746653}, {0.00705183}, {0.00669624}}
in the second place the function with the variables that I want to fit.
\[Phi]par[x_] :=
Npar*(x (1 - x))^
aRL\[Alpha]par (1 + \[Alpha]2RLpar*
GegenbauerC[2, \[Alpha]RLpar, (2 x - 1)]);
and finally I make the fit
fitpar = FindFit[
xmpardata, \[Phi]par, {Npar, aRL\[Alpha]par, \[Alpha]2RLpar}, x]
FindFit::fitc: Number of coordinates (0) is not equal to the number of variables (1).
FindFit[{{0.243098}, {0.127303}, {0.0834994}, {0.0609518}, \
{0.0473757}, {0.0384113}, {0.0320716}, {0.027407}, {0.0237647}, \
{0.020894}, {0.0185901}, {0.0167308}, {0.0151393}, {0.013839}, \
{0.0127182}, {0.0117066}, {0.0108577}, {0.0101237}, {0.00948312}, \
{0.00887854}, {0.00834716}, {0.00788257}, {0.00746653}, {0.00705183}, \
{0.00669624}}, \[Phi]par, {Npar, aRL\[Alpha]par, \[Alpha]2RLpar}, x]
Thanks.
Attachments: