I have a series of data sets with which I would like to fit a model function to simultaneously. In each data set, I have coordinates $\left\{x,y\right\}$ and an error bar for $y$. The data sets are
MasData1 = {{{89, 6.7}, ErrorBar[1.272]}, {{112, 7.9}, ErrorBar[1.220]}, {{141, 9.3},ErrorBar[1.697]}}
MasData2 = {{{83.9, 4.04}, ErrorBar[0.7754]}, {{114.1, 5.29},ErrorBar[1.086]}, {{144.2, 6.1},ErrorBar[1.681]}}
MasData3 = {{{62, 16.6}, ErrorBar[2.6172]}, {{85, 20.7},ErrorBar[3.0809]}, {{108, 21.9}, ErrorBar[3.0647]}, {{135, 25.8},ErrorBar[3.9115]}, {{183, 33.2}, ErrorBar[5.993]}, {{83.9, 14.5},ErrorBar[2.772]}, {{114.1, 24.7}, ErrorBar[4.5875]}, {{144.2, 24.1},ErrorBar[6.5756]}}
MasData4 = {{{53.3, 25.1}, ErrorBar[3.5489]}, {{83.9, 30},ErrorBar[4.309]}, {{114.1, 41.5}, ErrorBar[6.1404]}, {{144.2, 45},ErrorBar[9.6243]}, {{57, 24.4}, ErrorBar[3.6056]}, {{80, 36.7},ErrorBar[7.9925]}, {{101, 43}, ErrorBar[6.6138]}, {{128, 48.8},ErrorBar[9.1001]}, {{180, 61.1},ErrorBar[10.5575]}}
MasData5 = {{{44.8, 47.5}, ErrorBar[4.0]}, {{54.8, 50.1},ErrorBar[4.2]}, {{64.8, 61.7}, ErrorBar[5.1]}, {{74.8, 64.8},ErrorBar[5.5]}, {{84.9, 75}, ErrorBar[6.2]}, {{94.9, 81.2},ErrorBar[6.7]}, {{104.9, 85.3}, ErrorBar[7.1]}, {{119.5, 94.5},ErrorBar[7.5]}, {{144.1, 101.5}, ErrorBar[8.3]}, {{144.9, 101.9},ErrorBar[10.9]}, {{162.5, 117.8}, ErrorBar[12.8]}, {{177.3, 130.2}, ErrorBar[13.4]}, {{194.8, 147.7}, ErrorBar[17.1]}, {{60, 55.8},ErrorBar[4.838]}, {{80, 66.6}, ErrorBar[7.280]}, {{100, 73.4},ErrorBar[6.426]}, {{120, 86.7}, ErrorBar[7.245]}, {{140, 104},ErrorBar[12.083]}, {{160, 110}, ErrorBar[16.279]}, {{42.5, 43.8},ErrorBar[3.482]}, {{55, 57.2}, ErrorBar[3.980]}, {{65, 62.5},ErrorBar[4.614]}, {{75, 68.9}, ErrorBar[5.197]}, {{85, 72.1},ErrorBar[5.523]}, {{100, 81.9}, ErrorBar[5.368]}, {{117.5, 95.7},ErrorBar[6.277]}, {{132.5, 103.9},ErrorBar[6.912]}, {{155, 115.7}, ErrorBar[7.920]}, {{185, 129.1}, ErrorBar[9.192]}, {{215, 141.7}, ErrorBar[10.666]}, {{245, 140.3}, ErrorBar[14.526]}, {{275, 189}, ErrorBar[24.274]}, {{49, 39.2},ErrorBar[10]}, {{86, 75.7}, ErrorBar[14.414]}, {{167, 118},ErrorBar[22.828]}, {{43.2, 50.7}, ErrorBar[1.5]}, {{50, 59.5},ErrorBar[1.4]}, {{57.3, 61.8}, ErrorBar[1.9]}, {{65.3, 67.6},ErrorBar[1.7]}, {{73.9, 72.4}, ErrorBar[1.9]}, {{83.2, 79.9},ErrorBar[2.3]}, {{93.3, 84.4}, ErrorBar[2.1]}, {{104.3, 86.7},ErrorBar[2.7]}, {{47.9, 55.4}, ErrorBar[2.1]}, {{68.4, 66.4},ErrorBar[2.9]}}
Now, I wish to fit the model function
f1[x_] = NN*x^(-a-b*Log[q/0.45])
to the data sets simultaneously. Each data set corresponds to a particular value of q. In MasData1 q = 6.4025, in MasData2 q = 8.0025, in MasData3 q=4.1525, in MasData4 q=3.2025 and in MasData5 q = 2.4025. So for a given data set, the model function to be fitted is a function of $NN, a,b$ and $x$. The set $\left\{NN,a,b\right\}$ constitutes the parameters which I would like to find a best estimate for through the minimisation of a $\chi^2$
My attempt so far is to find a chi-square function for each data set but I am not sure how to minimise them all simultaneously.
f1[x_] = NN*x^(-a - b*Log[y1/0.45]) /. y1 -> 6.4025
chisq1 = Sum[((MasData1[[k]][[1]][[2]] - f1[MasData1[[k]][[1]][[1]]])/MasData1[[k]][[2]][[1]])^2, {k, 1, Length[MasData1]}]
f2[x_] = NN*x^(-a - b*Log[y2/0.45]) /. y2 -> 8.0025
chisq2 = Sum[((MasData2[[k]][[1]][[2]] - f2[MasData2[[k]][[1]][[1]]])/MasData2[[k]][[2]][[1]])^2, {k, 1, Length[MasData2]}]
f3[x_] = NN*x^(-a - b*Log[y3/0.45]) /. y3 -> 4.1525
chisq3 = Sum[((MasData3[[k]][[1]][[2]] - f3[MasData3[[k]][[1]][[1]]])/MasData3[[k]][[2]][[1]])^2/5, {k, 1, Length[MasData3]}]
f4[x_] = NN*x^(-a - b*Log[y4/0.45]) /. y4 -> 3.2025
chisq4 = Sum[((MasData4[[k]][[1]][[2]] - f4[MasData4[[k]][[1]][[1]]])/MasData4[[k]][[2]][[1]])^2/6, {k, 1, Length[MasData4]}]
f5[x_] = NN*x^(-a - b*Log[y5/0.45]) /. y5 -> 2.4025
chisq5 = Sum[((MasData5[[k]][[1]][[2]] - f5[MasData5[[k]][[1]][[1]]])/MasData5[[k]][[2]][[1]])^2/42, {k, 1, Length[MasData5]}]
Then I would like to find one set of values for NN,a,b that are the best estimate parameters of the model function describing all the data points. How to do this in mathematica?
Thanks!


