0
votes

I would like to use some model function f(x) to fit my experimental data data.dat, which contain unwanted background (not included in model). I have (normalized) background data in the xy-type datafile bgr.dat Unfortunately, I can't subtract background directly, because I don't know exact magnitude of the background; my data contains background multiplied by constant const. Any idea how to redefine model function to include background and fit it like this?

fit f(x) `data.dat` via par1, par2,...,parN, const

par1, par2,...,parN are other parametres of the model

1
If you don't know the const-multiplier with which the (additive?) background noise is contained in your recorded data, you're in a world of trouble. If you have a model function, say ax**2 + bx + c and a white-noise-type background of unknown magnitude (multiplier) d, how would you distinguish between the absolute term contributions by c and d? - Daniel

1 Answers

0
votes

If your OS is Linux, you can use paste command to combine data.dat and bgr.dat into a new data file (new_data.dat). The new_data.dat should have four columns, then in gnuplot:

fit f(x) `new_data.dat` using 1:($2-const*$4) via par1,par2,...,parN, const

which subtracts the background multiplied by const on the fly.