Sorry, I've never used Mathematica before, so I do not know many things,
I have a dat with the first 25 even Gegenbauer polynomials of second order for fit,
I fix the table
xmdatapar =
ReadList["/home/roberto/F?ica/Pesquisa/<X^m>/kaon/lib/pares/xm_\
pares.dat", {Number, Number}];
xmpardata =
Table[{xmdatapar[[i, 1]], xmdatapar[[i, 2]]}, {i, 1,
Length[xmdatapar]}]
{{2, 0.243098}, {4, 0.127303}, {6, 0.0834994}, {8, 0.0609518}, {10,
0.0473757}, {12, 0.0384113}, {14, 0.0320716}, {16, 0.027407}, {18,
0.0237647}, {20, 0.020894}, {22, 0.0185901}, {24, 0.0167308}, {26,
0.0151393}, {28, 0.013839}, {30, 0.0127182}, {32, 0.0117066}, {34,
0.0108577}, {36, 0.0101237}, {38, 0.00948312}, {40,
0.00887854}, {42, 0.00834716}, {44, 0.00788257}, {46,
0.00746653}, {48, 0.00705183}, {50, 0.00669624}}
where the first value is the first term sum of even numbers
2,4,6,8,10...50 and the second value is a x moments,
i need to fit this function
In[86]:= \[Phi]par :=
Npar*(x (1 - x))^
aRL\[Alpha]par (1 + \[Alpha]2RLpar*
GegenbauerC[2, \[Alpha]RLpar, (2 x - 1)]);
where phi is related to this integral
F[m_] := NIntegrate[(2*x - 1)^m (\[Phi]par[x] ), {x,
0, 1}]
where m = 2,4,6,8,10,12...
so how I can do this ??
In[89]:= fitpar =
FindFit[xmpardata, {\[Phi]par}, {Npar,
aRL\[Alpha]par, \[Alpha]2RLpar}, {x}]
During evaluation of In[89]:= FindFit::nrlnum: The function value {-0.243098-2. (1. +1. (-1. \[Alpha]RLpar+18. \[Alpha]RLpar Plus[<<2>>])),-0.127303-12. (1. +1. (-1. \[Alpha]RLpar+98. \[Alpha]RLpar Plus[<<2>>])),<<22>>,-0.00669624-2450. (1. +1. (-1. \[Alpha]RLpar+19602. \[Alpha]RLpar Plus[<<2>>]))} is not a list of real numbers with dimensions {25} at {Npar,aRL\[Alpha]par,\[Alpha]2RLpar} = {1.,1.,1.}.
During evaluation of In[89]:= FindFit::nrlnum: The function value {-0.243098-2. (1. +1. (-1. \[Alpha]RLpar+18. \[Alpha]RLpar Plus[<<2>>])),-0.127303-12. (1. +1. (-1. \[Alpha]RLpar+98. \[Alpha]RLpar Plus[<<2>>])),<<22>>,-0.00669624-2450. (1. +1. (-1. \[Alpha]RLpar+19602. \[Alpha]RLpar Plus[<<2>>]))} is not a list of real numbers with dimensions {25} at {Npar,aRL\[Alpha]par,\[Alpha]2RLpar} = {1.,1.,1.}.
Out[89]= FindFit[{{2, 0.243098}, {4, 0.127303}, {6, 0.0834994}, {8,
0.0609518}, {10, 0.0473757}, {12, 0.0384113}, {14, 0.0320716}, {16,
0.027407}, {18, 0.0237647}, {20, 0.020894}, {22, 0.0185901}, {24,
0.0167308}, {26, 0.0151393}, {28, 0.013839}, {30, 0.0127182}, {32,
0.0117066}, {34, 0.0108577}, {36, 0.0101237}, {38,
0.00948312}, {40, 0.00887854}, {42, 0.00834716}, {44,
0.00788257}, {46, 0.00746653}, {48, 0.00705183}, {50,
0.00669624}}, {Npar ((1 - x) x)^
aRL\[Alpha]par (1 + \[Alpha]2RLpar (-\[Alpha]RLpar +
2 (-1 + 2 x)^2 \[Alpha]RLpar (1 + \[Alpha]RLpar)))}, {Npar,
aRL\[Alpha]par, \[Alpha]2RLpar}, {x}]
Thanks.