sandialabs / InterSpec

spectral radiation analysis software
https://sandialabs.github.io/InterSpec
GNU Lesser General Public License v2.1
124 stars 20 forks source link

Uncertainties on parameters #29

Open Balthazar-Boma opened 5 months ago

Balthazar-Boma commented 5 months ago

Hello,

First of all, thanks for creating Interspec, one of the best programs I have seen to analyse gamma spec.

When i was filling in my DRF (which I derived from data fitting in Jupyter) as an equation, I didn't see the option to include the calculated individual uncertainty on each parameter (a0-a4). Ideally, I would have liked to include these for the calculation of the uncertainty on the activity later on. Am I just overlooking where to do this, or is this not possible at the moment?

Thank you so much in advance!

S.

wcjohns commented 5 months ago

Hi,

Thanks for asking this question! I've been thinking about things related to this recently.

The short of it is there is no way to enter the uncertainties into the GUI, and even if there was, they wouldn't be used.

I was initially planning on using these uncertainties, and you would think that they would be used, but I ran into a few things that need resolving, hopefully for v1.0.13:

For the moment, what you could do one of the following things:

Again, thanks for asking the question, and sorry I don't have a good solution for you yet. I'll leave this issue open until we hopefully resolve it for v1.0.13 (although it could be v1.0.14).

-will

Balthazar-Boma commented 5 months ago

Thanks for your quick answer! I will cross that bridge when I get to it, but the options don't seem too bad. Btw is it correct to add the statistical uncertainties in interspec together with the statistical uncertainty on the efficiency calculation due to the uncertainties on the parameters like you said in option 2? Wasn't sure about that. I would do it like this then:

image

Finally 2 small questions I had about interspec: - Whenever it asks for detector diameter: is it correct to assume that i need to convert the surface of my cubical detector into an equivalent circular surface of a spherical detector ( aka 1.13 cm diameter for a 1*1 square surface?) - When calculating activity: does interspec calculate a weighted average of the activities corresponding to each peak for the eventual result?

Kind regards, S.

wcjohns commented 5 months ago

Hello again,

I believe you are correct on the uncertainty formula, and you are correct for converting the detector surface area to a diameter.

For the simple case of fitting an activity with not fitting shielding thickness, sources not interfering with each other, and not fitting an age, the final activity should be the weighted average from each of the peaks, where weights are determined by the peak uncertainties. However, once you start fitting for shielding using multiple nuclides, or age, or more than one nuclide is contributing to peaks, or background subtracting peaks, it's probably a little more complicated. InterSpec minimizes a chi2 function that takes into account all the effects between these things, so the activity you get out is the one that minimizes this chi2 (and so is the best estimate of the true answer we can get), but will not necessarily be the weighted average from each of the peaks (but most of the time I would guess it will still be pretty close probably).

If you have more specific questions, suggestions, or are having trouble with a specific step or anything, you are more than welcome to email InterSpec@sandia.gov.

Thanks for opening this issue, and providing some nice feedback - it will be taken into account, -will