How good are the fit uncertainty estimates?
This document looks at two different sets of measured spectra to evaluate how well, the estimated fit uncertainties match the observed uncertainties. We are using two materials known to be highly homogeneous - K412 and ADM-6006a glasses. To produce a set of spectra that differ only in count statistics, we will subdivide a spectrum into 100 spectra with an effective live-time of 0.01 of the original spectrum livetime. We expect that we should be able to compare the "fit-predicted" uncertainties with the "observed distribution" of measured values.
To be clear:
- "fit-predicted" - Comes from the covariance matrix output from the linear least squares fit
- "observed distribution" - Calculated as the standard-deviation of the 100 fit values.
We want the ratio of the (observed distribution) / (fit predicted) to be unity or close. We will call this ratio the "heterogeneity" (or "hetero" in the fourth column of the describe(....)
table.)
We then repeat the process on the multiple measured unknown spectra. (4 for K412 and 15 for ADM-6005a) We expect the heterogeneity to be one or larger - larger than unity when the sample is not perfectly homogeneous.
using NeXLSpectrum # Provides spectrum reading and fitting tools
using NeXLMatrixCorrection # Provides `quant` to convert k-ratios to mass fraction.
using DataFrames # Tables
using Latexify
using BenchmarkTools
K412
Load the spectra, define the fit model and apply it.
path = joinpath(@__DIR__,"K412 spectra")
unks = map(0:4) do i
loadspectrum(joinpath(path, "III-E K412[$i][4].msa"))
end
det = matching(unks[1], 132.0, 10)
frs = references( [
reference(n"Al", joinpath(path, "Al2O3 std.msa"), mat"Al2O3"),
reference(n"Mg", joinpath(path, "MgO std.msa"), mat"MgO"),
reference(n"Fe", joinpath(path, "Fe std.msa"), mat"Fe"),
reference(n"Si", joinpath(path, "SiO2 std.msa"), mat"SiO2"),
reference(n"O", joinpath(path, "SiO2 std.msa"), mat"SiO2"),
reference(n"Ca", joinpath(path, "CaF2 std.msa") ,mat"CaF2")
], det)
# frs is now a FilteredReference[] used to fit the unknowns.
# Split the counts in unks[1] into 100 randomized spectra which will sum to unks[1] then fit them
res = map(subdivide(unks[1], 100)) do s
fit_spectrum(s, frs)
end
100-element Vector{FilterFitResult{Float64}}:
FitResult(Sub[III-E K412[0][all],1 of 100])
FitResult(Sub[III-E K412[0][all],2 of 100])
FitResult(Sub[III-E K412[0][all],3 of 100])
FitResult(Sub[III-E K412[0][all],4 of 100])
FitResult(Sub[III-E K412[0][all],5 of 100])
FitResult(Sub[III-E K412[0][all],6 of 100])
FitResult(Sub[III-E K412[0][all],7 of 100])
FitResult(Sub[III-E K412[0][all],8 of 100])
FitResult(Sub[III-E K412[0][all],9 of 100])
FitResult(Sub[III-E K412[0][all],10 of 100])
⋮
FitResult(Sub[III-E K412[0][all],92 of 100])
FitResult(Sub[III-E K412[0][all],93 of 100])
FitResult(Sub[III-E K412[0][all],94 of 100])
FitResult(Sub[III-E K412[0][all],95 of 100])
FitResult(Sub[III-E K412[0][all],96 of 100])
FitResult(Sub[III-E K412[0][all],97 of 100])
FitResult(Sub[III-E K412[0][all],98 of 100])
FitResult(Sub[III-E K412[0][all],99 of 100])
FitResult(Sub[III-E K412[0][all],100 of 100])
Spectra | k[O K-L3 + 1 other, SiO2] | Δk[O K-L3 + 1 other, SiO2] | k[Fe L3-M5 + 13 others, Fe] | Δk[Fe L3-M5 + 13 others, Fe] | k[Mg K-L3 + 1 other, MgO] | Δk[Mg K-L3 + 1 other, MgO] | k[Al K-L3 + 3 others, Al2O3] | Δk[Al K-L3 + 3 others, Al2O3] | k[Si K-L3 + 3 others, SiO2] | Δk[Si K-L3 + 3 others, SiO2] | k[Ca K-L3 + 3 others, CaF2] | Δk[Ca K-L3 + 3 others, CaF2] | k[Fe K-L3 + 1 other, Fe] | Δk[Fe K-L3 + 1 other, Fe] | k[Fe K-M3 + 3 others, Fe] | Δk[Fe K-M3 + 3 others, Fe] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sub[III-E K412[0][all],1 of 100] | 0.6538 | 0.008075 | 0.04216 | 0.004438 | 0.1486 | 0.001831 | 0.06437 | 0.001571 | 0.3557 | 0.002884 | 0.1909 | 0.002319 | 0.0677 | 0.001574 | 0.07131 | 0.00691 |
Sub[III-E K412[0][all],2 of 100] | 0.6438 | 0.00806 | 0.03981 | 0.00439 | 0.1472 | 0.001839 | 0.06625 | 0.001587 | 0.3473 | 0.002888 | 0.1908 | 0.002321 | 0.06497 | 0.001596 | 0.073 | 0.006727 |
Sub[III-E K412[0][all],3 of 100] | 0.643 | 0.008088 | 0.04069 | 0.004437 | 0.1462 | 0.001828 | 0.06738 | 0.001598 | 0.3563 | 0.002901 | 0.1951 | 0.002316 | 0.06883 | 0.001594 | 0.05761 | 0.006545 |
Sub[III-E K412[0][all],4 of 100] | 0.6714 | 0.008175 | 0.04573 | 0.00429 | 0.1496 | 0.001837 | 0.0683 | 0.001591 | 0.3477 | 0.00289 | 0.1964 | 0.002324 | 0.06634 | 0.001584 | 0.05444 | 0.006681 |
Sub[III-E K412[0][all],5 of 100] | 0.6611 | 0.008078 | 0.0373 | 0.004324 | 0.1454 | 0.00183 | 0.06489 | 0.001577 | 0.3503 | 0.002872 | 0.1926 | 0.002342 | 0.06801 | 0.001598 | 0.0684 | 0.006855 |
Sub[III-E K412[0][all],6 of 100] | 0.6523 | 0.008134 | 0.04701 | 0.004395 | 0.1464 | 0.001825 | 0.06598 | 0.001587 | 0.3478 | 0.002876 | 0.1954 | 0.002336 | 0.06984 | 0.001604 | 0.06209 | 0.006645 |
Sub[III-E K412[0][all],7 of 100] | 0.6589 | 0.008152 | 0.04621 | 0.004409 | 0.1471 | 0.001827 | 0.06625 | 0.001586 | 0.3484 | 0.002898 | 0.1913 | 0.002328 | 0.06743 | 0.001609 | 0.06525 | 0.006741 |
Sub[III-E K412[0][all],8 of 100] | 0.657 | 0.008094 | 0.04406 | 0.00448 | 0.146 | 0.001827 | 0.06533 | 0.001585 | 0.3493 | 0.002896 | 0.1936 | 0.002331 | 0.06969 | 0.001604 | 0.05916 | 0.006705 |
Sub[III-E K412[0][all],9 of 100] | 0.6569 | 0.00813 | 0.03886 | 0.004366 | 0.1492 | 0.001841 | 0.0663 | 0.00159 | 0.351 | 0.002908 | 0.197 | 0.002349 | 0.0657 | 0.001573 | 0.06313 | 0.006895 |
Sub[III-E K412[0][all],10 of 100] | 0.649 | 0.008057 | 0.04605 | 0.004435 | 0.148 | 0.001827 | 0.06543 | 0.001574 | 0.3498 | 0.002878 | 0.1899 | 0.002326 | 0.06658 | 0.001589 | 0.08246 | 0.007 |
variable | mean | std | hetero | min | q25 | median | q75 | max |
---|---|---|---|---|---|---|---|---|
k[O K-L3 + 1 other, SiO2] | 0.6536 | 0.008259 | 1.02 | 0.632 | 0.6485 | 0.6552 | 0.6586 | 0.6738 |
k[Fe L3-M5 + 13 others, Fe] | 0.04191 | 0.003461 | 0.7901 | 0.03515 | 0.03942 | 0.04193 | 0.04412 | 0.05206 |
k[Mg K-L3 + 1 other, MgO] | 0.1476 | 0.001911 | 1.042 | 0.143 | 0.1463 | 0.1475 | 0.1486 | 0.1535 |
k[Al K-L3 + 3 others, Al2O3] | 0.06699 | 0.0015 | 0.9439 | 0.06361 | 0.06621 | 0.06708 | 0.06778 | 0.07048 |
k[Si K-L3 + 3 others, SiO2] | 0.3507 | 0.002909 | 1.007 | 0.3435 | 0.3485 | 0.3508 | 0.3524 | 0.3592 |
k[Ca K-L3 + 3 others, CaF2] | 0.1922 | 0.002574 | 1.107 | 0.185 | 0.1902 | 0.1922 | 0.1939 | 0.1984 |
k[Fe K-L3 + 1 other, Fe] | 0.06683 | 0.001508 | 0.9468 | 0.06296 | 0.06569 | 0.06686 | 0.06784 | 0.07051 |
k[Fe K-M3 + 3 others, Fe] | 0.0669 | 0.006532 | 0.9723 | 0.04932 | 0.06231 | 0.06698 | 0.07106 | 0.08508 |
Repeat the fit for the 4 measured unknowns.
res= map(unks) do s
fit_spectrum(s, frs)
end
5-element Vector{FilterFitResult{Float64}}:
FitResult(III-E K412[0][all])
FitResult(III-E K412[1][all])
FitResult(III-E K412[2][all])
FitResult(III-E K412[3][all])
FitResult(III-E K412[4][all])
Spectra | k[O K-L3 + 1 other, SiO2] | Δk[O K-L3 + 1 other, SiO2] | k[Fe L3-M5 + 13 others, Fe] | Δk[Fe L3-M5 + 13 others, Fe] | k[Mg K-L3 + 1 other, MgO] | Δk[Mg K-L3 + 1 other, MgO] | k[Al K-L3 + 3 others, Al2O3] | Δk[Al K-L3 + 3 others, Al2O3] | k[Si K-L3 + 3 others, SiO2] | Δk[Si K-L3 + 3 others, SiO2] | k[Ca K-L3 + 3 others, CaF2] | Δk[Ca K-L3 + 3 others, CaF2] | k[Fe K-L3 + 1 other, Fe] | Δk[Fe K-L3 + 1 other, Fe] | k[Fe K-M3 + 3 others, Fe] | Δk[Fe K-M3 + 3 others, Fe] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
III-E K412[0][all] | 0.6536 | 0.0008101 | 0.04191 | 0.0004382 | 0.1476 | 0.0001834 | 0.06699 | 0.0001589 | 0.3507 | 0.0002889 | 0.1922 | 0.0002326 | 0.06683 | 0.0001593 | 0.06684 | 0.0006722 |
III-E K412[1][all] | 0.6554 | 0.0008108 | 0.04156 | 0.0004372 | 0.1475 | 0.0001835 | 0.06675 | 0.000159 | 0.3499 | 0.0002888 | 0.1916 | 0.0002325 | 0.06708 | 0.0001595 | 0.06738 | 0.0006721 |
III-E K412[2][all] | 0.656 | 0.0008124 | 0.04191 | 0.0004381 | 0.1479 | 0.0001838 | 0.06709 | 0.0001594 | 0.3511 | 0.0002896 | 0.1922 | 0.0002329 | 0.06688 | 0.0001596 | 0.06704 | 0.0006737 |
III-E K412[3][all] | 0.6604 | 0.0008155 | 0.04146 | 0.000438 | 0.1481 | 0.0001841 | 0.06716 | 0.0001595 | 0.3519 | 0.00029 | 0.1925 | 0.0002333 | 0.06682 | 0.0001598 | 0.0678 | 0.0006746 |
III-E K412[4][all] | 0.6588 | 0.0008149 | 0.04081 | 0.0004383 | 0.1482 | 0.0001841 | 0.06728 | 0.0001597 | 0.3518 | 0.00029 | 0.1922 | 0.0002333 | 0.06694 | 0.0001598 | 0.06648 | 0.000674 |
Summary statistics.
variable | mean | std | hetero | min | q25 | median | q75 | max |
---|---|---|---|---|---|---|---|---|
k[O K-L3 + 1 other, SiO2] | 0.6568 | 0.002714 | 3.339 | 0.6536 | 0.6554 | 0.656 | 0.6588 | 0.6604 |
k[Fe L3-M5 + 13 others, Fe] | 0.04153 | 0.0004496 | 1.026 | 0.04081 | 0.04146 | 0.04156 | 0.04191 | 0.04191 |
k[Mg K-L3 + 1 other, MgO] | 0.1479 | 0.0003027 | 1.647 | 0.1475 | 0.1476 | 0.1479 | 0.1481 | 0.1482 |
k[Al K-L3 + 3 others, Al2O3] | 0.06705 | 0.000202 | 1.268 | 0.06675 | 0.06699 | 0.06709 | 0.06716 | 0.06728 |
k[Si K-L3 + 3 others, SiO2] | 0.3511 | 0.000829 | 2.864 | 0.3499 | 0.3507 | 0.3511 | 0.3518 | 0.3519 |
k[Ca K-L3 + 3 others, CaF2] | 0.1921 | 0.000318 | 1.365 | 0.1916 | 0.1922 | 0.1922 | 0.1922 | 0.1925 |
k[Fe K-L3 + 1 other, Fe] | 0.06691 | 0.0001063 | 0.6661 | 0.06682 | 0.06683 | 0.06688 | 0.06694 | 0.06708 |
k[Fe K-M3 + 3 others, Fe] | 0.06711 | 0.0005071 | 0.7531 | 0.06648 | 0.06684 | 0.06704 | 0.06738 | 0.0678 |
@btime fit_spectrum(unks[1], frs)
291.700 μs (566 allocations: 261.02 KiB)
FitResult(III-E K412[0][all])
AMM-6005a
Repeat using the ADM glass. Fe is not present in ADM-6005a but we fit it to see what a null result looks like.
path = normpath(joinpath(@__DIR__, "..","test","ADM6005a spectra"))
unks = map(i->loadspectrum(joinpath(path,"ADM-6005a_$i.msa")),1:15)
al, caf2, fe, ge, si, sio2, ti, zn = map(f->loadspectrum(joinpath(path,"$f.msa")), ("Al std", "CaF2 std", "Fe std", "Ge std", "Si std", "SiO2 std", "Ti trimmed","Zn std"))
det = matching(unks[1], 132.0, 10)
frs = references( [
reference(n"Al", al, mat"Al" ), #
reference(n"Ca", caf2, mat"CaF2" ), #
reference(n"Fe", fe, mat"Fe" ), #
reference(n"Ge", ge, mat"Ge" ), #
reference(n"Si", si, mat"Si" ), #
reference(n"O", sio2, mat"SiO2" ), #
reference(n"Ti", ti, mat"Ti" ),
reference(n"Zn", zn, mat"Zn" )
], det)
ss =
res= map(subdivide(unks[1], 100)) do s
fit_spectrum(s, frs)
end
100-element Vector{FilterFitResult{Float64}}:
FitResult(Sub[ADM-6005a_1,1 of 100])
FitResult(Sub[ADM-6005a_1,2 of 100])
FitResult(Sub[ADM-6005a_1,3 of 100])
FitResult(Sub[ADM-6005a_1,4 of 100])
FitResult(Sub[ADM-6005a_1,5 of 100])
FitResult(Sub[ADM-6005a_1,6 of 100])
FitResult(Sub[ADM-6005a_1,7 of 100])
FitResult(Sub[ADM-6005a_1,8 of 100])
FitResult(Sub[ADM-6005a_1,9 of 100])
FitResult(Sub[ADM-6005a_1,10 of 100])
⋮
FitResult(Sub[ADM-6005a_1,92 of 100])
FitResult(Sub[ADM-6005a_1,93 of 100])
FitResult(Sub[ADM-6005a_1,94 of 100])
FitResult(Sub[ADM-6005a_1,95 of 100])
FitResult(Sub[ADM-6005a_1,96 of 100])
FitResult(Sub[ADM-6005a_1,97 of 100])
FitResult(Sub[ADM-6005a_1,98 of 100])
FitResult(Sub[ADM-6005a_1,99 of 100])
FitResult(Sub[ADM-6005a_1,100 of 100])
Spectra | k[Ti L3-M5 + 13 others, Ti] | Δk[Ti L3-M5 + 13 others, Ti] | k[O K-L3 + 1 other, SiO2] | Δk[O K-L3 + 1 other, SiO2] | k[Fe L3-M5 + 13 others, Fe] | Δk[Fe L3-M5 + 13 others, Fe] | k[Zn L3-M5 + 13 others, Zn] | Δk[Zn L3-M5 + 13 others, Zn] | k[Ge L3-M5 + 15 others, Ge] | Δk[Ge L3-M5 + 15 others, Ge] | k[Al K-L3 + 3 others, Al] | Δk[Al K-L3 + 3 others, Al] | k[Si K-L3 + 3 others, Si] | Δk[Si K-L3 + 3 others, Si] | k[Ca K-L3 + 3 others, CaF2] | Δk[Ca K-L3 + 3 others, CaF2] | k[Ti K-L3 + 3 others, Ti] | Δk[Ti K-L3 + 3 others, Ti] | k[Fe K-L3 + 1 other, Fe] | Δk[Fe K-L3 + 1 other, Fe] | k[Fe K-M3 + 3 others, Fe] | Δk[Fe K-M3 + 3 others, Fe] | k[Zn K-L3 + 1 other, Zn] | Δk[Zn K-L3 + 1 other, Zn] | k[Zn K-M3 + 3 others, Zn] | Δk[Zn K-M3 + 3 others, Zn] | k[Ge K-L3 + 1 other, Ge] | Δk[Ge K-L3 + 1 other, Ge] | k[Ge K-M3 + 5 others, Ge] | Δk[Ge K-M3 + 5 others, Ge] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sub[ADM-6005a_1,1 of 100] | 0.01715 | 0.01819 | 0.4763 | 0.006686 | 0.000985 | 0.002787 | 0.06969 | 0.001486 | 0.1757 | 0.001765 | 0.02775 | 0.0005049 | 0.02201 | 0.0005003 | 0.115 | 0.001682 | 0.06554 | 0.001036 | 0.0007427 | 0.0006747 | 0.003487 | 0.005247 | 0.1109 | 0.002677 | 0.1094 | 0.01578 | 0.2538 | 0.005234 | 0.268 | 0.01881 |
Sub[ADM-6005a_1,2 of 100] | 0.01827 | 0.01828 | 0.4875 | 0.006735 | 0 | 0.002702 | 0.06966 | 0.001475 | 0.1821 | 0.00177 | 0.0287 | 0.0004998 | 0.02128 | 0.0005 | 0.1241 | 0.001674 | 0.06443 | 0.001028 | 0.0005619 | 0.000684 | 0.004611 | 0.005194 | 0.112 | 0.002762 | 0.1619 | 0.01567 | 0.2827 | 0.005347 | 0.2444 | 0.01864 |
Sub[ADM-6005a_1,3 of 100] | 0.0322 | 0.01842 | 0.4923 | 0.00674 | 0.002764 | 0.00292 | 0.06944 | 0.001476 | 0.1761 | 0.001764 | 0.02897 | 0.0005068 | 0.02227 | 0.0005062 | 0.1194 | 0.001682 | 0.06353 | 0.001033 | 0.0001854 | 0.0007012 | 0.01708 | 0.005114 | 0.1142 | 0.002699 | 0.1215 | 0.01569 | 0.2502 | 0.00515 | 0.2289 | 0.01861 |
Sub[ADM-6005a_1,4 of 100] | 0.0524 | 0.01805 | 0.4837 | 0.006707 | 0.003455 | 0.002792 | 0.06469 | 0.001468 | 0.1799 | 0.001769 | 0.02651 | 0.0004925 | 0.02136 | 0.0004991 | 0.122 | 0.001686 | 0.06291 | 0.001025 | 0.0004902 | 0.0007035 | 0.01035 | 0.00508 | 0.1069 | 0.002743 | 0.121 | 0.01569 | 0.2541 | 0.005246 | 0.2524 | 0.01896 |
Sub[ADM-6005a_1,5 of 100] | 0.0002562 | 0.01767 | 0.487 | 0.006768 | 0 | 0.002727 | 0.07283 | 0.001479 | 0.1827 | 0.00178 | 0.02866 | 0.0005074 | 0.02227 | 0.0005078 | 0.1234 | 0.001689 | 0.06352 | 0.001038 | 0 | 0.0006952 | 0 | 0.004966 | 0.1189 | 0.002716 | 0.1116 | 0.01565 | 0.2709 | 0.005318 | 0.2589 | 0.01958 |
Sub[ADM-6005a_1,6 of 100] | 0.02306 | 0.0181 | 0.4812 | 0.006723 | 0 | 0.002734 | 0.06618 | 0.001462 | 0.1806 | 0.001764 | 0.02709 | 0.0004969 | 0.02083 | 0.0004982 | 0.1226 | 0.001685 | 0.0649 | 0.001027 | 0 | 0.0006779 | 0.0002667 | 0.004972 | 0.1194 | 0.002748 | 0.0954 | 0.01498 | 0.2641 | 0.005218 | 0.278 | 0.01916 |
Sub[ADM-6005a_1,7 of 100] | 0.005544 | 0.01804 | 0.485 | 0.006674 | 0 | 0.002763 | 0.06924 | 0.001466 | 0.1786 | 0.001756 | 0.0283 | 0.000503 | 0.021 | 0.000503 | 0.1219 | 0.001695 | 0.06693 | 0.001034 | 0.001133 | 0.0006931 | 0.006329 | 0.005147 | 0.1143 | 0.00276 | 0.1483 | 0.0159 | 0.2708 | 0.005258 | 0.2378 | 0.01838 |
Sub[ADM-6005a_1,8 of 100] | 0.01364 | 0.01792 | 0.486 | 0.006724 | 0.001811 | 0.002872 | 0.0682 | 0.001485 | 0.1767 | 0.001759 | 0.0273 | 0.0004987 | 0.02101 | 0.0004993 | 0.1235 | 0.001689 | 0.06345 | 0.001028 | 0.001232 | 0.0007136 | 0.007105 | 0.005165 | 0.1097 | 0.002725 | 0.1297 | 0.01582 | 0.2737 | 0.005364 | 0.2913 | 0.01914 |
Sub[ADM-6005a_1,9 of 100] | 0.03225 | 0.01788 | 0.4848 | 0.006746 | 0 | 0.00279 | 0.06824 | 0.001487 | 0.1793 | 0.001774 | 0.02782 | 0.0004993 | 0.02068 | 0.0004981 | 0.1235 | 0.001698 | 0.06417 | 0.001031 | 0 | 0.0006982 | 0 | 0.004931 | 0.1138 | 0.002688 | 0.1068 | 0.01582 | 0.2705 | 0.005279 | 0.2545 | 0.01895 |
Sub[ADM-6005a_1,10 of 100] | 0.006674 | 0.01835 | 0.4837 | 0.006785 | 0.003991 | 0.002899 | 0.06693 | 0.001468 | 0.182 | 0.001776 | 0.02971 | 0.0005091 | 0.02143 | 0.0005028 | 0.1245 | 0.0017 | 0.06301 | 0.001039 | 0 | 0.0006824 | 0 | 0.005233 | 0.1128 | 0.002765 | 0.1246 | 0.01561 | 0.2642 | 0.005274 | 0.2996 | 0.01969 |
Summary statistics.
variable | mean | std | hetero | min | q25 | median | q75 | max |
---|---|---|---|---|---|---|---|---|
k[Ti L3-M5 + 13 others, Ti] | 0.02107 | 0.01601 | 0.8875 | 0 | 0.006446 | 0.01928 | 0.03279 | 0.05741 |
k[O K-L3 + 1 other, SiO2] | 0.4877 | 0.0102 | 1.524 | 0.4636 | 0.4812 | 0.4865 | 0.4949 | 0.5095 |
k[Fe L3-M5 + 13 others, Fe] | 0.001105 | 0.001439 | 0.514 | 0 | 0 | 0.0003555 | 0.00183 | 0.005188 |
k[Zn L3-M5 + 13 others, Zn] | 0.06813 | 0.002081 | 1.411 | 0.06273 | 0.06664 | 0.06842 | 0.0696 | 0.07283 |
k[Ge L3-M5 + 15 others, Ge] | 0.1793 | 0.00242 | 1.368 | 0.1722 | 0.1778 | 0.1795 | 0.181 | 0.1859 |
k[Al K-L3 + 3 others, Al] | 0.028 | 0.0007355 | 1.471 | 0.02651 | 0.02755 | 0.02797 | 0.02856 | 0.02993 |
k[Si K-L3 + 3 others, Si] | 0.02143 | 0.0006718 | 1.339 | 0.01995 | 0.021 | 0.02133 | 0.02193 | 0.02295 |
k[Ca K-L3 + 3 others, CaF2] | 0.1214 | 0.002626 | 1.557 | 0.115 | 0.1195 | 0.1213 | 0.123 | 0.1298 |
k[Ti K-L3 + 3 others, Ti] | 0.06433 | 0.001447 | 1.401 | 0.06133 | 0.06334 | 0.06433 | 0.06516 | 0.06773 |
k[Fe K-L3 + 1 other, Fe] | 0.0004635 | 0.0005114 | 0.7346 | 0 | 0 | 0.0003835 | 0.0007281 | 0.001958 |
k[Fe K-M3 + 3 others, Fe] | 0.003237 | 0.004005 | 0.7915 | 0 | 0 | 0.001806 | 0.005287 | 0.01708 |
k[Zn K-L3 + 1 other, Zn] | 0.1117 | 0.003733 | 1.37 | 0.1038 | 0.109 | 0.111 | 0.1141 | 0.1215 |
k[Zn K-M3 + 3 others, Zn] | 0.1228 | 0.02056 | 1.31 | 0.05468 | 0.1081 | 0.1216 | 0.1386 | 0.1675 |
k[Ge K-L3 + 1 other, Ge] | 0.2635 | 0.007333 | 1.395 | 0.2346 | 0.2589 | 0.2641 | 0.2686 | 0.2827 |
k[Ge K-M3 + 5 others, Ge] | 0.2705 | 0.02089 | 1.097 | 0.2229 | 0.256 | 0.2709 | 0.2832 | 0.3265 |
Repeat for the 15 measured spectra.
res= map(unks) do s
fit_spectrum(s, frs)
end
15-element Vector{FilterFitResult{Float64}}:
FitResult(ADM-6005a_1)
FitResult(ADM-6005a_2)
FitResult(ADM-6005a_3)
FitResult(ADM-6005a_4)
FitResult(ADM-6005a_5)
FitResult(ADM-6005a_6)
FitResult(ADM-6005a_7)
FitResult(ADM-6005a_8)
FitResult(ADM-6005a_9)
FitResult(ADM-6005a_10)
FitResult(ADM-6005a_11)
FitResult(ADM-6005a_12)
FitResult(ADM-6005a_13)
FitResult(ADM-6005a_14)
FitResult(ADM-6005a_15)
Spectra | k[Ti L3-M5 + 13 others, Ti] | Δk[Ti L3-M5 + 13 others, Ti] | k[O K-L3 + 1 other, SiO2] | Δk[O K-L3 + 1 other, SiO2] | k[Fe L3-M5 + 13 others, Fe] | Δk[Fe L3-M5 + 13 others, Fe] | k[Zn L3-M5 + 13 others, Zn] | Δk[Zn L3-M5 + 13 others, Zn] | k[Ge L3-M5 + 15 others, Ge] | Δk[Ge L3-M5 + 15 others, Ge] | k[Al K-L3 + 3 others, Al] | Δk[Al K-L3 + 3 others, Al] | k[Si K-L3 + 3 others, Si] | Δk[Si K-L3 + 3 others, Si] | k[Ca K-L3 + 3 others, CaF2] | Δk[Ca K-L3 + 3 others, CaF2] | k[Ti K-L3 + 3 others, Ti] | Δk[Ti K-L3 + 3 others, Ti] | k[Fe K-L3 + 1 other, Fe] | Δk[Fe K-L3 + 1 other, Fe] | k[Fe K-M3 + 3 others, Fe] | Δk[Fe K-M3 + 3 others, Fe] | k[Zn K-L3 + 1 other, Zn] | Δk[Zn K-L3 + 1 other, Zn] | k[Zn K-M3 + 3 others, Zn] | Δk[Zn K-M3 + 3 others, Zn] | k[Ge K-L3 + 1 other, Ge] | Δk[Ge K-L3 + 1 other, Ge] | k[Ge K-M3 + 5 others, Ge] | Δk[Ge K-M3 + 5 others, Ge] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ADM-6005a_1 | 0.01964 | 0.001805 | 0.4876 | 0.0006729 | 0.0001275 | 0.0002801 | 0.06814 | 0.0001475 | 0.1793 | 0.0001769 | 0.028 | 5.002e-05 | 0.02143 | 5.017e-05 | 0.1214 | 0.0001687 | 0.06433 | 0.0001033 | 0.0002048 | 6.966e-05 | 0.001265 | 0.0005064 | 0.1117 | 0.0002725 | 0.1226 | 0.001569 | 0.2635 | 0.0005255 | 0.2701 | 0.001897 |
ADM-6005a_2 | 0.02053 | 0.001806 | 0.4863 | 0.0006728 | 0 | 0.0002776 | 0.06796 | 0.0001475 | 0.1797 | 0.000177 | 0.02793 | 5.002e-05 | 0.02146 | 5.012e-05 | 0.1214 | 0.0001687 | 0.06393 | 0.0001032 | 0.0003342 | 6.935e-05 | 0.001418 | 0.0005071 | 0.1115 | 0.0002728 | 0.1226 | 0.001568 | 0.2641 | 0.0005258 | 0.277 | 0.001901 |
ADM-6005a_3 | 0.02108 | 0.001805 | 0.4894 | 0.0006737 | 0.0002538 | 0.0002783 | 0.06801 | 0.0001477 | 0.1795 | 0.0001769 | 0.02805 | 5.003e-05 | 0.02136 | 5.011e-05 | 0.1216 | 0.0001689 | 0.06404 | 0.0001033 | 0.0002986 | 6.974e-05 | 0.0006342 | 0.0005059 | 0.1116 | 0.0002723 | 0.1155 | 0.001567 | 0.2623 | 0.0005252 | 0.2797 | 0.001901 |
ADM-6005a_4 | 0.01931 | 0.001807 | 0.488 | 0.0006737 | 0 | 0.0002786 | 0.06843 | 0.0001479 | 0.1796 | 0.0001771 | 0.02801 | 5.007e-05 | 0.02149 | 5.02e-05 | 0.1211 | 0.0001687 | 0.06402 | 0.0001032 | 0.0003314 | 6.985e-05 | 0.001286 | 0.0005073 | 0.1116 | 0.0002729 | 0.1204 | 0.001567 | 0.2636 | 0.0005254 | 0.2755 | 0.001903 |
ADM-6005a_5 | 0.01983 | 0.001807 | 0.488 | 0.0006734 | 0 | 0.0002782 | 0.06789 | 0.0001475 | 0.1793 | 0.0001769 | 0.02816 | 5.007e-05 | 0.02133 | 5.013e-05 | 0.1215 | 0.0001689 | 0.06406 | 0.0001032 | 0.0002726 | 6.967e-05 | 0.001403 | 0.0005061 | 0.1116 | 0.0002724 | 0.1207 | 0.001562 | 0.2625 | 0.0005253 | 0.2731 | 0.001898 |
ADM-6005a_6 | 0.02264 | 0.001805 | 0.4892 | 0.000673 | 0 | 0.0002779 | 0.06812 | 0.0001475 | 0.1792 | 0.000177 | 0.02814 | 5.01e-05 | 0.02142 | 5.017e-05 | 0.1209 | 0.0001686 | 0.06397 | 0.0001033 | 0.0002285 | 6.936e-05 | 0.001213 | 0.0005055 | 0.1111 | 0.0002723 | 0.122 | 0.001568 | 0.262 | 0.0005253 | 0.2777 | 0.001896 |
ADM-6005a_7 | 0.02164 | 0.001811 | 0.4897 | 0.0006747 | 0 | 0.0002782 | 0.06787 | 0.0001475 | 0.1795 | 0.000177 | 0.02795 | 5.004e-05 | 0.02148 | 5.013e-05 | 0.1215 | 0.0001689 | 0.0642 | 0.0001033 | 0.0003133 | 6.951e-05 | 0 | 0.0005048 | 0.1111 | 0.0002731 | 0.1214 | 0.001572 | 0.2636 | 0.0005267 | 0.2723 | 0.001897 |
ADM-6005a_8 | 0.01968 | 0.001808 | 0.4884 | 0.0006733 | 9.754e-05 | 0.0002781 | 0.06805 | 0.0001477 | 0.1796 | 0.000177 | 0.02809 | 5.011e-05 | 0.02154 | 5.02e-05 | 0.1215 | 0.0001687 | 0.06411 | 0.0001032 | 0.0002939 | 6.953e-05 | 0.0003188 | 0.0005084 | 0.1113 | 0.0002722 | 0.1223 | 0.001571 | 0.264 | 0.0005262 | 0.2774 | 0.001905 |
ADM-6005a_9 | 0.02081 | 0.00181 | 0.4885 | 0.0006735 | 0 | 0.0002785 | 0.06835 | 0.0001478 | 0.1792 | 0.0001771 | 0.02811 | 5.008e-05 | 0.02152 | 5.018e-05 | 0.1214 | 0.0001687 | 0.06402 | 0.0001032 | 0.000302 | 6.967e-05 | 0.001483 | 0.0005078 | 0.111 | 0.0002723 | 0.1181 | 0.00157 | 0.2615 | 0.0005259 | 0.2759 | 0.001897 |
ADM-6005a_10 | 0.02465 | 0.001805 | 0.4877 | 0.0006733 | 0.0001351 | 0.000279 | 0.06788 | 0.0001477 | 0.1798 | 0.0001771 | 0.02813 | 5.007e-05 | 0.02147 | 5.018e-05 | 0.1211 | 0.0001687 | 0.06386 | 0.0001031 | 0.0001826 | 6.964e-05 | 0.001759 | 0.0005073 | 0.1117 | 0.0002726 | 0.1244 | 0.001571 | 0.2628 | 0.0005256 | 0.2743 | 0.001905 |
ADM-6005a_11 | 0.02014 | 0.001804 | 0.4883 | 0.0006738 | 0.0002345 | 0.0002791 | 0.0678 | 0.0001476 | 0.1797 | 0.000177 | 0.02803 | 5.006e-05 | 0.02154 | 5.019e-05 | 0.1214 | 0.0001688 | 0.06397 | 0.0001031 | 0.0004916 | 6.947e-05 | 0.0008535 | 0.0005053 | 0.1115 | 0.0002721 | 0.1215 | 0.001565 | 0.2634 | 0.0005259 | 0.2711 | 0.001892 |
ADM-6005a_12 | 0.02042 | 0.001811 | 0.4899 | 0.0006747 | 0 | 0.0002787 | 0.06789 | 0.0001476 | 0.1796 | 0.0001771 | 0.02798 | 5.007e-05 | 0.02149 | 5.02e-05 | 0.1213 | 0.0001688 | 0.06378 | 0.0001032 | 0.0003361 | 6.939e-05 | 0.001099 | 0.0005068 | 0.1113 | 0.0002729 | 0.1166 | 0.001567 | 0.2625 | 0.0005262 | 0.2726 | 0.001897 |
ADM-6005a_13 | 0.01675 | 0.001812 | 0.4893 | 0.0006745 | 0.0002109 | 0.0002777 | 0.06837 | 0.0001478 | 0.1794 | 0.000177 | 0.02807 | 5.001e-05 | 0.02142 | 5.019e-05 | 0.1216 | 0.0001688 | 0.06395 | 0.0001032 | 0.0003101 | 6.96e-05 | 0 | 0.0005047 | 0.1113 | 0.0002727 | 0.1245 | 0.001567 | 0.2633 | 0.0005256 | 0.2786 | 0.001907 |
ADM-6005a_14 | 0.01856 | 0.001809 | 0.4895 | 0.0006741 | 0 | 0.0002776 | 0.06805 | 0.0001477 | 0.1798 | 0.000177 | 0.02794 | 5.001e-05 | 0.02152 | 5.015e-05 | 0.1215 | 0.0001689 | 0.06388 | 0.0001033 | 0.0003892 | 6.958e-05 | 0.0008041 | 0.0005066 | 0.1112 | 0.0002723 | 0.1213 | 0.001569 | 0.2629 | 0.0005254 | 0.2756 | 0.001896 |
ADM-6005a_15 | 0.01905 | 0.001808 | 0.4903 | 0.0006739 | 0 | 0.000277 | 0.06802 | 0.0001476 | 0.1799 | 0.0001772 | 0.02813 | 5.011e-05 | 0.02141 | 5.017e-05 | 0.1215 | 0.0001688 | 0.06409 | 0.0001032 | 0.0002762 | 6.947e-05 | 0.00149 | 0.0005059 | 0.1116 | 0.0002725 | 0.1209 | 0.001568 | 0.2632 | 0.0005258 | 0.2716 | 0.001898 |
Summary statistics.
variable | mean | std | hetero | min | q25 | median | q75 | max |
---|---|---|---|---|---|---|---|---|
k[Ti L3-M5 + 13 others, Ti] | 0.02031 | 0.001821 | 1.008 | 0.01675 | 0.01947 | 0.02014 | 0.02094 | 0.02465 |
k[O K-L3 + 1 other, SiO2] | 0.4887 | 0.001071 | 1.589 | 0.4863 | 0.488 | 0.4885 | 0.4894 | 0.4903 |
k[Fe L3-M5 + 13 others, Fe] | 7.062e-05 | 9.75e-05 | 0.3503 | 0 | 0 | 0 | 0.0001313 | 0.0002538 |
k[Zn L3-M5 + 13 others, Zn] | 0.06805 | 0.0001951 | 1.322 | 0.0678 | 0.06789 | 0.06802 | 0.06813 | 0.06843 |
k[Ge L3-M5 + 15 others, Ge] | 0.1795 | 0.0002331 | 1.317 | 0.1792 | 0.1793 | 0.1796 | 0.1797 | 0.1799 |
k[Al K-L3 + 3 others, Al] | 0.02805 | 7.811e-05 | 1.56 | 0.02793 | 0.02799 | 0.02805 | 0.02812 | 0.02816 |
k[Si K-L3 + 3 others, Si] | 0.02146 | 6.203e-05 | 1.236 | 0.02133 | 0.02142 | 0.02147 | 0.0215 | 0.02154 |
k[Ca K-L3 + 3 others, CaF2] | 0.1214 | 0.0002119 | 1.255 | 0.1209 | 0.1213 | 0.1214 | 0.1215 | 0.1216 |
k[Ti K-L3 + 3 others, Ti] | 0.06401 | 0.0001365 | 1.322 | 0.06378 | 0.06394 | 0.06402 | 0.06408 | 0.06433 |
k[Fe K-L3 + 1 other, Fe] | 0.0003043 | 7.438e-05 | 1.069 | 0.0001826 | 0.0002744 | 0.000302 | 0.0003328 | 0.0004916 |
k[Fe K-M3 + 3 others, Fe] | 0.001002 | 0.0005511 | 1.088 | 0 | 0.0007191 | 0.001213 | 0.001411 | 0.001759 |
k[Zn K-L3 + 1 other, Zn] | 0.1114 | 0.0002374 | 0.8712 | 0.111 | 0.1112 | 0.1115 | 0.1116 | 0.1117 |
k[Zn K-M3 + 3 others, Zn] | 0.121 | 0.00254 | 1.62 | 0.1155 | 0.1206 | 0.1214 | 0.1224 | 0.1245 |
k[Ge K-L3 + 1 other, Ge] | 0.263 | 0.0007443 | 1.416 | 0.2615 | 0.2625 | 0.2632 | 0.2635 | 0.2641 |
k[Ge K-M3 + 5 others, Ge] | 0.2748 | 0.002941 | 1.549 | 0.2701 | 0.2724 | 0.2755 | 0.2772 | 0.2797 |
@btime fit_spectrum(unks[1], frs)
410.900 μs (1043 allocations: 611.44 KiB)
FitResult(ADM-6005a_1)