Bug #1299
Updated by Knödlseder Jürgen over 10 years ago
While finalizing the stacked cube analysis (#1291) I encountered a problem with fitting the radial disk model. For stacked cube analysis, the fit converges badly. But even for unbinned analysis, the fit takes many iterations. Here for example a log for unbinned fitting:
<pre>
>Iteration 0: -logL=34182.372, Lambda=1.0e-03
>Iteration 1: -logL=34180.081, Lambda=1.0e-03, delta=2.290, max(|grad|)=19.555723 [DEC:1]
>Iteration 2: -logL=34180.070, Lambda=1.0e-04, delta=0.011, max(|grad|)=-6.847438 [Radius:2]
>Iteration 3: -logL=34180.070, Lambda=1.0e-05, delta=0.001, max(|grad|)=2.516642 [Radius:2]
>Iteration 4: -logL=34180.070, Lambda=1.0e-06, delta=0.000, max(|grad|)=-3.717756 [Radius:2]
Iteration 5: -logL=34180.070, Lambda=1.0e-07, delta=-0.000, max(|grad|)=3.502109 [Radius:2] (stalled)
Iteration 6: -logL=34180.070, Lambda=1.0e-06, delta=-0.000, max(|grad|)=3.502427 [Radius:2] (stalled)
Iteration 7: -logL=34180.070, Lambda=1.0e-05, delta=-0.000, max(|grad|)=3.501858 [Radius:2] (stalled)
Iteration 8: -logL=34180.070, Lambda=1.0e-04, delta=-0.000, max(|grad|)=3.501880 [Radius:2] (stalled)
Iteration 9: -logL=34180.070, Lambda=1.0e-03, delta=-0.000, max(|grad|)=3.499197 [Radius:2] (stalled)
Iteration 10: -logL=34180.070, Lambda=1.0e-02, delta=-0.000, max(|grad|)=3.455784 [Radius:2] (stalled)
Iteration 11: -logL=34180.070, Lambda=1.0e-01, delta=-0.000, max(|grad|)=2.826601 [Radius:2] (stalled)
Iteration 12: -logL=34180.070, Lambda=1.0e+00, delta=-0.000, max(|grad|)=2.395730 [Radius:2] (stalled)
>Iteration 13: -logL=34180.070, Lambda=1.0e+01, delta=0.000, max(|grad|)=-3.178778 [DEC:1]
Iteration 14: -logL=34180.070, Lambda=1.0e+00, delta=-0.000, max(|grad|)=2.706520 [DEC:1] (stalled)
Iteration 15: -logL=34180.070, Lambda=1.0e+01, delta=-0.000, max(|grad|)=-1.960376 [RA:0] (stalled)
>Iteration 16: -logL=34180.070, Lambda=1.0e+02, delta=0.000, max(|grad|)=-1.937920 [RA:0]
=== GObservations ===
Number of observations ....: 1
Number of predicted events : 4038
=== GModelSky ===
Number of spatial par's ...: 3
RA .......................: 83.6324 +/- 0.00394119 [-360,360] deg (free,scale=1)
DEC ......................: 22.0138 +/- 0.00327793 [-90,90] deg (free,scale=1)
Radius ...................: 0.201159 +/- 0.00305998 [0.01,10] deg (free,scale=1)
Number of spectral par's ..: 3
Prefactor ................: 5.45432e-16 +/- 1.99357e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
Index ....................: -2.45887 +/- 0.0267077 [-0,-5] (free,scale=-1,gradient)
=== GCTAModelRadialAcceptance ===
Number of radial par's ....: 1
Sigma ....................: 3.05822 +/- 0.039788 [0.01,10] deg2 (free,scale=1,gradient)
Number of spectral par's ..: 3
Prefactor ................: 5.99601e-05 +/- 1.76021e-06 [0,0.001] ph/cm2/s/MeV (free,scale=1e-06,gradient)
Index ....................: -1.85301 +/- 0.0164761 [-0,-5] (free,scale=-1,gradient)
</pre>
The fit stalls often (which is also the case for binned and stacked cube analysis) and takes many iterations to terminate. Note that for the above example, the numerical integration step size was set to 1e-5.
<pre>
>Iteration 0: -logL=34182.372, Lambda=1.0e-03
>Iteration 1: -logL=34180.081, Lambda=1.0e-03, delta=2.290, max(|grad|)=19.555723 [DEC:1]
>Iteration 2: -logL=34180.070, Lambda=1.0e-04, delta=0.011, max(|grad|)=-6.847438 [Radius:2]
>Iteration 3: -logL=34180.070, Lambda=1.0e-05, delta=0.001, max(|grad|)=2.516642 [Radius:2]
>Iteration 4: -logL=34180.070, Lambda=1.0e-06, delta=0.000, max(|grad|)=-3.717756 [Radius:2]
Iteration 5: -logL=34180.070, Lambda=1.0e-07, delta=-0.000, max(|grad|)=3.502109 [Radius:2] (stalled)
Iteration 6: -logL=34180.070, Lambda=1.0e-06, delta=-0.000, max(|grad|)=3.502427 [Radius:2] (stalled)
Iteration 7: -logL=34180.070, Lambda=1.0e-05, delta=-0.000, max(|grad|)=3.501858 [Radius:2] (stalled)
Iteration 8: -logL=34180.070, Lambda=1.0e-04, delta=-0.000, max(|grad|)=3.501880 [Radius:2] (stalled)
Iteration 9: -logL=34180.070, Lambda=1.0e-03, delta=-0.000, max(|grad|)=3.499197 [Radius:2] (stalled)
Iteration 10: -logL=34180.070, Lambda=1.0e-02, delta=-0.000, max(|grad|)=3.455784 [Radius:2] (stalled)
Iteration 11: -logL=34180.070, Lambda=1.0e-01, delta=-0.000, max(|grad|)=2.826601 [Radius:2] (stalled)
Iteration 12: -logL=34180.070, Lambda=1.0e+00, delta=-0.000, max(|grad|)=2.395730 [Radius:2] (stalled)
>Iteration 13: -logL=34180.070, Lambda=1.0e+01, delta=0.000, max(|grad|)=-3.178778 [DEC:1]
Iteration 14: -logL=34180.070, Lambda=1.0e+00, delta=-0.000, max(|grad|)=2.706520 [DEC:1] (stalled)
Iteration 15: -logL=34180.070, Lambda=1.0e+01, delta=-0.000, max(|grad|)=-1.960376 [RA:0] (stalled)
>Iteration 16: -logL=34180.070, Lambda=1.0e+02, delta=0.000, max(|grad|)=-1.937920 [RA:0]
=== GObservations ===
Number of observations ....: 1
Number of predicted events : 4038
=== GModelSky ===
Number of spatial par's ...: 3
RA .......................: 83.6324 +/- 0.00394119 [-360,360] deg (free,scale=1)
DEC ......................: 22.0138 +/- 0.00327793 [-90,90] deg (free,scale=1)
Radius ...................: 0.201159 +/- 0.00305998 [0.01,10] deg (free,scale=1)
Number of spectral par's ..: 3
Prefactor ................: 5.45432e-16 +/- 1.99357e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
Index ....................: -2.45887 +/- 0.0267077 [-0,-5] (free,scale=-1,gradient)
=== GCTAModelRadialAcceptance ===
Number of radial par's ....: 1
Sigma ....................: 3.05822 +/- 0.039788 [0.01,10] deg2 (free,scale=1,gradient)
Number of spectral par's ..: 3
Prefactor ................: 5.99601e-05 +/- 1.76021e-06 [0,0.001] ph/cm2/s/MeV (free,scale=1e-06,gradient)
Index ....................: -1.85301 +/- 0.0164761 [-0,-5] (free,scale=-1,gradient)
</pre>
The fit stalls often (which is also the case for binned and stacked cube analysis) and takes many iterations to terminate. Note that for the above example, the numerical integration step size was set to 1e-5.