2
$\begingroup$

I am kinda new to Mathematica and I have some basic questions. I need to find the best fit curve for a set of data. Here's the data:

    data1 = {{5.095394399615566`*^-11, 
    221592.93606333656`}, {5.175438872751551`*^-11, 
    1418.2592685868801`}, {5.255483345887536`*^-11, 
    180.36535785522187`}, {5.335527819023521`*^-11, 
    57.78186440272107`}, {5.4155722921595055`*^-11, 
    28.471203122045367`}, {5.495616765295491`*^-11, 
    17.64444756164996`}, {5.5756612384314755`*^-11, 
    12.479906758697593`}, {5.65570571156746`*^-11, 
    9.574931076706036`}, {5.7357501847034454`*^-11, 
    7.7461647030921075`}, {5.81579465783943`*^-11, 
    6.498661228416742`}, {5.895839130975415`*^-11, 
    5.595759399624425`}, {5.9758836041114`*^-11, 
    4.912245837241986`}, {6.055928077247385`*^-11, 
    4.376431621076272`}, {6.135972550383369`*^-11, 
    3.9446016652474`}, {6.216017023519355`*^-11, 
    3.588694947456349`}, {6.29606149665534`*^-11, 
    3.289917393392387`}, {6.376105969791324`*^-11, 
    3.0352250485945325`}, {6.456150442927309`*^-11, 
    2.8152869327067567`}, {6.536194916063294`*^-11, 
    2.6232528415371474`}, {6.616239389199278`*^-11, 
    2.4539797111397714`}, {6.696283862335264`*^-11, 
    2.30352986792074`}, {6.776328335471249`*^-11, 
    2.1688362159395167`}, {6.856372808607233`*^-11, 
    2.047473128812804`}, {6.936417281743218`*^-11, 
    1.937496127951711`}, {7.016461754879204`*^-11, 
    1.8373274283575256`}, {7.096506228015188`*^-11, 
    1.7456727467120015`}, {7.176550701151173`*^-11, 
    1.6614598423826141`}, {7.256595174287158`*^-11, 
    1.5837924397392111`}, {7.336639647423142`*^-11, 
    1.5119152153834552`}, {7.416684120559128`*^-11, 
    1.4451868646156196`}, {7.496728593695113`*^-11, 
    1.3830591481970886`}, {7.576773066831097`*^-11, 
    1.3250604217076631`}, {7.656817539967082`*^-11, 
    1.2707825640480017`}, {7.736862013103067`*^-11, 
    1.2198705112768415`}, {7.816906486239053`*^-11, 
    1.1720138073421555`}, {7.896950959375038`*^-11, 
    1.1269397306544722`}, {7.976995432511022`*^-11, 
    1.084407662577183`}, {8.057039905647006`*^-11, 
    1.0442044425779882`}, {8.137084378782993`*^-11, 
    1.0061405131879546`}, {8.217128851918977`*^-11, 
    0.9700467016695216`}, {8.29717332505496`*^-11, 
    0.9357715184024515`}, {8.377217798190947`*^-11, 
    0.903178877236555`}, {8.457262271326931`*^-11, 
    0.8721461624747224`}, {8.537306744462916`*^-11, 
    0.8425625821904257`}, {8.617351217598902`*^-11, 
    0.814327759321539`}, {8.697395690734886`*^-11, 
    0.7873505212046772`}, {8.77744016387087`*^-11, 
    0.7615478555071276`}, {8.857484637006856`*^-11, 
    0.7368440063159101`}, {8.93752911014284`*^-11, 
    0.7131696887869516`}, {9.017573583278826`*^-11, 
    0.6904614044939441`}, {9.097618056414811`*^-11, 
    0.6686608426391558`}, {9.177662529550795`*^-11, 
    0.6477143547458817`}, {9.25770700268678`*^-11, 
    0.6275724924597701`}, {9.337751475822766`*^-11, 
    0.6081895997337226`}, {9.41779594895875`*^-11, 
    0.5895234520290247`}, {9.497840422094735`*^-11, 
    0.5715349362892934`}, {9.57788489523072`*^-11, 
    0.5541877663779555`}, {9.657929368366704`*^-11, 
    0.5374482294495846`}, {9.737973841502688`*^-11, 
    0.5212849593747402`}, {9.818018314638675`*^-11, 
    0.5056687338959169`}, {9.898062787774659`*^-11, 
    0.4905722926381131`}, {9.978107260910644`*^-11, 
    0.47597017350513315`}, {1.0058151734046629`*^-10, 
    0.4618385653145305`}, {1.0138196207182613`*^-10, 
    0.4481551748099921`}, {1.0218240680318599`*^-10, 
    0.4348991064305685`}, {1.0298285153454584`*^-10, 
    0.42205075342260656`}, {1.0378329626590568`*^-10, 
    0.40959169905744197`}, {1.0458374099726553`*^-10, 
    0.3975046268704663`}, {1.0538418572862538`*^-10, 
    0.3857732389687203`}, {1.0618463045998522`*^-10, 
    0.3743821815681021`}, {1.0698507519134509`*^-10, 
    0.3633169770199247`}, {1.0778551992270493`*^-10, 
    0.3525639616723639`}, {1.0858596465406478`*^-10, 
    0.3421102289870661`}, {1.0938640938542464`*^-10, 
    0.3319435773964021`}, {1.1018685411678448`*^-10, 
    0.3220524624439043`}, {1.1098729884814433`*^-10, 
    0.31242595280043206`}, {1.1178774357950417`*^-10, 
    0.30305368979253045`}, {1.1258818831086402`*^-10, 
    0.2939258501180877`}, {1.1338863304222388`*^-10, 
    0.2850331114584601`}, {1.1418907777358372`*^-10, 
    0.27636662072630314`}, {1.1498952250494357`*^-10, 
    0.2679179647150094`}, {1.1578996723630341`*^-10, 
    0.25967914293917227`}, {1.1659041196766325`*^-10, 
    0.25164254247648143`}, {1.1739085669902311`*^-10, 
    0.24380091464004972`}, {1.1819130143038298`*^-10, 
    0.23614735332675174`}, {1.1899174616174282`*^-10, 
    0.22867527490191852`}, {1.1979219089310266`*^-10, 
    0.22137839949398197`}, {1.2059263562446253`*^-10, 
    0.21425073358439706`}, {1.2139308035582237`*^-10, 
    0.20728655378885152`}, {1.221935250871822`*^-10, 
    0.20048039173513388`}, {1.2299396981854207`*^-10, 
    0.19382701995170093`}, {1.237944145499019`*^-10, 
    0.18732143868849516`}, {1.2459485928126175`*^-10, 
    0.1809588635985957`}, {1.2539530401262162`*^-10, 
    0.17473471421543652`}, {1.2619574874398143`*^-10, 
    0.1686446031659563`}, {1.269961934753413`*^-10, 
    0.16268432606513406`}, {1.2779663820670116`*^-10, 
    0.15684985204196078`}, {1.28597082938061`*^-10, 
    0.15113731485103488`}, {1.2939752766942084`*^-10, 
    0.14554300452775681`}, {1.301979724007807`*^-10, 
    0.14006335954856963`}, {1.3099841713214055`*^-10, 
    0.13469495946069543`}, {1.317988618635004`*^-10, 
    0.12943451794878147`}, {1.3259930659486026`*^-10, 
    0.12427887630835555`}, {1.3339975132622007`*^-10, 
    0.11922499729839053`}, {1.3420019605757994`*^-10, 
    0.1142699593473977`}, {1.350006407889398`*^-10, 
    0.10941095108945076`}, {1.3580108552029964`*^-10, 
    0.1046452662083297`}, {1.3660153025165948`*^-10, 
    0.09997029856958628`}, {1.3740197498301935`*^-10, 
    0.09538353762188789`}, {1.3820241971437919`*^-10, 
    0.09088256405032613`}, {1.3900286444573903`*^-10, 
    0.0864650456659457`}, {1.398033091770989`*^-10, 
    0.08212873351489902`}, {1.4060375390845873`*^-10, 
    0.07787145819775398`}, {1.4140419863981857`*^-10, 
    0.07369112638033126`}, {1.4220464337117844`*^-10, 
    0.06958571748851083`}, {1.4300508810253828`*^-10, 
    0.06555328057416032`}, {1.4380553283389812`*^-10, 
    0.06159193134217045`}, {1.4460597756525798`*^-10, 
    0.057699849328957775`}, {1.454064222966178`*^-10, 
    0.05387527522349567`}, {1.4620686702797766`*^-10, 
    0.05011650832249526`}, {1.4700731175933753`*^-10, 
    0.046421904111937806`}, {1.4780775649069737`*^-10, 
    0.042789871967679804`}, {1.486082012220572`*^-10, 
    0.0392188729683185`}, {1.4940864595341708`*^-10, 
    0.03570741781395004`}, {1.5020909068477692`*^-10, 
    0.03225406484486637`}, {1.5100953541613676`*^-10, 
    0.028857418154628167`}, {1.5180998014749662`*^-10, 
    0.025516125792270028`}, {1.526104248788565`*^-10, 
    0.022228878048787593`}, {1.534108696102163`*^-10, 
    0.0189944058232685`}, {1.5421131434157617`*^-10, 
    0.015811479064405276`}, {1.55011759072936`*^-10, 
    0.012678905283348474`}, {1.5581220380429585`*^-10, 
    0.009595528134082265`}, {1.5661264853565571`*^-10, 
    0.006560226057792828`}, {1.5741309326701558`*^-10, 
    0.003571910987858473`}, {1.582135379983754`*^-10, 
    0.0006295271123315516`}, {1.5901398272973526`*^-10, \
-0.002267950309073008`}, {1.598144274610951`*^-10, \
-0.005121516076247445`}, {1.6061487219245494`*^-10, \
-0.007932136130866407`}, {1.614153169238148`*^-10, \
-0.01070074859192438`}, {1.6221576165517465`*^-10, \
-0.013428264746988106`}, {1.6301620638653449`*^-10, \
-0.0161155700013369`}, {1.6381665111789435`*^-10, \
-0.01876352478710208`}, {1.6461709584925422`*^-10, \
-0.021372965434321767`}, {1.6541754058061406`*^-10, \
-0.02394470500581125`}, {1.662179853119739`*^-10, \
-0.02647953409753967`}, {1.6701843004333374`*^-10, \
-0.028978221606220878`}, {1.678188747746936`*^-10, \
-0.03144151546563778`}, {1.6861931950605344`*^-10, \
-0.03387014335319316`}, {1.694197642374133`*^-10, \
-0.03626481336809828`}, {1.7022020896877312`*^-10, \
-0.03862621468248584`}, {1.71020653700133`*^-10, \
-0.04095501816674396`}, {1.7182109843149283`*^-10, \
-0.04325187699022637`}, {1.726215431628527`*^-10, \
-0.0455174271984653`}, {1.7342198789421253`*^-10, \
-0.04775228826797795`}, {1.7422243262557237`*^-10, \
-0.0499570636396478`}, {1.7502287735693221`*^-10, \
-0.05213234123165833`}, {1.7582332208829208`*^-10, \
-0.054278693932880095`}, {1.7662376681965192`*^-10, \
-0.05639668007758303`}, {1.7742421155101179`*^-10, \
-0.05848684390228964`}, {1.7822465628237163`*^-10, \
-0.06054971598554415`}, {1.7902510101373147`*^-10, \
-0.06258581367135108`}, {1.7982554574509133`*^-10, \
-0.06459564147697883`}, {1.8062599047645117`*^-10, \
-0.06657969148579657`}, {1.8142643520781104`*^-10, \
-0.0685384437257901`}, {1.8222687993917085`*^-10, \
-0.07047236653434741`}, {1.8302732467053072`*^-10, \
-0.07238191690991425`}, {1.8382776940189056`*^-10, \
-0.07426754085104426`}, {1.8462821413325042`*^-10, \
-0.07612967368338897`}, {1.8542865886461026`*^-10, \
-0.07796874037510193`}, {1.862291035959701`*^-10, \
-0.07978515584116819`}, {1.8702954832732997`*^-10, \
-0.08157932523706046`}, {1.878299930586898`*^-10, \
-0.08335164424221064`}, {1.8863043779004968`*^-10, \
-0.08510249933366465`}, {1.8943088252140952`*^-10, \
-0.08683226805033817`}, {1.9023132725276936`*^-10, \
-0.08854131924823072`}, {1.910317719841292`*^-10, \
-0.0902300133469831`}, {1.9183221671548906`*^-10, \
-0.0918987025680833`}, {1.926326614468489`*^-10, \
-0.09354773116508674`}, {1.9343310617820877`*^-10, \
-0.09517743564611703`}, {1.942335509095686`*^-10, \
-0.09678814498900357`}, {1.9503399564092845`*^-10, \
-0.09838018084928457`}, {1.958344403722883`*^-10, \
-0.09995385776138122`}, {1.9663488510364815`*^-10, \
-0.10150948333319665`}, {1.97435329835008`*^-10, \
-0.10304735843438673`}, {1.9823577456636786`*^-10, \
-0.10456777737853873`}, {1.990362192977277`*^-10, \
-0.1060710280994881`}, {1.9983666402908754`*^-10, \
-0.10755739232200678`}, {2.006371087604474`*^-10, \
-0.10902714572703642`}, {2.0143755349180725`*^-10, \
-0.11048055811171276`}, {2.022379982231671`*^-10, \
-0.1119178935443319`}, {2.0303844295452693`*^-10, \
-0.1133394105144725`}, {2.038388876858868`*^-10, \
-0.11474536207843089`}, {2.0463933241724663`*^-10, \
-0.11613599600015156`}, {2.054397771486065`*^-10, \
-0.11751155488780496`}, {2.0624022187996634`*^-10, \
-0.1188722763261767`}, {2.0704066661132618`*^-10, \
-0.1202183930050067`}, {2.0784111134268604`*^-10, \
-0.12155013284343985`}, {2.0864155607404588`*^-10, \
-0.12286771911069971`}};

I have used FindFit with the functions of the form:

FindFit[data, {b*x^a}, {a, b}, x, MaxIterations -> 1000]

and

FindFit[data, {a/x^2}, {a}, x, MaxIterations -> 10000]

But I still can't find the best fitting curve for the data. Any help is appreciated. Also is there a way to measure the accuracy of my fitting to the data using Mathematica commands? Thank you!

$\endgroup$

1 Answer 1

3
$\begingroup$

The scaling of your data1is very poor( x-values O[10^-10])!

Logarithmization (y==b x^-a-> Log[y]==Log[b]-a Log[x] helps to find a numerical solution:

logxlogy = Map[{Log[#[[1]]], Log[#[[2]]]} &, data1];

fit = FindFit[logxlogy, {logb - a logx}, {a, logb}, logx,Method -> "NMinimize"]
Show[ListPlot[data1], 
 Plot[Evaluate[b x^-a /. {b -> Exp[logb] } /. fit], {x,Min[data1[[All, 1]]], Max[data1[[All, 1]]]}]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.