Further Development of Event-based Analysis of X-Ray Polarization Data

An event-based maximum likelihood method for handling X-ray polarimetry data is extended to include the effects of background and nonuniform sampling of the possible position angle space. While nonuniform sampling in position angle space generally introduces cross terms in the uncertainties of polarization parameters that could create degeneracies, there are interesting cases that engender no bias or parameter covariance. When including background in Poisson-based likelihood formulation, the formula for the minimum detectable polarization has nearly the same form as for the case of Gaussian statistics derived by Elsner et al. in the limiting case of an unpolarized signal. A polarized background is also considered, which demonstrably increases uncertainties in source polarization measurements. In addition, a Kolmogorov-style test of the event position angle distribution is proposed that can provide an unbinned test of models where the polarization angle in Stokes space depends on event characteristics such as time or energy.


INTRODUCTION
The goal of this paper is to extend the maximum likelihood formulation developed earlier for analysis of unbinned X-ray polarimetry data (Marshall 2021a) to circumstances that were not considered there.The method was developed specifically for application to data from the Imaging X-ray Polarization Explorer (IXPE, Weisskopf et al. 2022) but can be applied generally to instruments that yield events with associated polarization information, such as a soft X-ray polarimeter (Marshall et al. 2018) that is now in development, or instruments that must be rotated to obtain polarization information.In the case of IXPE, there is an angle ψ associated with every event based on the track produced by the photoelectron ejected by the incident X-ray.For the soft X-ray polarimeter, each event is associated with a "channel" according to the position angle of its Bragg reflector relative to the sky.
By design, the gas pixel detectors on IXPE (Rankin et al. 2023) and PolarLight (Feng et al. 2019) have uniform sensitivity with ψ.This is not generally true for systems based on Bragg reflection (e.g.OSO-8, Weisskopf et al. 1976), Thomson scattering (e.g.POLIX on XPoSat, Paul 2022), or Compton scattering (e.g.X Calibur, Beilicke et al. 2014).Such instruments usually require rotation to obtain uniform azimuthal exposure.See the review of instruments based on Compton scattering by Del Monte et al. (2022).Thus, in section 2, exposure nonuniformities are examined and characterized by two observation-based parameters that can be used to determine the impact of such asymmetries.
Every instrument has a background signal, so in section 3, a background term is added to the unbinned likelihood model.The basic case of an unpolarized signal is covered in section 3.1 and augmented to include the impact of unpolarized background in section 3.2.
Given a model with its best fit parameters, it is necessary to test it.A Kolmogorov test of the counts with time or energy would not be sensitive to the polarization model.Previous tests of polarization models generally examined only the significances of the estimates of the polarization fraction for a full observation (e.g.Liodakis et al. 2022) or perhaps when binned by energy or pulse phase (e.g.Taverna et al. 2022).In section 4, a new test is proposed that is specifically designed to be sensitive to whether the distribution of the event ψ values matches the model.This sort of test can be used to examine the validity of a pulsar rotating vector model, such as fit by the unbinned method developed by González-Caniulef et al. (2023).This test method can also be useful in cases where the electric vector position angle (EVPA) rotates with time as in two observations of the BL Lac object Mk 421 (Di Gesu et al. 2023) in order to test whether the rotation occurs at a uniform rate without binning EVPA measurements in time.
A short review of the maximum likelihood formalism is in order, following Marshall (2021a) and Marshall (2021b).For this analysis, consider a simple case of a fixed energy band over which the polarization is constant so that the data consist of counts in ψ space.At energy E, the modulation factor of the instrument is µ E , the instrument effective area is A E , and the intrinsic source photon flux is f E based on the spectral model of the source.Both µ E and A E are assumed to be known a priori.The event density in a differential energy-phase element dEdψ about (E, ψ) is where T is the exposure time and the (normalized) Stokes parameters are q ≡ Q/I and u ≡ U/I for Stokes fluxes I, Q, and U.
(Circular polarization, V , is ignored here, as there is currently no practical way to measure it in the X-ray band.)Assuming that there are N events, with energies and instrument angles (E i , ψ i ), then the log-likelihood for a Poisson probability distribution of events, S = −2 ln L, is where f i ≡ f (E i ) and µ i ≡ µ(E i ), after dropping terms independent of q, u, and f .In this case, the log-likelihood for the polarization parameters alone (such as when the polarization is independent of E) is relatively simple: where c i = µ i cos 2ψ i and s i = µ i sin 2ψ i .For a weakly polarized source, the best estimates of q and u are well approximated as i c i / i c 2 i and i s i / i s 2 i , respectively.See Marshall (2021a) for details.

NONUNIFORM EXPOSURE
Now, consider the case of a nonuniform exposure in an observation of an unvarying source.The exposure function, w(ψ) with units of radians −1 , can be defined as the fraction of the exposure spent with sensitivity to phase angle ψ.If the total exposure is T , then the exposure function can be normalized such that it integrates to unity for 0 ≤ ψ < 2π.In this case, the event density is and the log-likelihood for a Poisson probability distribution of events, S = −2 ln L, is To simplify some results, now assume that the spectrum has a spectral shape with uninteresting spectral shape parameters ξ that are not related to the polarization so that f E = f 0 η(E; ξ) and define K = T η(E; ξ)A E dE and K µ = T η(E; ξ)A E µ E dE as conversion constants (from flux units to counts or modulated counts), giving (dropping terms independent of f 0 , q, or u).Note that when µ is independent of E, K µ = µK.
Redefining the weights with trigonometric factors, we can simplify Eq. 7: where α(ψ) ≡ w(ψ) cos 2ψ and β(ψ) ≡ w(ψ) sin 2ψ, and the integrals of α and β over ψ are A and B, respectively.The quantities A and B are unitless, with absolute values less than or of order unity.Note that f 0 is covariant with u and q via the exposure weighting terms A and B. These quantities are both zero when w(ψ) is constant over [0, π] or [0, 2π] but either or both can be nonzero otherwise.
The best estimate of f 0 is readily determined by setting the setting ∂S/∂ f 0 to zero and solving for f 0 , giving When A and B are zero or the polarization, Π ≡ (q 2 + u 2 ) 1/2 is zero, then f 0 is just N/K, as expected.Setting ∂S/∂u = 0 and ∂S/∂q = 0 to find the best estimates of q and u gives where As before, these two equations apply under quite general circumstances but require numerical solution.However, as in Marshall (2021a), for q ≪ 1 and û ≪ 1, a simple approximate solution may be found, noting that A and B are generally of order unity, so At this point, the uncertainties in q and u can be derived.All second derivatives of Eq. 8 are nonzero: where, again, the approximations hold for q ≪ 1 and û ≪ 1.
We are most interested in the uncertainty in the polarization, Π.We can make the coordinate transformation from (q, u) to (Π, ϕ), where ϕ =1 2 tan −1 (u/q) and determine S( f0 , Π, ϕ): for which the second derivative with respect to Π is with a limit as Π −→ 0 and The first term on the right hand side is the "normal", expected term that depends on the modulation factor and the cosines of the phase angles.The second term, however, is of great concern because it is negative definite, causing the uncertainty in Π to increase arbitrarily, and because it depends on the true but unknown phase.If either A and B are nonzero, then the uncertainty in Π depends upon this phase in a way that can render statistical uncertainties difficult to compute and irregular.Thus, an important characteristic of a good polarimeter is designing it so that A and B are as close to zero as possible.As stated in the introduction, the gas pixel detectors on IXPE (Rankin et al. 2023) have uniform sensitivity to phase angle for the entire exposure, so A = B = 0.The case of a set of Bragg reflectors is worth examining.A single reflector has an ideal angular response that is a delta function in ψ: It can be shown that when ψ i = ψ 0 + πi/n B , then A and B are identically zero for arbitrary ψ 0 when n B > 2 and the solution to Eqs. 9 to 11 is not degenerate. 1 For the broad-band soft X-ray polarimeter with 3 Bragg reflectors at 120 • to each other (Marshall et al. 2018), A = B = 0 if all three channels are operated for the same time period.

ADDING A BACKGROUND TERM
There are two cases to consider.The easier case is when the background is unpolarized.This case helps set the stage for the case of polarized background, which is important for situations such as when measuring a pulsar inside a pulsar wind nebula or a source in the wings of a brighter, polarized source.
Regardless of whether the background is polarized, a background region of solid angle Ω is chosen that is source free and the source region covers a solid angle ζΩ that is presumed to have the same background characteristics.There are N events in the source region labeled with index i and N B events in the background region labeled with index j.This case is similar to that considered by Elsner et al. (2012) for the case of Gaussian counting statistics.To compare to their analysis more directly, we expect C B ≡ ζN B counts in the source region to be due to background, giving N −C B ≡ C S net counts in the source region.In this analysis, the exposure is uniform over ψ.

Unpolarized Background
If the background is unpolarized, the event density is relatively simple: for the source region and λ B (ψ) = B 2π for the background region.Here, the notation is simplified by defining N 0 = f 0 T η(E; ξ)A E dE, which is just the expected number of counts from the source under some spectral model f 0 η(E; ξ).Then, the log-likelihood for a Poisson probability distribution of source and background events, S = −2 ln L, is (dropping terms independent of B, N 0 , q, or u).Setting partial derivatives to zero gives for N 0 = 0 and defining w i = [1 + qc i + ûs i + ζ B/ N0 ] −1 .Eqs. 28 and 29 have been used to simplify Eq. 26 and Eq. 26 is used to simplify Eq. 27.Substituting N B for B in Eq. 26 and transforming from (q, u) to (Π, ϕ) gives which can be solved for N0 for trial values of Π and φ to make minimizing S simpler by substituting N0 and B = N B into Eq.25.
As Π −→ 0 N0 −→ N − ζN B = C S , as expected, providing a good starting point for estimating N0 .The minimum detectable polarization (MDP) for this case can be estimated by computing the uncertainty in Π, σ Π , by where the first step follows as µ i and ψ i are uncorrelated and the second step follows from the asymptotic value of N0 .Finally, the MDP at 99% confidence is just as found by Elsner et al. (2012) for Gaussian statistics with the exception of the substitution of the rms of µ i for µ.

Polarized Background
It is more likely that the X-ray background is partially polarized as it often contains some fraction of the source as well (due to the extent of the telescope's point spread function).The background is assumed to be primarily due to photons, essentially indistinguishable from source events, susceptible to the same modulation factor as source events are.If the background is polarized, the event density has added terms giving the normalized u and q of the background, denoted by q b and u b : for the source and background regions, respectively.Then, (dropping terms independent of B, N 0 , q, u, q b , or u b ) and again defining c i = µ i cos 2ψ i and s i = µ i sin 2ψ i .Setting partial derivatives to zero gives defining As before, Eqs.40, 41, and 38 have been used to derive Eq. 39.Eqs.43 and 43 can be solved for qb and ûb as in Marshall (2021a), giving when the background is weakly polarized.Not surprisingly, the optimal Stokes parameters for the background are derived from the background region alone.Now the background Stokes parameters can be used in Eq. 38 (via the definition of W i ) to derive an equation involving the source Stokes parameters similar to Eq. 30 that can be solved iteratively for N0 for trial values of Π and φ.Finally, Eq. 31 is modified to be 2 To first order in these quantities, as Π −→ 0, with ϕ B = 1 2 tan −1 (u b /q b ).The first term replicates Eq. 32.Because the extra terms are positive definite, they will increase σ Π , making the estimate of Π more uncertain when there is polarized background, as expected.The magnitude of the increase in the uncertainty depends on the ratio of the expected polarized counts to the total counts in the source region as well as the correlation between the source and background polarization phases.

AN UNBINNED MODEL TEST
Consider a Kolmogorov test of conditional probabilities for a model where q and u depend on ξ, representing time, spatial location, or energy.For example, a model where the polarization fraction is constant with time while the EVPA rotates uniformly with rate ω could be specified as where φ 0 and ω are (fitted) parameters of the model to be tested, ξ = t, and each event has a specified value of t given by t i .This model was applied to IXPE data from Mk 421, finding rotation rates of ω = 80 ± 9 • /d in one observation and ω = 91 ± 8 • /d in another (Di Gesu et al. 2023).Generally, using the source region event density given by Eq. 23, the conditional probability that ψ ≤ ψ i for event i given that ξ = ξ i is where q(ξ i ) ≡ q i and u(ξ i ) ≡ u i .As Π −→ 0, C(≤ ψ i ) approaches the uniform distribution, as expected.Under the hypothesis that the model is correct, though, we expect Eq. 51 to give values that are uniformly distributed between 0 and 1 even if p is non-zero.Thus, a Kolmogorov test of the cumulative distribution of C(≤ ψ i ) values should provide a valid unbinned test of the event angles.This test was implemented in Interactive Data Language (IDL) and applied to several different data sets from IXPE.In each case, events in the 2-8 keV band were used, the source region was 60 ′′ in radius, and the background was taken from an annulus 200 ′′ to 300 ′′ from the point source.The first source, Mk 501 (IXPE data set 01004501), was found to be 10 ± 2% polarized (Liodakis et al. 2022).For the null hypothesis that Mk 501 is unpolarized, the distribution of C(≤ ψ i ) deviated from the uniform distribution by 0.0085 with a set of 85,388 events in the source region; thus, the null hypothesis is rejected with a probability of less than 8 × 10 −6 .A likelihood ratio test rejects the null hypothesis with a probability of 7 × 10 −7 in this case, providing a somewhat better result for a simple test that the source is polarized.Under the hypothesis that the source is polarized, with parameters determined using the maximum likelihood method in § 3, then the deviation dropped to 0.00196, for a K-S probability of 0.90; thus, the constant polarized model with fixed Π and ϕ is acceptable, a conclusion that was not available to Liodakis et al. (2022).Similarly, constant rotation models for the second and third IXPE observations of Mk 421 (data sets 01003801 and 01003901, reported by Di Gesu et al. ( 2023)) are accepted with probabilities of 0.97 and 0.78, respectively.Finally, the test was run on data from Cen A (IXPE data set 01004301), for which no polarization was detected; the upper limit to the polarization was 6.5% at 99% confidence (Ehlert et al. 2022).For Cen A, the null hypothesis (that the source is unpolarized) is not rejected, giving a maximum deviation of 0.0039 with 28,078 events and a K-S probability of 0.79.In summary, while an analysis may provide parameters of a polarization model, this test can be used on unbinned data to test the validity of the model, providing the user a diagnostic that could indicate whether the model is inadequate.

Note added in proof
Between acceptance of this paper and the review of the proofs, Eq. 47 was independently derived using a Stokes subtraction formalism and the equation was reformed in order to improve its interpretation.While the first term dominates for weakly polarized background and for large source signals, the remaining terms deserve further comment.The second term arises because of the variance of the background Q and U, which is not considered in the case of unpolarized background.The term does not depend on the actual value of the polarization of the background, which may be negligible.Thus, unless one has independent evidence that the background polarization is zero, Eq 47 should be used instead of Eq. 32 or 33.The ratio of the second to the first term is approximately ζC B /N; if the source region has fixed size, this term can only be reduced by reducing ζ (i.e., increasing the size of the background region relative to the source region).The third term does depend on the polarization of the background but is zero when the source EVPA is perpendicular to the background EVPA.Thus, when the background is polarized, there is an asymmetry in the source polarization uncertainty contours in q, u space.