Detecting non-thermal emission in a solar microflare using nested sampling

Microflares are energetically smaller versions of solar flares, demonstrating the same processes of plasma heating and particle acceleration. However, it remains unclear down to what energy scales this impulsive energy release continues, which has implications for how the solar atmosphere is heated. The heating and particle acceleration in microflares can be studied through their X-ray emission, finding predominantly thermal emission at lower energies; however, at higher energies it can be difficult to distinguish whether the emission is due to hotter plasma and/or accelerated elections. We present the first application of nested sampling to solar flare X-ray spectra, an approach which provides a quantitative degree of confidence for one model over another. We analyse NuSTAR X-ray observations of a small active region microflare (A0.02 GOES/XRS class equivalent) that occurred on 2021 November 17, with a new Python package for spectral fitting, sunkit-spex, to compute the parameter posterior distributions and the evidence of different models representing the higher energy emission as due to thermal or non-thermal sources. Calculating the Bayes factor, we show there is significantly stronger evidence for the higher energy microflare emission to be produced by non-thermal emission from flare accelerated electrons than by an additional hot thermal source. Qualitative confirmation of this non-thermal source is provided by the lack of hotter (10 MK) emission in SDO/AIA's EUV data. The nested sampling approach used in this paper has provided clear support for non-thermal emission at the level of 3x10$^{24}$ erg s$^{-1}$ in this tiny microflare.


INTRODUCTION
Flares are explosive releases of energy that take place in active regions (ARs) thought to be produced and powered by magnetic reconnection of stressed magnetic fields in the solar atmosphere (Priest & Forbes 2002).The reconnection can release energies up to ∼10 32 erg and readily drives mass flows, plasma heating, and particle acceleration (Fletcher et al. 2011;Benz 2017).Flares produce emission across the electromagnetic spectrum and are commonly characterised by their GOES 1-8 Å soft X-ray (SXR) emission and thermal energy release.Flares with SXR emission <10 −6 W m −2 and energies between 10 26 -10 28 erg are commonly referred to as microflares (Lin et al. 1984;Hannah et al. 2011).
Flares with energies on the order of ∼10 24 erg, termed nanoflares, are proposed to occur everywhere on the solar disk and not just localised to ARs (Parker 1988).If microflares and nanoflares occur frequently enough then they could provide the majority fraction of the energy heating the corona from the overall flare distribution; however, this relies on the same flaring mechanisms scaling down to the weaker events, such as non-thermal particle acceleration emission (Hudson 1991).It is often difficult to ascertain if weak, sub-A class microflares do indeed show positive evidence for these standard flare processes often observed in their larger counterparts.
★ E-mail: coop0502@umn.edu(KC) Microflares have been extensively studied in X-rays with instruments such as the Reuven Ramaty High-Energy Solar Spectroscopic Imager (RHESSI; Lin et al. 2002), Chandrayaan-2's Solar X-ray Monitor (XSM; Vadawale et al. 2014;Shanmugam et al. 2020), and the Nuclear Spectroscopic Telescope ARray (NuSTAR; Harrison et al. 2013).Statistical and individual studies have observed hard X-ray emission during microflares from non-thermal electron acceleration showing evidence that microflares down to GOES class A0.1 appear to show similar processes to their brighter counterparts (Christe et al. 2008;Hannah et al. 2008;Glesener et al. 2020;Cooper et al. 2021).However, as the microflares get weaker it becomes increasingly difficult to determine if this flare behaviour continues to scale or has a lower limit.Sensitivity to these weak microflares is crucial in understanding if the flare process scales across these different classifications.
NuSTAR is an astrophysical telescope capable of observing the Sun >2.5 keV (Grefenstette et al. 2016;Hannah et al. 2016).NuSTAR consists of two telescopes utilising Wolter-i type optics to focus Xrays onto two focal plane modules (FPMA and B), each with a field of view (FOV) of 12 ′ ×12 ′ .Each FPM takes 2.5 ms to process a detected photon during which no other trigger can be recorded; the fraction of time NuSTAR spends open to detection during an observation is quantified by the livetime.Under quiescent conditions NuSTAR's livetime can reach up to 92% (Paterson et al. 2023); however, the livetime drops to <16% even with small microflares of A-class or smaller (Cooper et al. 2021).This limited throughput, combined with flare X-ray spectra steeply falling with increasing energy, results in a low number of NuSTAR counts at higher energies.
NuSTAR has observed several microflares with energies from 10 28 erg down to 10 26 erg with GOES classes of B, A, and sub-A (Glesener et al. 2017;Wright et al. 2017;Hannah et al. 2019;Cooper et al. 2020Cooper et al. , 2021;;Duncan et al. 2021) and also quiescent Sun features outside ARs of energies down to 10 26 erg (Kuhar et al. 2018;Paterson et al. 2023).Several of these studies have found consistency with the presence of non-thermal emission throughout the flare evolution while Glesener et al. (2020) and Cooper et al. (2021) show convincing evidence of non-thermal emission in an A5.7 and an estimated A0.1 microflare, respectively. 1t becomes more difficult with weaker flares to confidently determine the presence of any high-energy emission and even harder to determine the mechanism behind the emission.In order to determine the nature of the higher energy emission observed by an instrument from much weaker microflares, a robust method needs to be utilised which can investigate the difference between different model representations of the observed data.Nested sampling analysis (Skilling 2004(Skilling , 2006) ) can be used for this purpose.Note, this analytical technique can also be applied in general cases (e.g., in larger flares) where ambiguity exists between model fits to data.
Nested sampling is a Bayesian technique which is used to map the posterior distribution and estimate a quantity called the evidence which is the probability of an observation given the assumption of a model representation.The evidences of different hypotheses can be then used to compare different model fits to data, providing a level of confidence for one model over another.The nested sampling algorithm also accounts for different model parameters and different numbers of model parameters used between representations.There are many implementations of nested sampling (Kester & Mueller 2021;Ashton et al. 2022) and it is used extensively in many scientific fields (Knuth et al. 2015); however, it is not common in the solar physics community.
In this paper, we present the first use of nested sampling in the analysis of an active region NuSTAR X-ray microflare which took place on 2021 November 17 at ∼21:14 UT (SOL2021-11-17T21:14).In Section 2, we investigate the microflare evolution in time, space, and energy using NuSTAR and the Solar Dynamic Observatory's Atmospheric Imaging Assembly (SDO/AIA Lemen et al. 2012) and Heliospheric and Magnetic Imager (SDO/HMI Schou et al. 2012).We then describe the nested sampling algorithm and how this can be used to determine the most likely model representation to explain a given data-set in Section 3. In Section 4, we then apply the nested sampling algorithm to the NuSTAR X-ray spectral analysis for the first time where we determine the most likely explanation for the microflare emission.

X-RAY MICROFLARE
A NuSTAR solar campaign was performed on 2021 November 17-22 where nine hour-long observations were made of active regions present on the Sun's disk.During the third observation NuSTAR observed three microflares where the second one (microflare SOL2021-11-17T21:14) is the subject of this paper, the other flares and observations will be investigated in future papers.

Time evolution
Microflare SOL2021-11-17T21:14 is clearly observed in X-rays with NuSTAR as shown in Figure 1.The extreme ultraviolet (EUV) and X-ray time profiles from SDO/AIA and NuSTAR, respectively, are shown (left panels) where the SDO/AIA light curves are from a region around the microflare (see Figure 2) and the NuSTAR time profiles are integrated over the entire AR area indicated by a black box in Figure 1 (right panel).The X-ray image (right panel) shows the microflare in the top of NuSTAR's FOV, inside the black box, as a relatively bright source compared to the more northern AR (SPoCA 26190; Verbeeck et al. 2014) core emission.
We find that the native SDO/AIA channel light curves in shows a slight positive correlation and a possible negative correlation with the 304 Å channel.The microflare only becomes apparent in the EUV when calculating the Fe xviii proxy channel-a linear combination of the 94 Å, 171 Å, and 211 Å channels-as described in Del Zanna (2013).This channel has a significant response to thermal emission from material between 4-10 MK which is a crucial range for NuSTAR microflares (Hannah et al. 2016(Hannah et al. , 2019;;Wright et al. 2017;Glesener et al. 2020;Cooper et al. 2020Cooper et al. , 2021;;Duncan et al. 2021).
The Fe xviii light curve shows very similar progression to the 2.5-6 keV FPMA+B NuSTAR time profile indicating this microflare heats a significant amount of material to between 4-10 MK.The higher energy X-ray range, 6-10 keV, shows a more impulsive time profile that peaks earlier, indicative of hot plasma being present in the early stages of the microflare and/or non-thermal emission from an initially accelerated electron distribution.
A pre-flare and microflare time is defined from the NuSTAR time profiles and shown as a red and blue shaded region, respectively, in Figure 1.The microflare time is chosen based on the more impulsive 6-10 keV NuSTAR light curve to better investigate the emission processes in the initial flaring stages.
The microflare, along with many events NuSTAR observed in the observation campaign, is obvious in the X-ray regime where it is dominant across the whole FOV; however, as indicated by the SDO/AIA light curves in Figure 1, it is difficult to find corroborating evidence in the native EUV channels even when locating the microflare's position.Therefore, the EUV microflaring structure can only be reliably determined with information from NuSTAR and its comparison to Fe xviii images.

Spatial evolution
Figure 2 shows EUV images integrated over the microflare time.Comparable in size to the black box shown in the NuSTAR FOV image in Figure 1 (right panel), the left panel of Figure 2 shows the SDO/AIA 94 Å channel emission of the full AR with the microflare identified within a black box.The black box region identified to host the microflare is the area used to depicted the other panels.
The Fe xviii proxy channel and, to a lesser extent, the 94 Å channel show a loop structure while the other channels do not show any corresponding activity except at the apparent loop footpoints.Footpoint activity can be seen through all EUV channels; however, the footpoints do not appear to produce the same response at all levels in the solar atmosphere.The northern footpoint appears brighter in the upper transition region as shown by the relative brightness in 131 Å, 171 Å whereas the southern footpoint shows a greater response in the chromosphere and photosphere as seen in the 304 Å, 1600 Å, and 1700 Å channels (Lemen et al. 2012).From the SDO/HMI panel in Figure 2 we find the loop footpoints are anchored in opposite polarity regions.
Zoomed images with NuSTAR emission only showed a single circular shape to co-align with the EUV loop structure for the 2.5-6 keV and 6-10 keV emission.The lack of distinctive shape in X-rays may be expected due to the very few high energy microflare counts and the fact the angular extent of the microflare is ∼10 ′′ which is considerably smaller than NuSTAR's angular resolution with a FWHM and HPD of 18 ′′ and ∼60 ′′ , respectively (Harrison et al. 2013).
From the EUV images shown in Figure 2 we are able to obtain a microflaring loop volume by modelling it as a half-torus.We estimate an upper limit for the distance between the footpoints and the diameter of the loop to be approximately 9 ′′ and 2 ′′ (6.5×10 8 cm and 1.5×10 8 cm), respectively.Therefore, the volume obtained from the geometry as viewed in EUV is 1.7×10 25 cm 3 .

Spectral evolution
Figure 3 shows the spectral fitting analysis (see Section 2.3.1) of the NuSTAR FPMA and B grade 0 (single pixel) microflare emission on the pre-flare and microflare time using sunkit-spex2 which utilises the Emcee package (Foreman-Mackey et al. 2013).We find that the preflare time (Figure 3, left panel) is represented well with an isothermal model of temperature 3.3 MK and emission measure 1×10 46 cm −3 from the Markov chain Monte Carlo (MCMC) analysis, a common result from previous NuSTAR quiescent AR and pre-flare spectral fitting (Glesener et al. 2017;Wright et al. 2017;Hannah et al. 2019;Cooper et al. 2021).The isothermal model available in sunkit-spex is a Python version of the IDL function f_vth.pro(Schwartz et al. 2002) and uses CHIANTI V7.1 (Dere et al. 1997;Landi et al. 2013) with coronal abundances (Feldman et al. 1992;Landi et al. 2002).
The pre-flare thermal model is then used as a fixed component when fitting the microflare time with an additional thermal model representing the flaring emission (Figure 3, right panel).This model fit provides a temperature and emission measure in a sensible range for previous NuSTAR microflares, between 4-10 MK, as discussed in Section 2.1; however, it is clear that this model does not provide a satisfactory representation of the observed spectra.The residuals of the microflare fit in Figure 3 indicate a poor fit between 2.5-6 keV and a clear count excess above the model at energies >6 keV.Therefore, we find sufficient reason to include an additional model to the microflare fit in order to accurately represent the observed spectra.
Two model candidates are tested to fit the excess: a thermal scenario which includes an additional thermal model, and a non-thermal scenario which involves the thick-target model (Brown 1971;Holman et al. 2011).The thick-target model assumes a power-law distribution of electrons of spectral index  above a low energy cut-off E  that lose all their energy through Coulomb collisions.These hypotheses represent either hotter plasma or non-thermal emission during the impulsive phase of the microflare.In relation to these two excess additions, the microflare fit in Figure 3 is termed the null scenario since the excess is not represented.Representations of the photon models utilised in each scenario are shown in Figure A1.Note, unlike in the spectral analysis of brighter NuSTAR microflares, no gain correction (Duncan et al. 2021) is required due to the relatively high livetime of microflare SOL2021-11-17T21:14.
Figure 4 shows, in red, the thermal scenario fit (left panel) and the non-thermal scenario fit (right panel) to the microflare spectra.We find that both scenarios resolve the poor fit to the 2.5-6 keV range and represent the count excess well >6 keV.
The thermally fitted excess representation proposes the presence of a relatively weak emitting source with a temperature of ∼10 MK; whereas, the non-thermal case suggests thick-target emission with a  of ∼8 and an E  of ∼6 keV.We note the non-thermal parameters are well within those previously reported for other microflares (Hannah et al. 2008;Glesener et al. 2020;Cooper et al. 2021).The lower energy thermal models (purple) show a decrease in temperature and increase in emission measure compared to the values obtained in Figure 3 (right panel).
Using the temperatures and emission measures obtained from all microflare fits, we find the microflare to be an estimated GOES class between A0.02-A0.03.The GOES class is roughly estimated using the goes_flux49.proIDL routine as the microflare was too weak to provide a direct GOES/XRS measurement.From the flare volume upper limit determined in Section 2.2 and the microflare thermal parameters we find thermal energies of 1.6 +0.1 −0.1 ×10 26 erg, 3.0 +0.4 −0.4 ×10 26 erg, and 2.1 +0.1 −0.1 ×10 26 erg for the null, thermal, and non-thermal scenario fits, respectively, using Equation 3 and A4 from Hannah et al. (2008) and Aschwanden et al. (2015).In addition, the non-thermal power associated with the thick-target component in Figure 4 (right panel) is calculated to be 2.7 +2.7  −1.2 ×10 24 erg s −1 (Equation 5 from Wright et al. 2017) which results in 3.7 +3.8  −1.6 ×10 26 erg over the course of the impulsive phase.All thermal energies are in the expected range for a weak microflare and we note in the non-thermal case both energies are consistent with each other.Therefore, both hypotheses shown in Figure 4 presents an interesting and unique conclusion, either showing a microflare of this scale producing such hot temperatures in the impulsive phase or providing positive evidence for the presence of visible non-thermal particle acceleration via a clear count excess in the spectral fits.

Best spectral fit
The fits shown in Figure 3 and 4 are determined using the Poissonian likelihood, L (), given by where   () represents the predicted model counts with parameters  and   is the observed number of counts in a given energy bin, .
The number of data bins included in the optimisation is represented by .
We find the most optimum fit to the microflare spectra with the thermal, double thermal, and thermal and non-thermal models give a Poissonian log-likelihood value, (L   ), of -520, -484, and -480, respectively.This loosely suggests the non-thermal scenario fit (Figure 4, right panel) best represents the observed spectra out of the tested models.However, it may be expected this is the case since the thick-target model has more free parameters; therefore, it is difficult to ascertain whether the non-thermal scenario should be trusted more with such a small difference in log-likelihood values given the different number of parameters available to each model.
It is possible there is a discrepancy between the thermal excess scenario (Figure 4, left panel) and the EUV time profiles displayed in Figure 1.The double-thermal fit suggests the presence of material at ∼10 MK during the microflare's impulsive phase.However, the SDO/AIA 131 Å channel has a significant response to material of this temperature (Lemen et al. 2012) but the light curve does not show a noticeable increase in emission around this time.Folding the 10 MK thermal component through the EUV channel response, we find the hot component is very faint and may be too weak to produce a significant increase in 131 Å channel meaning the emission mechanism of the higher X-ray energy excess remains ambiguous.
A more robust approach is needed to assess the thermal and nonthermal representations of the microflare spectra.The nested sampling approach described in Skilling (2004) provides a reproducible, intuitive, and reliable method to ascertain how much more likely one hypothesis is compared to another.Using this approach, we can investigate the most likely representation of the microflare spectra.

COMPARING HYPOTHESES
Bayes formula (Jaynes 2003) is used extensively to test how well a certain hypothesis, , explains given data, , via the posterior, (|), and is given by where (|) is termed the likelihood which describes how likely the data is observed if the hypothesis is true and () represents the prior information on the hypothesis (Sivia & Skilling 2006).The term () is the evidence which describes how likely the data is to occur independent of hypothesis which is difficult to obtain and, in some cases, has very little meaning.
Different hypotheses for the given data can then be compared relative to each other using Equation 2 by calculating the posterior odds.To compute this between two different hypotheses-say  1 and  2 -for the same data, the ratio is taken between the respective posteriors as where we note the evidence term, (), from Equation 2 cancels (Ashton et al. 2022).Equation 3, therefore, provides a relative metric as to which hypothesis between  1 and  2 is more likely.It is common that the prior odds, ratio of ( 1 ) and ( 2 ), is evaluated to 1 if there is no prior justifiable preference for one hypothesis over another and so the posterior odds in this case is fully equivalent to the ratio of the likelihoods, termed Bayes factor (BF).Using a nested sampling algorithm (Skilling 2004(Skilling , 2006)), we can estimate the likelihoods by investigating the parameter posterior under the assumption that the hypothesis, now model , is true.Nested sampling is a Bayesian tool used to compare parametric model fits to data where the models have parameters, , and priors, (|).This is done by calculating the parameter posterior, (|, ), by where we note that all terms depend on the model, , and the data, , being fitted.This explicit form is typically presented in Bayesian analysis, such as in MCMC analysis (Ireland et al. 2013) where the ( |) term is often excluded in practice.However, to avoid the repetition of nomenclature, we adopt another equivalent representation where the nested sampling process uses the likelihood L () (e.g., Equation 1) and the prior () to estimate both the evidence Z and the posterior ().
Note that Z is equivalent to the likelihood term (|), in Equation 2 and 3, and is different to the previous evidence term () from Equation 2.
The evidence, Z, could be calculated as ensuring the integral of () over the parameter-space is equal to 1 (Sivia & Skilling 2006).However, this integral can quickly become complex with an increasing number of parameter dimensions.The nested sampling process takes an approach to simplify this calculation.
Estimating the evidences, Z (likelihood (|) in Equation 3) allows for a robust comparison between models and how well they explain the data.Criteria from Kass & Raftery (1995), for example, can then be used to assign a relative confidence of one hypothesis compared to another.Importantly, this is also true even if the hypotheses rely on a different number of parameters or parameter priors.The next section details how nested sampling is performed and how Z is obtained mathematically.

Calculating the evidence Z with nested sampling
The evidence Z is calculated by sampling a predefined and physically motivated constrained prior, (), for the model parameters while calculating the likelihood, L (), at every corresponding location.From this sampling, a quantity called the prior mass can be defined (Skilling 2006).The prior mass, , is the amount of prior enclosed by some likelihood  which is given by and contains all sampled points with L () > .From Equation 7, we note that  = 1 when  = 0 (all sampled points are enclosed) and so  = 0 when  = L  .The definition of the prior mass can then simplify Equation 5 and 6 to and respectively, where the evidence integral is now only performed over one dimension, the prior mass.Equation 8shows taking a random sample of   from 0-1, the range defined in Equation 9, provides a random sample from the posterior ().This is equivalent to obtaining a random sample from the posterior () with a random parameter sample of   as shown by Equation 5. A nested sampling algorithm will then iterate through the random samples spread over the constrained prior to calculate the evidence and posterior distribution.

The information H
A useful value obtained throughout the nested sampling process is a quantity known as the information, H .This quantity describes where the bulk of the posterior lies, with the posterior occupying a fraction of  −H within the constrained prior (Skilling 2006) and can also be used to estimate the likely number of iterations to compress the majority of the prior (Ashton et al. 2022).For example, if the majority of the posterior takes up a small region of the prior then H is large and if most of the posterior occupies a large area of the prior then H is small.

Iterating through the samples
The Python nested sampling package, Nestle3 , used throughout the analysis presented in Section 4 initially starts by sampling the constrained prior   times where the corresponding likelihood value is calculated at each sample.These live-points are then ordered from smallest likelihood, L * , to largest.The prior mass is then calculated for L * before the corresponding live-point is removed and replaced with another sample with a likelihood value >L * to conserve the number of samples across iterations.The prior mass and the likelihood of the removed live-point is recorded and used to build the integral described by Equation 9. Once a new live-point is chosen the process begins again and continues until the stopping criteria has been met (Skilling 2004).
The stopping criterion used in Nestle is one which estimates the remaining prior mass to be sampled.The iterative process can be stopped when the remaining estimated mass falls below a defined threshold,   ℎ ℎ , using where L , is the maximum likelihood of the live-points,   is the remaining prior mass, and Z  is evidence value at iteration .
In addition to simplifying the evidence calculations, nested sampling also obtains many random samples of the posterior through the iterative procedure.Therefore, almost as a by-product, the same information that MCMC analysis provides is also obtained in the process.
A nested sampling algorithm can be applied to many different problems involving model comparison.In Section 4 we apply the nested sampling algorithm used by Nestle to the active region X-ray microflare presented in Section 2 to determine the emission mechanisms present during its impulsive phase by testing different hypotheses for the observed data: the null, thermal, and non-thermal scenarios.

THERMAL OR NON-THERMAL EMISSION
The analysis presented in Section 2 seems to indicate that nonthermal emission is present during this estimated A0.02 microflare's impulsive phase; however, the arguments are qualitative or weakly quantitative and far from decisive.Section 2.1 shows evidence of an earlier peaking and more impulsive time profile in the higher, 6-10 keV X-ray energies observed by NuSTAR compared to the lower energy microflare emission (Figure 1, left panels).This supports the presence of an additional process beyond the one producing the EUV microflare signal, but it is not clear if this is due to a thermal or non-thermal source.
In section 2.2, we discussed the observed presence of a clear microflare loop structure in the Fe xviii emission (Figure 2), suggesting the presence of material between 4-10 MK which appears to be corroborated by all microflare spectral fits (Figure 3, right panel, and Figure 4).We also see loop footpoints across the SDO/AIA EUV channels that are anchored in two opposite magnetically polarised regions as viewed from SDO/HMI. Figure 2 indicates the presence Table 1.The lower and upper limits to define the uniform constrained prior for each model parameter used for nested sampling.The same notation for each parameter used in the spectral fitting is given in brackets as well as the parameter units.The parameters T2 and EM2 are present in all microflare fits (Figure 3 and 4) while T3 and EM3 are only in the thermal scenario fit and F e − , , and E  are only in the non-thermal scenario fit shown in Figure 4 to fit the count model excess. of bright footpoints which could potentially be a result from heated material through microflare energised electrons decelerating in the lower solar atmosphere.This interpretation would align with the presence of non-thermal emission.

Model
Performing spectral fitting analysis on the X-ray microflare spectra (Section 2.3) shows more evidence there is different behaviour below and above 6 keV.We find that an additional model is required to reasonably fit the count excess >6 keV beyond an isothermal fit and to resolve the poor fit <6 keV shown in Figure 3 (right panel).However, it is still not possible to confidently determine if an additional thermal or non-thermal model is required (Figure 4).
In order to obtain a robust measure of confidence over the nature of the high-energy 6-10 keV emission observed from the microflare, we make use of the nested sampling process (see Section 3).The nested sampling result will then provide a vigorous, intuitive, and repeatable level of confidence on the emission mechanism most likely responsible for the higher energy X-ray emission.

Nested sampling application to SOL2021-11-17T21:14
Since nested sampling relies on a constrained prior (Section 3.1), effort must be taken to define appropriate bounds for each parameter.We make use of a uniform prior for all parameters where the bounds of each is determined by previous microflare studies with consideration to the thermal and non-thermal energetics involved.
Table 1 shows the bounds for the uniform priors used in the nested sampling analysis.Studies of microflares comparable in scale to the one studied here, estimated GOES class ∼A0.02, have suggested that those fitted with a single thermal model tend to have a temperature no higher than ∼10 MK with emission measure ≲1×10 46 cm −3 (Duncan et al. 2021;Vadawale et al. 2021).Additionally, some enhanced pre-flare emission may be present while some isothermal NuSTAR microflares have emission measures as low as ∼1×10 43 cm −3 (Cooper et al. 2021).Therefore, sensible prior bounds for the microflare temperature and emission measure (T2 and EM2 from Figure 3 and 4) are taken to be 2.5-10 MK and 1×10 42 -1×10 46 cm −3 , respectively.
From the physically motivated parameter prior ranges for T2 & EM2, and using the volume estimate from Section 2.2, the possible thermal energies resulting from models within these bounds fall between approximately 4×10 24 -2×10 27 erg.Considering past NuS-TAR sub-A class microflares, this is a conservative thermal energy range and helps support the choice of the defined parameter prior bounds.
Next, priors must be defined for the thermal (T3 and EM3) and non-thermal (F e − , , and E  ) excess model parameters.When other microflares have been found to be best fitted with two isothermal models, we find that the emission measure for the higher temperature component is ∼2 orders of magnitude less than the lower temperature model (Duncan et al. 2021;Cooper et al. 2021) and so we choose a prior emission measure range of 1×10 40 -1×10 44 cm −3 .In order to investigate a potential hotter temperature component producing the count model excess in Figure 3 (right panel) we set a prior temperature range of 8-15 MK such that is overlaps with, and goes beyond, the range being investigated for T2.
The priors for the non-thermal excess models are determined from previous non-thermal X-ray microflare studies.Hannah et al. (2008) finds 90% of the RHESSI microflares studied have a low-energy cut-off between 9-16 keV with photon indices between 4-10 (corresponding to electron indices between 5-11 for thick-target emission; Brown 1971).However, the majority of these non-thermal X-ray microflares are of a greater GOES class and brighter than ones viewed by NuSTAR (Glesener et al. 2020;Cooper et al. 2021) which do not have emission extending to energies as high.Therefore, the conservative uniform prior bounds for the low-energy cut-off and the electron index are defined to be 3-10 keV and 4-15, respectively.
The microflare presented here is much weaker in magnitude than the non-thermal microflares investigated previously by NuSTAR and so the electron flux is expected to be less than previously obtained.Therefore, the prior range is estimated to be 10 30 -10 33 electrons s −1 as this microflare is approximately three orders of magnitude weaker in GOES classification than the non-thermal microflare studied in Glesener et al. (2020) which is found to have an electron flux of ∼2×10 35 electrons s −1 .The prior constraints for the non-thermal model provides an energy range ∼10 23 -10 27 erg which is complementary to the thermal energy range being explored for the microflare providing additional physical justification for the thick-target parameter constrained prior bounds.
Throughout the nested sampling analysis, all three scenarios are run with 10,000 live-points and an   ℎ ℎ value of 0.1.These, again, are conservative values to ensure the majority of the prior is sampled adequately.The nested sampling result does not change significantly with fewer live-points or a larger   ℎ ℎ , only the uncertainties become larger.

Nested sampling results
Nested sampling analysis is performed on all three model representations of the microflare spectra where the process took on the order of hours to complete for each model scenario using an Apple M1 Max MacBook Pro.The thermal and non-thermal representations of the excess from Figure 4 (left and right panel) give (Z) values of −497.31 ± 0.03 and −493.63 ± 0.03, respectively, while the null scenario, where the excess is not represented (Figure 3, right panel), is estimated to have a value of −530.14 ± 0.03.
The H values (as described in Section 3.1.1)reported for the analysis in each case is given to be ∼9 for the null scenario and ∼11 for both the thermal and non-thermal cases.The similar values indicate that the bulk of the posterior lies within a similar fraction of the constrained prior for each tested hypothesis.
The posterior distribution corner plots that accompany the evidences are shown in Figure 5, 6, and 7. We find that the constructed corner plots from the nested sampling analysis agree closely with those produced from the previous MCMC analysis performed in Table 2.The logarithm of Bayes factor, Bayes factor, and the corresponding level of confidence from Kass & Raftery (1995)  Section 2.3 with all parameter values agreeing well within the 1- equivalent uncertainties.This provides confidence that the posterior distribution for each model parameter, bound by the defined priors, is sampled well in the MCMC and that there are no other relevant solutions inside the physically motivated prior bounds.
With the confirmation from the corner plots produced from the nested sampling analysis, and corroboration with the MCMC analysis that the evidences have been calculated robustly, we are able to compare each model representation to the others using Bayes factor from Equation 3.This is reasonable as we have no evidence or reason to prefer one model representation over the other; therefore, we assume a prior odds ratio of 1 making the BF equal to the posterior odds.
The BF for each comparison is shown in Table 2.We find that the BF comparing the thermal and non-thermal representations of the count excess are far more probable than not representing the excess at all in the null scenario.Therefore, nested sampling has given a quantitative measure of how much an additional model is required beyond the pre-flare and isothermal fit with the thermal and nonthermal scenarios being >10 14 times more probable than the null hypothesis.
Additionally, the nested sampling also shows that the non-thermal representation is ∼40 times more likely to be the cause of the count excess compared to the thermal model, corresponding to strong evidence for this conclusion.Therefore, the nested sampling analysis would suggest that this event is the weakest X-ray microflare to show direct evidence for non-thermal emission.
To check the sensitivity of the nested sampling result on the choice of physically motivated prior bounds from Table 1, we adjust the bounds of each parameter prior by up to 20%.This still results in the non-thermal scenario being more preferable to the thermal representation with (BF) values between 3.5-3.8.Furthermore, we narrow the priors around the bulk of the T3 and EM3 distributions shown in Figure 6 while leaving the nonthermal parameter priors unchanged in order to be more favourable to the thermal scenario.An (BF) value of ∼2 is obtained from this test, which is still classified as positive evidence for the non-thermal representation of the microflare (Kass & Raftery 1995).
We note that the best-fit log-likelihood values, (L   ), stated in Section 2.3.1 show similar differences to the log-evidence values, (Z), for the different scenarios; however, the nested sampling result is more informative and robust for model comparison.The evidences can sufficiently compare models with different parameters and priors, whereas a clear conclusion cannot be drawn from the best-fit log-likelihood values as discussed in Section 2.3.1 and 3.

SUMMARY AND CONCLUSIONS
In this paper, we present the first analysis of X-ray flare spectra using a nested sampling algorithm.This microflare is estimated to be T2: 6.4  approximately an A0.02 GOES equivalent class flare which shows signs of high temperatures and/or non-thermal particle acceleration; however, determining the extent of this emission is difficult using arguments and methods performed in the past.
From the temporal, spatial, and spectral information discussed in Section 2, we find evidence that the X-ray microflare emission is not well represented with an isothermal model as a count excess is present at higher energies in the NuSTAR spectra (Figure 3).Upon investigating two emission mechanisms potentially responsible for this we find that both a thermal and non-thermal explanation for the excess appear to be equally valid with no decisive reason to pick one over the other.
Qualitative evidence for a non-thermal representation is found in the form of the lack of higher temperature (∼10 MK) emission response in the 131 Å SDO/AIA channel (Figure 2.1) and potentially in the presence of bright EUV loop footpoints visible throughout the solar atmosphere (Figure 2.2).When performing spectral fitting, the model with the non-thermal component produces a slightly more preferable log-likelihood value (Figure 4); however, this metric may be expected to be better due to the non-thermal component having an extra free parameter to use during the fitting process compared to the thermal model.Therefore, a conclusion cannot be made based on the best-fit log-likelihood values.
We use a more robust model comparison method called nested sampling (Section 3) which is used to determine an estimate for the evidence attributed to each model representation of the data, therefore, allowing Bayes factor to be computed for model comparison.In the process we also obtain the posterior distributions for each model as shown in Figure 5, 6, and 7. We find that the model containing the non-thermal component is most likely to represent the observed microflare spectra with a BF of 7×10 15 and 40 compared to the null and thermal representation, respectively.
Therefore, we report the weakest X-ray microflare to have direct observation of non-thermal particle emission suggesting that X-ray flares of the estimated scale A0.02 do indeed show similar traits to their larger counterparts.From the nested sampling results, this microflare produces a thermal energy of 2.1 +0.1 −0.1 ×10 26 erg which is rational compared to the non-thermal energy of 4.2 +4.6  −1.9 ×10 26 erg released over the course of its impulsive phase at 3.0 +3.3  −1.4 ×10 24 erg s −1 .The corresponding energy posterior distributions of each model scenario are shown in Figure 5, 6, and 7.This shows that microflares this weak, and likely weaker, continue to undergo the same physical processes with the same/similar emission mechanisms as brighter flares.
The nested sampling algorithm is in no way specific to X-ray microflare analysis.It can use used to gain insight into general model comparison problems and is able to produce the same data products as MCMC analysis.However, effort will be made to speed up the process specific to this microflare analysis.This could be achieved by speeding up the code used for the individual component models and testing a range of nested sampling algorithm implementations such as diffusive nested sampling (Brewer et al. 2011) and those discussed in Speagle (2020) and Williams et al. (2023).
Using nested sampling has enabled the robust analysis of the highenergy count excess.Methods to determine the emission mechanism for such features in the past are either primarily subjective in nature and/or fail to give a reliable conclusion.The nested sampling algorithm is able to allow the repeatable and intuitive study of data with 0.7.3 (Barnes et al. 2020a) of the Aiapy open source software pack-age (Barnes et al. 2020b), and made use of Astropy,4 a communitydeveloped core Python package for Astronomy (The Astropy Collaboration et al. 2018).Other Python packages that were extensively used were Matplotlib (Hunter 2007), NumPy (Harris et al. 2020), and SciPy (Virtanen et al. 2020).This research also made use of HEASoft (a unified release of FTOOLS and XANADU software packages) and NuSTAR Data Analysis Software (NuSTARDAS).This paper also made use of the SolarSoft IDL distribution (SSW) from the IDL Astronomy Library.
KC was supported by a Royal Society Research Fellows Enhancement Award RGF\EA\180010 and IGH was supported by STFC grant ST/T000422/1.This work is also supported by the NSF career grant AGS 1752268.The authors would like to thank John Veitch and Christopher Messenger for their insight and helpful discussions with regards to the nested sampling process.We would also like to thank the anonymous referee for their helpful feedback.E Non thermal : 4.2 +4.6 1.9

Figure 1 .
Figure 1.SDO/AIA, including Fe xviii proxy, and NuSTAR livetime corrected light curves over the time of microflare SOL2021-11-17T21:14 (left panels).The SDO/AIA time profiles are averaged over the black box region shown in Figure 2 and a scale factor (for plotting purposes) has been applied, as shown, to several channels.The area used to create the NuSTAR light curves is shown as a black box across AR SPoCA 26190 in the NuSTAR >2.5 keV integrated, livetime corrected FOV (right panel).A pre-flare (21:09:40-21:12:00 UT) and microflare (21:12:30-21:14:50 UT) time is indicated by the shaded red and blue areas in the NuSTAR light curve panels, respectively.The red circle with a radius of 48 ′′ shown in the right panel indicates the region size used to produce spectral fit profiles for the NuSTAR spectra.

Figure 2 .
Figure 2. SDO/AIA native channels and Fe xviii proxy are averaged over the microflare time (blue shaded region, Figure 1) while the SDO/HMI line-of-sight magnetogram is taken from the start of the time range.The left panel shows the 94 Å channel emission over the full active region with a FOV slightly smaller than the boxed region in the NuSTAR image from Figure 1.A black box indicates the location of the microflare and is used to create the zoomed in images for the other emission channels (right panels).The Fe xviii proxy microflaring loop emission contours at 5%, 50%, and 95% of the maximum are overlaid on the zoomed panels and are shown in red.

Figure 3 .
Figure 3. Simultaneous thermal model fits, using sunkit-spex, of NuSTAR's FPMA and B emission spectra during the pre-flare (21:09:40-21:12:00 UT, left panel) and microflare (21:12:30-21:14:50 UT, right panel) times which are shown as shaded red and blue regions in Figure 1, respectively.The pre-flare spectra are fitted with one thermal model (black) and then used as a fixed component for the microflare spectra (blue).The microflare spectra are fitted with an additional thermal model (purple) to account for the flaring emission with the overall model being shown in black.The spectra from both times are fitted over the energy ranges indicated by the horizontal green line in the residual panels.The temperatures and emission measures for each model fit are shown in their respective model colours where the error ranges are calculated from MCMC analysis and report the 1- equivalent uncertainty.Additionally, 100 random model samples from the MCMC analysis are shown in orange.The relevant time ranges, effective exposures, and livetimes are also shown in each panel.The microflare fit in the right panel is also referred to as the null scenario in relation to model comparison.

Figure 4 .
Figure 4. Two different spectral fits of the microflare spectra from the right panel of Figure 3, one with the count model excess fitted with a thermal model (the thermal scenario, left panel) and the other fitted with a non-thermal model (non-thermal scenario, right panel) shown in red.The model parameters are shown in their respective plots and colours with their error values showing 1- equivalent uncertainties resulting from MCMC analysis with 100 random model samples shown in orange.

Figure 5 .
Figure 5. Posterior distributions for the isothermal, null scenario, representation of the microflare spectra shown in Figure 3 (right panel) as determined from nested sampling analysis.The thermal energy distribution is calculated from the temperature (T2) and emission measure (EM2) samples.The median and 1- confidence intervals are displayed above the diagonal panels for each marginalised parameter distribution and shown with dashed lines.Contours of 50%, 68%, and 90% levels are shown in the 2D marginalised posterior distribution.

Figure 7 .
Figure 7. Similar to Figure 5 but the nested sampling analysis result for the non-thermal scenario shown in the right panel of Figure 4.The thermal energy distribution is calculated from the temperature (T2) and emission measure (EM2) samples and the non-thermal energy distribution is calculated from the electron flux (F e − ), electron spectral index ( ), and the low-energy cut-off (E  ) samples.
are shown for each model scenario comparison for the microflare spectra.The error on (BF) is ±0.04 for all values.