Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncertainties on parameters #29

Open
Balthazar-Boma opened this issue Apr 8, 2024 · 3 comments
Open

Uncertainties on parameters #29

Balthazar-Boma opened this issue Apr 8, 2024 · 3 comments

Comments

@Balthazar-Boma
Copy link

Balthazar-Boma commented Apr 8, 2024

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
Copy link
Collaborator

wcjohns commented Apr 8, 2024

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:

  • The statistical uncertainties for characterization data is usually very small, so this doesn't contribute a notable amount of uncertainty for data I typically analyze, so it was adding potential problems for not a lot of benefit - however, this is definitely not the case for everyone, so is not a valid excuse to just ignore these uncertainties.
  • Usually the systematic error is larger than the statistical uncertainty. To account for this, we plan on adding an energy dependent systematic uncertainty, with some work being planned on help guiding what this systematic error should be, including for individual peak fits (so far as I know, in other spectroscopy programs, people mostly just use some standard values, as a function of energy, which is not very satisfying, and can hopefully be improved on).
  • The coefficient uncertainties are not quite enough - the full covariance matrix is needed, or else the uncertainties can give kinda nonsensical answers. I plan to update to track this matrix, instead of just the uncertainties. This will also be nice to apply the energy dependent correlations of uncertainty during activity/shielding fits.

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

  • Manually add the efficiency uncertainties onto the individual peak uncertainties, using the Peak Editor. The peak area uncertainties are used during fitting, with the initial values being the statistical uncertainties of the peak fits.
  • At the end, add the efficiency and other systematic uncertainties to your answers statistical uncertainty (probably what people usually do).
  • Or, if you are not fitting for shielding thickness or ages, you could export your peaks to CSV, and export the nuclides gamma branching ratios to CSV, and then fit for activities in Jupyter - less than ideal, but maybe not terrible to do. If you are fitting for shielding thicknesses, or nuclide ages, this becomes a lot more cumbersome.

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
Copy link
Author

Balthazar-Boma commented Apr 9, 2024

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
Copy link
Collaborator

wcjohns commented Apr 9, 2024

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 [email protected].

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants