# Bayesian approach for modeling global magnetic parameters for the solar active region

M. Poisson, F. Grings, C. H. Mandrini, M. López Fuentes, P. Démoulin

► To cite this version:

M. Poisson, F. Grings, C. H. Mandrini, M. López Fuentes, P. Démoulin. Bayesian approach for modeling global magnetic parameters for the solar active region. Astronomy and Astrophysics - A&A, 2022, 665, 10.1051/0004-6361/202244058. insu-03874897

HAL Id: insu-03874897

https://insu.hal.science/insu-03874897

Submitted on 28 Nov 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Bayesian approach for modeling global magnetic parameters for the solar active region*

M. Poisson<fnref n="1" />, F. Grings<fnref n="1" />, C. H. Mandrini<fnref n="1" />, M. López Fuentes<fnref n="1" />, and P. Démoulin<fnref n="2" />,<fnref n="3" />

Received 19 May 2022 / Accepted 30 June 2022

## ABSTRACT

*Context.* Active regions (ARs) appear in the solar atmosphere as a consequence of the emergence of magnetic flux tubes. The presence of elongated magnetic polarities in line-of-sight (LOS) magnetograms indicates the existence of twist in the flux tubes that form them. These polarity elongations, referred to as magnetic tongues, bias the measurement of AR characteristics obtained during their emergence phase (e.g., their tilt angle and magnetic flux). In particular, obtaining a good estimation of the tilt angle evolution plays a key role in constraining flux-transport dynamo models.

*Aims.* In this work, we aim to estimate the intrinsic properties of the twisted flux tubes, or flux ropes, that form ARs by quantitatively comparing observed LOS magnetograms with synthetic ones derived from a toroidal magnetic flux tube model.

*Methods.* We developed a Bayesian inference method to obtain the statistical distributions of the inferred model parameters. As an example, we applied the method to NOAA AR 10268. Next, we tested the results using a synthetic-AR generator to quantify the effect of small-scale perturbations over the inferred parameter distributions.

*Results.* We conclude that this method can significantly remove the effects of magnetic tongues on the derived AR global characteristics, providing a better understanding of the intrinsic properties of the emerging flux rope.

*Conclusions.* These results provide a framework for future analyses of the physical properties of emerging ARs using Bayesian statistics.

**Key words.** Sun: magnetic fields – Sun: photosphere – methods: statistical

## 1. Introduction

Active regions (ARs) appear in the solar photosphere as concentrated and compact magnetic field distributions. Their origin can be explained by a dynamo mechanism acting at the bottom of the convective zone (CZ), where the magnetic flux is amplified and its structure is distorted (Fan 2009). Magnetohydrodynamic (MHD) numerical simulations show that a buoyant instability process can create coherent magnetic flux tubes that rise from the deep layers of the CZ out to the solar atmosphere (Weber et al. 2013). These simulations proved that the magnetic flux tubes should be twisted, forming flux ropes (FRs), in order to maintain their cohesion against the plasma vortexes that develop in their wake (Emonet & Moreno-Insertis 1998; Abbett et al. 2001; Martínez-Sykora et al. 2015).

In general, the photospheric line-of-sight (LOS) magnetic field of ARs displays a bipolar configuration. Several asymmetries are observed in the AR polarities as a consequence of the emergence process and the twist of the FRs. The so-called magnetic tongues observed in LOS magnetograms are evidence of the twist of the emerging FRs. They are characterized by the elongation of the magnetic polarities and the inclination of the polarity inversion line (PIL) with respect to the perpendicular direction to the bipole axis (an axis pointing from the fol-

lowing to the leading polarity centers). The magnetic flux distribution observed in LOS magnetograms is a combination of both the axial and the azimuthal field components projected in the LOS direction. During the emergence of the FR, the axial field component is associated with the formation of two main magnetic polarities which separate as the AR evolves. The azimuthal component, which is orthogonal to the axial component, introduces an asymmetric extension of the magnetic polarities that are referred to as magnetic tongues. They are longer and they have a larger magnetic flux as the emerging flux tube is more twisted (López Fuentes et al. 2000; Luoni et al. 2011). This projection effect is stronger during the emergence phase of the AR and has been reported in many different works (see, e.g., Luoni et al. 2011; Mandrini et al. 2014; Valori et al. 2015; Yardley et al. 2016; Vemareddy & Démoulin 2017; Dacie et al. 2018; López Fuentes et al. 2018). Tongues are also present in MHD simulations of FR emergence (Archontis & Hood 2010; Cheung et al. 2010; MacTaggart 2011; Jouve et al. 2013; Rempel & Cheung 2014; Takasao et al. 2015).

Another important property of the emerging FRs is their tilt angle, defined as the inclination of the bipole axis with respect to the east-west direction. Observations show a tendency of the leading polarity of ARs to be located closer to the solar equator relative to the following polarity, the so-called Joy's Law (Hale et al. 1919). The latitudinal distribution of the tilt (see the review by van Driel-Gesztelyi & Green 2015, and references

<footnote n="1">¹ Instituto de Astronomía y Física del espacio (CONICET-UBA), Buenos Aires and CC. 67, Suc. 28, 1428 Buenos Aires, Argentina
e-mail: mpoisson@iafe.uba.ar</footnote>

<footnote n="2">² LESIA, Observatoire de Paris, Université PSL, CNRS, Sorbonne Université, Univ. Paris Diderot, Sorbonne Paris Cité, 5 place Jules Janssen, 92195 Meudon, France</footnote>

<footnote n="3">³ Laboratoire Cogitamus, rue Descartes, 75005 Paris, France</footnote>

<footnote>* Movie is available at https://www.aanda.org</footnote>
therein) plays a central role in flux-transport dynamo models as a fundamental ingredient for the formation and evolution of the polar field (see the review by Wang 2017, and references therein).

A substantial effort has been made over the past few years to characterize the tilt of ARs, offering a range of results (Li & Ulrich 2012; McClintock & Norton 2013; McClintock et al. 2014; Wang et al. 2015; Tlatova et al. 2018). Tilt angles can be derived with different methods depending on the available observations. The longest databases correspond to white-light (WL) photographic observations (see e.g., Howard et al. 1984; Sivaraman et al. 1993; Baranyi et al. 2016). The WL tilt can be obtained by grouping sunspot umbrae (penumbrae) as leading or following polarities, according to their east-west position, and then computing the area-weighted center of each group. Due to the fact that sunspots and pores are present in the strongest magnetic fields, strong magnetic tongues are also expected to modify WL images (Poisson et al. 2020b).

The use of LOS magnetograms provides a more precise separation between leading and following polarities than WL data. The mean location of each main magnetic polarity can be obtained by computing the flux-weighted center of each polarity distribution (i.e., the magnetic barycenters). During the AR emergence, the elongation of the magnetic polarities produces an asymmetry of the flux concentrations on each polarity that shifts the location of the magnetic barycenters toward the PIL, thus modifying the tilt-angle measurements done directly on LOS magnetograms. In other words, the azimuthal field component, responsible of the magnetic tongues, systematically affect the estimation of the tilt angle in the early stages of the AR evolution. In Poisson et al. (2020a), we developed a method, called Core Field Fit Estimator (CoFFE) that succeeds in removing most of the effect of magnetic tongues on the computation of the location of the magnetic barycenters and, hence, allows us to obtain an AR tilt-angle that better represents the FR intrinsic tilt.

In this work, we aim to obtain AR global magnetic parameters by modeling LOS magnetograms of an emerging AR with synthetic magnetograms generated from a half-torus model. The inferred parameters can provide a better estimation of the FR intrinsic properties, reducing the effect of the magnetic tongues, since the elongation of the polarities produced by the presence of twist is inherent to our model.

In Sect. 2, we describe the LOS magnetograms used, the AR selection criteria, and the AR example selected. In Sect. 3, we summarize the half-torus model and describes how the synthetic magnetograms are built. In Sect. 4, we introduce the Bayesian probabilistic method and describe the tools used to sample the model parameter space. Next, we apply this method to infer model parameters from AR 10268 observed magnetograms. In Sect. 5, we present an AR simulator used to explore the limitations of the proposed method. Finally, we discuss and draw our conclusions on the implications of the method and its applicability to solar data in Sect. 6.

## 2. Data description and processing

We used full-disk LOS magnetograms obtained with the Michelson Doppler Imager (MDI) on board the Solar and Heliospheric Observatory (SOHO). These magnetograms are constructed on board SOHO by measuring the Zeeman effect in right and left circularly polarized light. The magnetograms from the 96-minute series, obtained from 5 minute averaged magnetograms, have a lower noise level than the 1 hour series and an error per pixel of ≈9G (Liu et al. 2004). These magnetograms have a

<figure><img src="image_2.png" /><figcaption>**Fig. 1.** LOS magnetograms corresponding to AR 10268 at four different stages of its emergence. The red- and blue-shaded areas represent the positive and the negative LOS magnetic field component. The red (blue) contours correspond to positive (negative) magnetic field with a strength of 20 G (−20 G) and 500 G (−500 G). The magnetograms are limited to square regions adjusted to the evolution of the AR extension.</figcaption></figure>

spatial resolution of 1.98" and are obtained using a CCD of 1024 × 1024 pixels.

From the full-disk magnetograms, we selected the area containing NOAA AR 10268, covering its full observed emergence, corresponding to 66 magnetograms over 5 days of observations. We limit the latitudinal and longitudinal range of the selected AR within −35° to 35° from the disk center to reduce the projection effect of the LOS magnetic field component when the observations are close to the solar limb. Panel a of the movie (mov-fig3.mp4) in the supplementary material shows the evolution of the AR with a cadence of 192 minutes between January 22 and 26, 2003.

AR 10268 presents a long and persistent emergence and it maintains its bipolar configuration along its full evolution. Along the analyzed time span the AR is classified mainly as a β-type AR. For January 25, a different classification is provided by the NOAA/USAF Active Region Summary, indicating a βδ-type AR; this does not agree with the observed magnetograms because AR 10268 maintains its simple bipolar configuration. A direct comparison between magnetograms and MDI white-light images shows that all the regions where umbrae share the same penumbra have the same polarity sign; therefore, they not correspond to a δ-type classification.

Despite the asymmetry between the leading and following polarities, the tongues are clearly identified with an elongated pattern associated with the emergence of a negative twisted FR (Fig. 1). We also see a sustained rotation of the bipole, suggesting a consistent variation of the intrinsic tilt angle or the effect of the continued contraction of the magnetic tongues along the emergence (see movie mov-fig3.mp4).

We processed the AR magnetograms to construct a data cube using a time step of 192 min (i.e., we used one third of the available magnetograms). We decreased the number of
magnetograms to reduce the computational time required for each method. This is admissible, since the data cadence has a weak or negligible effect on the results of the method described in Sect. 4. Using standard SolarSoftWare (SSW) tools, we transformed the LOS component of the magnetic field to the solar radial direction. Since we limited the longitudinal and latitudinal span of the observations, the latter approximation produces no significant effect on the resulting magnetic flux density (Green et al. 2003). Finally, we rotated the set of magnetograms to the time when the AR was located at the central meridian. This procedure corrects for the solar differential rotation using the coefficients derived by Howard et al. (1990). As a final step, we selected a sub-region that encompasses the AR, while reducing the surrounding magnetic field as much as possible.

### 3. Half-torus analytical model

The FR model, developed by Luoni et al. (2011), and briefly described here in Appendix A, provides an approximate representation of the global photospheric magnetic field distribution observed during the emergence of bipolar ARs. It consists of a half-torus field structure with uniform twist (both along and across its axis) that is set to progressively emerge through the photosphere without distortion (see Fig. A.1 and the appendix in Poisson et al. 2016). For simplicity, the model does not include the deformations and reconnections occurring during its emergence or any interaction between the magnetic field and the plasma. Still, it has been shown that this model is a powerful and fast tool to represent the global properties of bipolar ARs (Poisson et al. 2015a, 2020a).

The model is strictly sub-photospheric and its application was limited to reproduce only global aspects of the photospheric magnetic flux distribution of β-type ARs. More complex ARs (e.g., those including δ-spots) cannot be reproduced with a single toroidal FR defined by the half-torus model, unless the particular characteristics of the AR allow for a separation in different individual bipoles. This work aims to analyze global aspect of simple bipolar ARs (β-type ARs), which correspond to the most commonly observed ones during any stage of the solar cycle (Nikbakhsh et al. 2019).

The FR model construction is based on a set of free parameters. The half-torus model has three dimensional and one non-dimensional parameters, as follows. The small radius $a$ and the large radius $R$ are associated with the size of the main polarities and the distance between their barycenters, respectively. The maximum field strength (at the axis of the torus) is defined by $B_0$ in Gaussian units. The sign and amount of magnetic twist is given by imposing the non-dimensional parameter $N_t$, or twist number, corresponding to the number of turns of magnetic field lines around half of the torus axis (see Fig. 2 in Luoni et al. 2011). For a better understanding of these parameters, we include a sketch in Appendix A, together with the equations of the axial and azimuthal field components of the model.

In order to produce synthetic magnetograms, we cut the half-torus into successive planes, each of which corresponds to the relative position of the photospheric plane as the FR emerges. We define the $z$ axis as the normal to the photospheric planes. For each particular magnetogram, $z = 0$ corresponds to the location of the photospheric plane. The torus axis of revolution (i.e., the half-torus base) is set at a depth of $z = -d$ (see Fig. A.1 in Appendix A). The computation of the field component $B_z$ at $z = 0$, for different values of $d$, produces a series of magnetograms that are determined by the values of the five model parameters: ($a$, $R$, $N_t$, $B_0$, $d$). Moreover, since the model applies

to observed ARs, we need three additional parameters to define the position and the orientation of the FR within the magnetogram. Therefore, we include the parameters $x_c$ and $y_c$, which indicate the mean point between the main polarities in Cartesian coordinates in the magnetogram frame ($x$ and $y$ for the east-west and the south-north directions, respectively). The last parameter is the FR tilt $\phi$, defined as the inclination of the polarities with respect to the east-west direction. Finally, we define $M_{\mathfrak{p}_i}$ as the synthetic magnetogram obtained with the set of parameters $\mathfrak{p}_i = [a^{(i)}, R^{(i)}, N_t^{(i)}, B_0^{(i)}, d^{(i)}, x_c^{(i)}, y_c^{(i)}, \phi^{(i)}]$, where the index, $i$, corresponds to a given set of parameters.

The depth, $d$, can be normalized using the torus size as follows. We use the apex distance, $R + a$, to introduce the non-dimensional parameter $d_0$ as:

$$d = (1 - d_0)(R + a). \qquad (1)$$

Here, the parameter $d_0$ ranges between 0 and 1, and corresponds to the fraction of the FR that has already emerged.

### 4. Data modeling

In this section, we summarize the main characteristics of the modeling approach. The inference scheme was implemented using the open source library PyMC3, which provides all the needed tools for probabilistic analysis (e.g., sampling and variational fitting algorithms, Salvatier et al. 2016). It relies on the Theano package for tensor algebra support, automatic differentiation, optimization, and dynamic C compilation.

#### 4.1. Bayesian probabilistic analysis

The aim of the Bayes inference scheme is to obtain an estimation of the posterior probability, $P(\mathfrak{p}|M_o)$, which provides the probability with which a certain combination of the model parameters $\mathfrak{p}$ replicates the observed magnetogram, $M_o$. We can obtain the posterior probability distribution, or simply, the “posterior”, using the Bayes theorem expression:

$$P(\mathfrak{p}|M_o) = \frac{\mathcal{L}(M_o; M_{\mathfrak{p}_i}, \sigma) P(\mathfrak{p})}{P(M_o)}, \qquad (2)$$

where $\mathcal{L}(M_o; M_{\mathfrak{p}_i}, \sigma)$ is the conditional probability or likelihood (where the parameter $\sigma$ is the standard deviation between the model and the observations, defined in Sect. 4.3), $P(\mathfrak{p})$ defines the prior probability distribution of model parameters (or simply, the “prior”), and $P(M_o)$ is the model evidence or marginal likelihood.

The posterior, $P(\mathfrak{p}|M_o)$, for our model is an eight-dimensional distribution in which covariance elements are present. However, given the nature of the present problem, statistical independence between model parameters is assumed for this first application (the removal of this hypothesis is left for a future development). Therefore, we are not considering a priori correlations between the parameters (first-order approximation of $\mathcal{L}$) and we limit our analysis to the marginal posteriors. The marginal posterior for each parameter is obtained by integrating the full posterior in Eq. (2) over the remaining seven parameters within the prior bounds. Therefore, each parameter takes on a marginal posterior distribution.

The model evidence, $P(M_o)$ in Eq. (2), is the same for all combinations of $\mathfrak{p}$, so this factor does not affect the relative probabilities of different parameters. The evidence $P(M_o)$ describes the probability distribution of observing $M_o$ with all the possible parameters, $\mathfrak{p}_i$, as defined based on the prior probabilities.
This factor is useful for model comparisons but it is generally costly to derive, as it requires a numerical integration the whole probability distributions.

P(p) introduces into the inference the information we have about the model parameters. In this sense, the prior comprises our knowledge of the physical system we aim to model (i.e., we guarantee that some values are correctly defined in specific, physically reasonable ranges). Despite the relevance of the prior in Eq. (2), we go on to see that if the model provides a good approximation to the observations, the information provided by the prior ends up being washed away from the posterior distribution.

In a Bayesian framework, the likelihood function L models the probability of the observed data given a set of model parameters. Assuming that the magnetogram is well calibrated, that is, without bias, and characterized by an observational error σ, the maximum entropy distribution for the likelihood is a normal or Gaussian distribution N(0, σ), where the mean is zero since we assume the absence of systematic errors, and σ is the standard deviation.

Then, for an observed magnetogram, M₀, with field values, B₀, and a model magnetogram, Mₚ, with field values, Bᵢⱼ, computed with the set i of parameters pᵢ, the likelihood function is defined as:

$$ \mathcal{L}(M_0; M_p, \sigma) = \frac{1}{\sigma\sqrt{2\pi}} \exp\left(-\frac{1}{2\sigma^2}\sum_j(B_{0,j} - B_{i,j})^2\right), \quad (3) $$

where j is indexing the magnetogram pixels, then the summation over j indicates a summation over all these pixels. The exponential expression in Eq. (3) can take extremely low and extremely high values, therefore the PyMC3 tools use the logarithm of L to avoid truncation errors.

The posterior distribution obtained is conditioned by the selection of L, in this case, a Gaussian-style likelihood. This will produce the same function-like distribution for the posterior. The selection of a normal distribution is accompanied by the hypothesis that the error between the model and the observation is due to an aleatory process and, as a consequence of this selection, the width of the posterior is directly proportional to σ. Still, a second order deviance can be present on the posterior due to the correlation between parameters which affects the symmetry of the distribution.

For simplicity, we assumed that no a priori information can be obtained from the magnetograms and so, we explore a broad parameter space defined by uniform prior distributions (except for Nᵢ, as explained below). In this sense, each prior distribution is defined by two values, the lower and the higher limits. This kind of distribution assigns equal probability within the defined ranges and zero outside this interval. We used the same selection of prior ranges for all the magnetograms.

In Poisson et al. (2015a), we obtained the distribution of Nᵢ values computed from the polarity inversion line (PIL) inclination of 41 ARs. The distribution is strongly skewed toward small values, with a mean of 0.3 and a standard deviation of 0.2. These results were extended over 168 ARs in Poisson et al. (2016) with similar statistical conclusions. Therefore, to obtain the prior of |Nᵢ|, we used a Gamma distribution with the above mean and standard deviation values. This distribution is defined strictly positive, meaning that we allow for only one twist sign for the FR and we do not limit the upper bound for the twist. This Gamma distribution only reduces the probability of having larger values of |Nᵢ|, which are not observed in ARs. Additionally, the information of the twist sign has to be set using the criteria presented in Luoni et al. (2011) that rely on the tongue pattern that

is independent of the polarity signs and require the computation of the acute angle formed by the PIL and the bipole axis. In the case of AR 10268, we found a negative twist sign (Poisson et al. 2015b).

## 4.2. Sampling the parameter space

Finding the parameters of maximum likelihood entails an optimization problem that can be solved using several methods, such as Powell's conjugate direction method. Most of these methods are fast but can be trapped in local maxima depending on the selected initial point. In particular, they provide the location of the maxima of L, being the path by itself of little interest and how L behaves around its maximum value not considered. Therefore, most of these methods give no information on the precision of the results, unless the second order derivatives of L are also evaluated. In contrast, the formalism given by Eq. (2) presents a statistical approach in which a probability distribution can be sampled, allowing for a deeper analysis of the model parameters (e.g., mean, median and variance). However, this approach needs specific algorithms to efficiently explore the parameter space to reconstruct P(p|M₀) in a feasible number of iterations.

Monte Carlo methods provide a more comprehensive description of the posterior distribution, not just single point estimates, by producing a set of random samples within the defined parameter space. More generally, Markov chain Monte Carlo (MCMC, Neal 1993) algorithms provide a more efficient way to explore broad parameter spaces with fewer computations. Nevertheless, sampling distributions with multiple peaks cannot be completely described using general common MC algorithms, as they often get stuck in one of the secondary maxima (e.g., as with Hamiltonian Monte Carlo methods).

Since our model is complex and non-linear, the posterior can in principle have multiple secondary maxima. Hence, we implemented a sequential Monte Carlo (SMC) sampler (see e.g., Kantas et al. 2009). This sampler, included in the PyMC3 package, is a well-established Monte Carlo algorithm based on a Simulated Annealing approach combining important sampling, tempering, and MCMC kernels (Chopin & Papaspiliopoulos 2020). In this case, the posterior is expressed as:

$$ P(p|M_0) \propto (\mathcal{L}(M_0; M_p, \sigma))^\beta P(p), \quad (4) $$

where β is an auxiliary temperature-like parameter to control the sampling sequences. In the zero stage, β = 0, the algorithm initializes directly sampling the priors. PyMC3 optimizes this sampler by setting a number of steps in which the value of β is progressively increased. Every two successive β steps an importance sampling stage is initialized. In each stage, weights are computed as the ratio of the tempered posterior of the respective sample between two successive β steps. These weighted samples are then used by an importance sampling algorithm with which new MCMC draws are obtained. Samples are then used as seed for the next β step. Iteration is complete once β reaches unity producing the final sample collection.

We performed four independent chain samples, with 2000 samples each. Each chain has different random seeds for the initial points, meaning that no correlation is imposed between chains. In Fig. 2, we show an example of the marginal posterior for the model parameters obtained for magnetogram number 10 of AR 10268. The distributions are constructed with the Kernel Density Estimator (KDE, Parzen 1962). In this case the standard deviation between model and observations (σ) is set to be 10 G,
<figure><img src="image_3.png" /><figcaption>Fig. 2. Marginal posteriors obtained for the model parameters of magnetogram number 10 of AR 10268 (see Fig. 1b). Colors correspond to the four different chains (indicated in the inset of panel a) having 2000 samples each. The panels correspond to the parameters: (a) a, (b) B₀, (c) R, (d) d₀, (e) φ, (f) Nᵢ, (g) xᵣ, and (h) yᵣ. The r̂ value is written at the bottom left of each panel. r̂ is the normalized rank factor used to quantify the convergence between different MC Markov chains to a single distribution. r̂ tends to unity when convergence is achieved.</figcaption></figure>

assuming the instrumental error is the only contribution to σ. Each color indicates different MC Markov chains.

The nearly normal posterior distributions and the progressive convergence of consecutive chains indicate that optimal model parameters for the analyzed observed magnetogram can be obtained from the mean value of the posterior. Convergence is guaranteed for an infinite number of samples. In practice, we cannot prove that the posterior obtained from a finite number of samples has converge to the real one. That is why it has been accepted that independent chains, with scattered initial points converging to the same distribution, is the best we can use to show that we have achieved convergence. The normalized rank, r̂, diagnostic tests (Vehtari et al. 2021) provide a way to quantify the degree of convergence by comparing the variance between multiple chains with the variance within each chain. If convergence has been achieved, the between-chain and within-chain variances should be identical; hence with r̂ = 1. Values of r̂ above 1.4 indicate problematic distributions and convergence is not guaranteed. In the present example, r̂ values are below 1.25, and often close to 1 (see r̂ values in the panels of Fig. 2).

### 4.3. Inference error

Now, L is a function of the parameter σ, which corresponds, in principle, to the standard instrumental deviation of the observed data. However, in practice the standard deviation between the model and the observations is unknown and larger than the instrumental error, because the model is not exact, as it represents (at best) only the global aspect of the flux distribution and does not reproduce the small-scale variations correctly. In the

<figure><img src="image_4.png" /><figcaption>Fig. 3. Observed and modeled LOS magnetograms for AR 10268. (a) Magnetogram number 10 for AR 10268. (b) Most probable model for the same magnetogram obtained with σ = 10 G. (c) Magnetogram number 10 limited to the AR field defined using the most probable model shown in panel b, fulfilling the condition |B₀, j| ≥ 1 G. (d) Most probable model for panel c data obtained with σ = 300 G. The color and contour conventions are the same as in Fig. 1. The movie mov-fig3.mp4, from the supplementary material, shows the magnetograms and their associated models during the full emergence.</figcaption></figure>

case of MDI magnetograms, the typical instrumental noise level is 9 G, while the standard deviation between model and observations is expected to be much larger (in view of the simplicity of the model). Therefore, even for the most probable fit, σ is expected to be dominated by the difference between observations and model. For this reason, we propose to estimate its value based on the computation of the residuals between the most probable fitted model and the observed magnetograms.

At first, we can obtain a most probable fit by conducting an inference assuming the ideal modeling, in this sense σ is set to 10 G. However, a more appropriate value can be found, once the most probable model is approximately known, by computing:

$$ \sigma_{est} = \sqrt{\frac{1}{N_d} \sum_j (B_{o,j} - B_{+j})^2}, \quad (5) $$

where N_d is the number of pixels in $\sum_j$ and the subscript “+” indicates the most probable model with parameters $p_+$ derived from the mean values of the marginal posteriors (e.g., Fig. 2).

### 4.4. Model of AR 10268

As mentioned in the previous section, a first estimation of the most probable parameters of the model is obtained using σ = 10 G. The posterior obtained is extremely narrow compared with the bandwidth defined for the priors (see Fig. 2), so the real uncertainties of the parameters (posterior variance) are not well represented. Still, the mean of each marginal posterior can be used to compute the most probable fit to the observed magnetograms.

In Fig. 3b, we show the most probable model of magnetogram number 10 using σ = 10 G. Comparing it with the observations, we see a good agreement with the shape and size of the
<figure><img src="image_5.png" /><figcaption>**Fig. 4.** (a) Evolution of AR 10268 magnetic flux. The dotted-red (blue) line shows the evolution of the positive (negative) magnetic flux of the square selection of the magnetogram (as shown in Fig. 1). Solid-red and dashed-blue lines are the positive and negative flux, respectively, computed over the AR field (see Fig. 3c as example). The black line shows the evolution of the most probable model magnetic flux (positive plus absolute value of the negative fluxes divided by two). (b) Estimated value for the standard deviation between model and observations using Eq. (5) over the AR field. The red-solid (blue-dashed) line corresponds to $\sigma_{est}$ for the positive (negative) polarity. The black line corresponds to $\sigma_{est}$ for points within the AR region ($|B_{+,j}| \ge 1$ G).</figcaption></figure>

magnetic tongues, the inclination of the PIL, the tilt angle, and the field strength in the core of each polarity (inner contours). Still, the inherent differences are made evident with a look at the small scales and lower field pixels surrounding the AR core.

To remove the contribution of the background field, that is, the field that does not belong to the AR, we reduce the magnetogram to those pixels in which $|B_{+,j}| \ge 1$ G. Figure 3c shows this restricted magnetogram, henceforth simply referred to as the AR field. This allows us to derive parameters for the model which are more representative of the studied real AR field (i.e., the FR intrinsic field). Figure 4a shows the evolution of the AR positive magnetic flux with a solid-red line and the negative flux with a dashed-blue line. The AR field selection significantly reduces the flux unbalance due to the contribution of the background positive field.

The value of $\sigma$ must weight the fact that the model cannot reproduce all the complex features of the AR emergence and, therefore, we ought to perform a second inference with a more realistic value. As a consequence of this new estimated value, we can obtain broader posterior distributions from which the uncertainty of the parameters can be estimated. Comparing the most probable model magnetograms with the AR field, we obtain an estimation of what we now call $\sigma_{est}$ for each polarity using Eq. (5). Figure 4b shows how this estimation varies during

the emergence. We find an expected asymmetry (e.g., Lites et al. 1998) between the leading (negative) and following (positive) polarities. This indicates not only the limitation of the model to fit the more disperse flux of the following polarity, but also that the existence of this asymmetry introduces greater uncertainties on the parameters since the half-torus model is strictly symmetric. In this sense, the model attempts to fit both polarities with the same parameters despite their differences. A development of the model to take into account this asymmetry is reserved for a future study.

In the present set up and testing of the statistical method, we selected the maximum value of $\sigma_{est}$ in Fig. 4b. This introduces an upper bound for the statistical errors, especially in the earlier phase of emergence. This uniform value allows us to test the sensitivity of the parameters of the model during the emergence phase from the broadness of the posteriors. Therefore, our second inference run is done over the AR field using $\sigma_{est} = 300$ G (the largest value achieved during the evolution). Figure 3d shows the best magnetogram obtained with this second inference. There are no clear differences between panels b and d, implying that the first approach is good enough to mimic the field distribution of the AR. Still, there are significant differences between the posterior distributions obtained with both estimations and these are analyzed below.

We extend the above analysis of the posteriors to 22 magnetograms covering the full emergence of AR 10268. The movie (mov-fig3.mp4) in the supplementary material includes the evolution of the magnetograms for the AR 10268, the AR field, and the respective models. We model each magnetogram individually without imposing any temporal correlation on the parameters. In Fig. 5, we plot the evolution of the marginal posteriors using box and whisker plots. The segments in the boxes indicate the mean values. We compare models obtained with the first inference procedure ($\sigma = 10$ G, blue), and second inference ($\sigma_{est} = 300$ G, orange) including background filtering. Some of the peaks of the first inference posterior are so narrow that the corresponding boxes are not visible in the plots.

The first part of the emergence (up to magnetogram number 10) is characterized by a broader distribution in some parameters, especially $d_0$, which presents the greatest dispersion. The limited information provided by the magnetogram pixels at the beginning of the emergence is expected to produce broader posteriors induced by a stronger correlation between the parameters of the model. In particular, different combinations of the parameters $d_0$, $R$, and $B_0$ can produce similar synthetic magnetograms, for instance, a FR almost fully emerged with low axial field and a FR deep down the photosphere with large axial field can produce similar field distributions with $\sigma_{est} = 300$ G.

In the second half, the marginal posteriors for most of the parameters become narrow and the mean value of both estimations ($\sigma = 10$ G and $\sigma_{est} = 300$ G) converge. At that point, the model is well constrained by observations. Nevertheless, $B_0$ is the most sensitive parameter, having the greatest dispersion up to the end of the emergence.

For most of the analyzed magnetograms, the parameters $a, \phi, x_c$, and $y_c$ converge to similar values independently of taking $\sigma$ or $\sigma_{est}$. This implies that along the direction of these parameters the $L$ function has a narrow and steep main peak. Moreover, the plot of the posterior (as in Fig. 2) indicates that other secondary peaks are shallow.

Figure 5f shows the estimation of $N_t$. The values obtained with $\sigma = 10$ G and $\sigma_{est} = 300$ G depart from each other during the first half of the emergence, indicating a possible anti-correlation with $d_0$. In this sense, the elongation of a polarity
<figure><img src="image_6.png" /><figcaption>**Fig. 5.** Box plots showing the evolution of the marginal posteriors inferred for 22 magnetograms along the emergence of AR 10268. Each panel shows the evolution of the model parameters: (a) *a*, (b) $B_0$, (c) *R*, (d) $d_0$, (e) *φ*, (f) $N_t$, (g) $x_c$, and (h) $y_c$. Blue and orange boxes compare the marginal posteriors obtained using $\sigma = 10$ G and $\sigma_{est} = 300$ G, respectively. The boxes represent the three-quartile values of the distribution (so boxes contain the 50% central part of the distribution) and the whisker extensions are fixed by a factor 1.5 of the inter-quartile range. The blue and orange lines mark the evolution of the mean value of the marginal posteriors for either $\sigma$ or $\sigma_{est}$. Panel *e*: the tilt values obtained using two different methods are added (see inset). The black line in panel *f* corresponds to the estimation of $N_{tc}$ obtained comparing the inclination of the PIL with respect to the direction of the AR bipole. Black lines in panels *g* and *h* correspond to the AR barycenter.</figcaption></figure>

can be represented by the number of turns but also by the stage of the emergence, that is, increasing $d_0$ above 0.6 reduces the extension of the tongues despite the large values of $|N_t|$. As an illustration, we refer to the difference between the orange and blue boxes in panels *d* and *f* until magnetogram number 8. The evolution of $N_t$ is associated with the variation of the polarity elongations. The maximum elongation of the positive polarity is reached around the maximum value of $N_t$ (see movie mov-fig3.mp4 or Fig. 6d in Poisson et al. 2015a). Moreover, $N_t$ can be correctly estimated only when the elongation of the polarities is significant, therefore its determination is limited along the emergence, that is, $N_t$ tends to zero once the tongues have retracted. Finally, the estimation obtained with $\sigma_{est} = 300$ G is in good agreement with the parameter $N_{tc}$ (black line in Fig. 5f) obtained for this AR in Poisson et al. (2015a) with a different method (i.e., using the relative orientation of the PIL with respect to the direction of the AR bipole axis).

The tilt angle obtained from the inference (Fig. 5e) indicates a sustained 20° clockwise rotation. This estimation of $\phi$ provides a correction of the effect of the magnetic tongues on its determination using the magnetic barycenters (black line). The difference between both methods proves the significant effect of the tongues over this quantity during the emergence. We see that the

correction provided by CoFFE (Poisson et al. 2020a) partially improves the estimation of $\phi$.

The evolution of the AR center, $x_c$ and $y_c$, indicates a drift of AR toward the east-north direction. This drift is toward the north pole since AR 10268 is located in the northern hemisphere (12°) (see Figs. 5g,h). This northern drift is plausibly associated with the Sun's meridional flow. The AR center can also be estimated from the computation of the barycenters of the main polarities (black line). This estimation is in good agreement with the obtained $x_c$ and $y_c$, with differences within the magnetogram spatial resolution.

## 5. Effect of perturbations

In this section, we test the statistical method by applying it to a series of magnetograms obtained with the FR emergence model (i.e., synthetic magnetograms). We also study the effect of including a series of non-linear perturbations to the synthetic magnetograms to mimic small-scale magnetic structures, as well as asymmetries observed between the polarities of the ARs, without the need to include complex interactions between the magnetic field and the plasma.
<figure><img src="image_7.png" /><figcaption>**Fig. 6.** Example of the model generator: (a)–(b) Magnetogram 2 and 7 of the seed model ($M_0$). (c)–(d) Random selection of pixels for each magnetogram ($M_2$). (e)–(f) Simulated data generated from panels c and d, after applying a Gaussian-smooth filter and normal noise ($M_4$). The color convention is the same as in Fig. 1.</figcaption></figure>

## 5.1. Simple test

Using the half-torus model, we generated a cube of ten magnetograms (indexed from 0 to 9), to which we applied the already developed statistical method. This number of magnetograms provides enough resolution for the simulated AR emergence. The obtained magnetograms cover the same field of view and spatial resolution as the observations of AR 10268, so simulated data has the same pixel size as the MDI instrument. We tested the inference dependence on the spatial resolution (not shown here), reducing the original resolution of the MDI magnetograms for AR 10268 by a factor of two and then a factor of three. For both tests, we find no significant differences with the results shown in Fig. 5.

The emergence is modeled by the increase of $d_0$ from 0.1 to 1. The intrinsic parameters of the torus, *a*, *R*, $B_0$, $N_t$, $x_c$ and $y_c$, are set as constants during the emergence, for simplicity ($a = 4.5$ pixels, $R = 12$ pixels, $B_0 = 3000$ G, $N_t = -0.6$, $x_c = 32$ pixels, and $y_c = 33.5$ pixels). The tilt angle $\phi$ linearly evolves with a clockwise rotation of 15° (within a range of -5° to -20°) which is typically observed in some emerging bipolar ARs (Poisson et al. 2015a), including AR 10268. Two steps of the simulated emergence, corresponding to magnetograms (Mag) 2 and 7, are shown in Figs. 6a and b. The magnetic tongues are

clearly visible in Mag 2 and more retracted in Mag 7. The results of the inference procedure are shown in Fig. 7 in the same format as in Fig. 5. The marginal posteriors obtained for the test model are indicated with blue boxes and whiskers, while the red-dashed lines correspond to the input parameters of the model. Results shown with other colors are described in Sect. 5.3.

The marginal posteriors for the parameters of each magnetogram are Gaussian-like distributions (not shown, but compatible with the symmetry observed in the quartile boxes). In Fig. 7, the marginal posteriors have a mean value (blue lines) very close to the half-torus model input parameters (red lines in Fig. 7). This basic test shows that the sampler algorithm works fine to recover the original parameters. The broadness of these posteriors change during emergence. Since we set the value of the standard deviation between the model and the observations (called $\sigma$ from now on) to a constant that we take to be 300 G, as our previously computed $\sigma_{est}$, the change in the broadness includes the effect of overestimating $\sigma$ on the sampled posterior during the early phases of emergence (in particular, for parameters $B_0$ and $R$). In future applications of the method to observed ARs, the expected lower values of $\sigma$ in this early phase (as in Fig. 4b) attenuates this effect.

The broadness of the marginal posteriors decreases along the simulated emergence for all the parameters except $N_t$. Indeed, this is the only parameter which fully depends on the extension of the magnetic tongues (for other parameters the presence of the tongues rather perturbs their determination). Since tongues tend to disappear by the time the half-torus has emerged, the information of $N_t$ reflected in the magnetogram also decreases during the emergence. Furthermore, not only does the marginal posterior of $N_t$ for each magnetogram become broader, but also its mean value tends to depart from the input parameters. This indicates that $N_t$ is not well constrained after 70% ($d_0 \ge 0.7$) of the total FR has emerged.

## 5.2. AR generator

In this section, we develop an AR generator to simulate a large variety of small-scale magnetic features, comparable to the ones observed in AR 10268 (see Fig. 1), in order to explore how perturbations affect the posterior. For this purpose, we follow a four-step procedure that perturbs the magnetograms of our previous test model (Figs. 6a and b), which we then use as a seed for the AR generator.

In the first step, the AR generator makes a random selection ($\mathcal{S}$) over a fraction of the pixels that comply with $|B(x_j, y_j)| \ge 1$ G. We chose a different number for the positive ($f_p$) and negative ($f_n$) flux pixels to mimic the observed asymmetry between the leading and the following polarities. For smaller values of $f_p$, the positive polarity becomes less homogeneous. Selected pixel coordinates $(x_j, y_j)$ are obtained for each magnetogram of the cube. The output of the first step, $M_1$, is defined by the condition $B_{\mathcal{S}} = 0$ outside the pixel selection.

In the second step, we multiply each pixel of the $\mathcal{S}$ selection by a constant factor in order to maintain the total magnetic flux of the original seed model. We compute a factor for each polarity to make sure that the magnetic flux balance is conserved (in this step). In other words, we redistribute the flux in magnetic nodes where the flux is more concentrated producing a new version of the magnetogram cube, $M_2$ (see Figs. 6c and d).

In a third step, we apply a Gaussian smoothing filter of 1 pixel width to the magnetograms. The aim is to smooth discontinuities in the field distribution and produce more realistic magnetograms (called $M_3$).
<figure><img src="image_8.png" /><figcaption>**Fig. 7.** Box plots showing the evolution of sampled marginal posteriors for the parameters of the seed model (blue), 100 generated ARs (orange), and one individual AR as example (green). For the orange boxes, each marginal posterior is constructed by 200 000 samples concatenated from the 2000 samples for each of the 100 generated ARs. Each panel shows the evolution of the model parameters: (a) *a*, (b) $B_0$, (c) *R*, (d) $d_0$, (e) *φ*, (f) $N_t$, (g) $x_c$, and (h) $y_c$. The inference is made assuming $\sigma = 300$ G. The blue, orange, and green lines show the evolution of the corresponding marginal posterior means. The red-dashed line shows the seed model input parameters. The gray and red boxes of panel e show the evolution of the tilt angle obtained using the magnetic barycenters and CoFFE for 100 generated ARs, respectively.</figcaption></figure>

Finally, the fourth step introduces noise and flux unbalance to $M_3$, adding a random normal noise with a mean of 5 G and standard deviation of 10 G to each pixel. Two examples of the final simulated magnetograms $M_4$ are shown in Figs. 6e and f.

The evolution of the positive (red-solid line) and negative (blue-dashed line) magnetic flux of a generated AR ($M_4$) is shown in Fig. 8a. The excess of positive flux emulates the contribution of the background field as in AR 10268. The black line corresponds to the flux of the seed model, $M_0$. Its difference with the blue and red lines characterizes the imposed flux unbalance.

Here, $f_p$ and $f_n$ are the main parameters of the AR generator, since they produce strong field perturbations that determine how far the output strays from the seed model (i.e., the value of $\sigma$). If we consider that the seed model is the most probable model for the generated AR, then we can compute $\sigma_{est}$ from Eq. (5) by comparing the magnetograms of the generated AR ($M_4$) and the seed model ($M_0$). Therefore, the selection of $f_p$ and $f_n$ determines how $\sigma_{est}$ evolves during the emergence. We find that in using $f_p = 0.35$ and $f_n = 0.75$, we obtain an evolution of $\sigma_{est}$ for every generated AR that is comparable with the one observed for AR 10268 (see Figs. 4b and 8b). Therefore, using these values for the AR generator parameters, we effectively introduce perturbations that are comparable with the ones we observed for AR 10268.

### 5.3. Inference for generated ARs

We first compared the marginal posteriors obtained with the seed model and one generated AR (blue and green boxes, respectively, in Fig. 7). The perturbations incorporated with the 4-step generator can modify significantly the deduced AR parameters with respect to the input. As expected from the results found from the seed model, the changes are dominantly present during the earlier emergence phase for *a*, $B_0$, $d_0$, *R*, $N_t$, and *φ*. The $N_t$ estimation is also affected at the end of the emergence. This implies that the information lost during the non-linear transformations of the magnetograms cannot be recovered using our inference method. Still, we obtain the convergence of the parameters, except $N_t$ and $B_0$, to the model input during the last part of the emergence.

The analysis of a single case is not representative of all the possible perturbations and their effects on the inferred posteriors. Indeed, random selections of points produce different patterns for the field distributions. By trying different random selections in the first step of our AR generator, we can statistically explore how the introduced perturbations affect the inference at different stages of the emergence. For each magnetogram, we sample the posteriors for 100 generated ARs. This means that we apply 100 different patterns that may affect the inferred parameters in
<figure><img src="image_9.png" /><figcaption>**Fig. 8.** Evolution of the LOS magnetic flux and the estimated $\sigma$ for a single generated AR. (a) Evolution of magnetic flux for the generated AR shown in Figs. 6e and f. Solid-red and dashed-blue lines are the positive and negative flux, respectively. The black line shows the seed model magnetic flux. (b) Estimated $\sigma$ using Eq. (5) applied to the seed model and the generated AR. The red-solid (blue-dashed) line corresponds to $\sigma$ for the positive (negative) polarity. The black line corresponds to $\sigma$ estimated with all the pixels within the generated AR field.</figcaption></figure>

various ways. The only condition we impose for the generated ARs, is that $\sigma$ must reach values of at least 200 G for the negative polarities and 300 G for the positive ones at some stage of the emergence to guarantee that they differ enough from the seed model. The orange boxes in Fig. 7 are constructed as concatenated distributions of these 100 posteriors, therefore each of these boxes and whiskers contains 200 000 samples (2000 for each generated AR).

Most of the distributions of the 100 cases present a Gaussian-like profile (not shown), implying that the generated perturbations have a random effect on the eight-dimensional posteriors found for each magnetogram. We show the means of the 100 AR distributions in Fig. 7 with orange curves. The comparison with the original values of the parameters of the seed model (red curves) indicates systematic deviations.

Looking at the distributions at different stages, parameters *a* and $B_0$ are well estimated only during the latter half of the emergence. During the first half, the radius, *a*, is slightly overestimated while $B_0$ is well underestimated, therefore the FR axial flux (proportional to $\pi B_0 a^2$ for the half-torus model) is also underestimated during this phase. The radius, *R*, is well estimated but with a greater uncertainty earlier in the emergence; $d_0$ is nearly following the linear evolution present in the seed model, but with a relatively large dispersion; and $N_t$ has the largest deviation from the mean, also with a strong standard deviation. Its estimated values are better determined in the central phase of the emergence, when the magnetic tongues are extended and the

axial field is strong. The dispersion of $N_t$ has a great impact on the estimation of *R* at the first half of the emergence (there, the magnetic tongues modify the bipole size observed in the magnetogram).

The estimated tilt angle, $\phi$, departs from the input value only at the first magnetogram, with the greatest departure being around 6.5°. This initial departure is also observed on other parameters and is due to the largest impact of the perturbations when the AR mean field is weak and comparable to the mean perturbation in terms of $\sigma$. Later on, the mean $\phi$ of the 100 AR distributions agrees with the input parameter of the seed model reducing also the broadness of the distributions along with the AR emergence. The obtained values during the full emergence are significantly better than those found from the direct measure of the magnetic barycenters (see white boxes in Fig. 7e). This implies that the Bayesian inference method provides a clear correction of the effect of the tongues on the tilt during the emergence phase. We also include the comparison with CoFFE in Fig. 7e. Though at the beginning of the emergence and up to its first half, a departure from the input values is evident, the results found with CoFFE are much closer than those determined with the barycenter method and clearly converge to the input values during the second half of the emergence phase. Although CoFFE achieves a partial correction of the tilt, these results show the strength of CoFFE compared to less sophisticated methods, as concluded by Poisson et al. (2020a).

Finally, the central position parameters, $x_c$ and $y_c$ are well constrained and estimated in all the analyzed cases. As expected, these two parameters are not correlated with the rest of the FR intrinsic parameters.

# 6. Discussion and conclusions

In this work, we test a new method based on a Bayesian statistical approach to derive active region global parameters from LOS magnetograms. We use a synthetic half-torus model successfully employed in previous works to interpret the magnetic tongues and their evolution during the emergence of bipolar ARs (Luoni et al. 2011; Poisson et al. 2015a). This model depends on eight free parameters. Their most probable values and statistical distributions (called posteriors) are derived applying this new Bayesian approach to observed magnetograms. The magnetograms are treated independently during the AR emergence, so the effect of the statistical procedure on the determination of the eight-model parameters can be tested at different stages of the analyzed evolution.

Despite the simplicity of the half-torus model, we are able to determine the large-scale properties of AR 10268 from its LOS magnetic field. More precisely, we reproduce its global characteristics, such as the elongation of the polarities and the inclination of the PIL on the bipole axis. Moreover, the evolution of both observed and modeled magnetograms are comparable at any stage of the AR emergence (see movie mov-fig3.mp4 from the supplementary material). Using this model we are also able to reduce the contribution of the background flux, not belonging to the AR, finding a more balanced evolution of the AR main positive and the negative flux. We establish an upper bound for the observed standard deviation ($\sigma$) between the model and the observations that ranges between 100 G and 300 G. This large standard deviation is partly due to the asymmetry that exists between the leading and following polarities, both in their extension and small-scale field perturbations.

To determine the effect of the small-scale perturbations on the posterior, we created an AR generator to mimic realistic field
observations starting from a smooth seed model. The aim is to apply strong modifications on small scales while keeping the global properties almost unchanged. For the generated ARs, we used the same σ value obtained for AR 10268 to maintain the modifications introduced to the magnetic field at a reasonable level. The inference is made over 100 generated AR emergences using the same method applied to AR 10268 magnetograms. This test shows that the introduced perturbations could be large enough to shift the posterior distributions of the parameters for one simulated AR by more than one inter-quartile range from the input seed model parameters.

The marginal posteriors are defined for each model parameter by integrating the full posterior over the remaining seven parameters. Such marginal posteriors, shown in Fig. 5 as box-plots, display a broad variation (both in their mean and standard deviation) from the parameters of the model during the AR 10268 emergence. Despite the fact that these temporal variations are not included within the half-torus model, most of them are compatible with small-scale random perturbations of the field distribution, as seen for the generated AR marginal posteriors of Fig. 7.

Comparing the results derived from the analysis using the AR generator to those coming directly from the application of the Bayesian inference method to AR 10268, we find a good correspondence that can be summarized as:

- The FR cross-section radius, namely, the parameter *a* in Fig. 5a, exhibits a strong variation and broad dispersion during the first third of the emergence and then it converges to a constant value for the rest of its evolution. The first variation is characterized by a fast expansion reaching values that are above the later convergence value. There is also an overestimation, although milder, of *a* during the first half of the emergence for the generated AR selected (green line, Fig. 7a). This effect is weaker when a set of 100 ARs is selected (orange line). Later, *a* uniformly converges to the input value. We conclude that the evolution of *a* observed for AR 10268 has a contribution induced by the sensitivity of the half-torus model to small-scale perturbations.

- The first small values of the axial field strength, $B_0$ in Fig. 5b, could (at least partly) be the result of a bias in the method, since a similar (although less important) behavior is present on the posterior of the seed model (blue boxes in Fig. 7b). Moreover, this bias becomes stronger once the small-scale perturbations are introduced to the seed model (orange boxes in Fig. 7b). The difficulty in determining both *a* and $B_0$ during the first half of the emergence is due to the partial emergence of the FR and the projection of the axial field on the LOS direction. The anti-correlation between *a* and $B_0$, obtained for AR 10268 and the generated ARs, suggests that the axial flux can be a less biased parameter than $B_0$. In other words, despite the fact *a* and $B_0$ are not well estimated separately, the combination of $B_0a^2$ might be a more robust parameter for the FR model.

- The evolution of the main FR radius, *R* in Fig. 5c, can potentially be an artifact of the method, since an increase of the distance between the main polarities can be reproduced with an increase of *R* at constant $d_0$. Indeed, although the width of the distributions of *R* remains mostly constant during emergence for the 100 generated ARs, the marginal posteriors of the single generated AR example shown in Fig. 7c presents similar temporal variation as the one obtained for AR 10268 (green boxes). This implies that the variation of *R* for AR 10268 is potentially within the framework of the torus model considering the effect of the small-scale field perturbations.

- The evolution of the bipole tilt, $\phi$ in Fig. 5e, shows a clear clockwise rotation of AR 10268, which could well be associated with the torsion (or writhe) of the FR axis. The estimation obtained is also close to the results obtained with CoFFE (Poisson et al. 2020a) and significantly different from the tilt obtained by computing the magnetic barycenters, which are affected by the magnetic tongues. Figure 7e shows the improvement due to the removal of the effect of the tongues on the estimation of the tilt. Moreover, the Bayesian approach proves to be more stable and with a more robust estimation than CoFFE at the first half of the emergence. We conclude that the clockwise rotation of AR 10268 is not due to the evolution of the magnetic tongues but the actual measure of the full AR rotation.

- The evolution of the twist number, $N_t$ in Fig. 5f, has a similar behavior to the simulated ARs in Fig. 7f, with lower values near the beginning and the end of the emergence. For the generated ARs, the best estimations of $N_t$ are obtained around the middle of the emergence phase when the elongation of the polarities is maximum. The observed variation is consistent with the value of the twist number computed for AR 10268 by Poisson et al. (2015a).

- Finally the estimation of the AR center, corresponding to parameters $x_c$ and $y_c$, provides the most robust result for both AR 10268 and the generated ARs (Figs. 5g, h and Figs. 7g, h, respectively). This is expected because these parameters are not intrinsic FR quantities, therefore, their correlations with the other model parameters is negligible.

The PYMC3 software, used in this work, is shown to be efficient and versatile to be adapted to the problem needs (high model dimension) with diverse tools for tensor computation, sampling and Bayesian inference. Other samplers, such as the Hamiltonian Monte Carlo algorithms, and different prior constructions including parameter correlations (LKG distributions; Lewandowski et al. 2009) that are also available within the software package, are worth to be tested in future works. On the other hand, the present Bayesian analysis implementation allows us to explore the half-torus model, obtaining a first description of the parameters and their correlations. Moreover, this method also quantifies the statistical distributions of the output parameters, allowing us to better characterize its limitations, which are mainly present during the early emergence phase.

The direct comparison of a model with observations introduces a new method for deriving the temporal evolution of the global parameters of an emerging AR to a precision level surpassing previous methods. In particular, the tilt angle obtained from the model for AR 10268 in the early emergence phase corrects substantially the effect of the magnetic tongues. The intrinsic tilt of ARs is an important observational constraint for flux-transport dynamo models, since the AR tilt is linked, via diffusion and meridional circulation, to the formation and evolution of the polar field during solar cycles (e.g., Wang 2017). Then, the application of the Bayesian method presented here to a large set of ARs, in the spirit of the work of Poisson et al. (2020a), is expected to improve our knowledge of the tilt angle dependence with latitude.

As a FR emerges, the magnetic tongues evolve to produce an apparent rotation of the magnetic bipole. By removing this effect, the Bayesian method provides a better estimation of the actual intrinsic rotation of the bipole. This rotation is around 20° for AR 10268, which is a factor of two smaller than the tilt evolution observed with the effect of the magnetic tongues included. The amount of rotation and its direction has a broad distribution in ARs (López Fuentes et al. 2003), but its physical origin is still
a matter of debate. For example, the tilt angle evolution obtained for AR 10268 (clockwise rotation) suggests a deformation of the FR axis consistent with a negative writhe, but the origin of this writhing remains unexplained. We expect that the application of the just developed and tested method to a larger set of bipolar ARs will help to understand the physical origin of the rotation of AR bipoles.

*Acknowledgements.* CHM, MLF and MP acknowledge grants PICT-2020-SERIEA-03214 (ANPCyT), PIP 11220200100985 (CONICET) and UBACyT 20020170100611BA. CHM, FG, MLF and MP are members of the Carrera del Investigador Científico of the Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET). We thank MDI team for providing the magnetograms used in this study. We recognize the collaborative and open nature of knowledge creation and dissemination under the control of the academic community, as expressed by Camille Noûs at http://www.cogitamus.fr/indexen.html.

## References

Abbett, W. P., Fisher, G. H., & Fan, Y. 2001, ApJ, 546, 1194

Archontis, V., & Hood, A. W. 2010, A&A, 514, A56

Baranyi, T., Győri, L., & Ludmány, A. 2016, Sol. Phys., 291, 3081

Cheung, M. C. M., Rempel, M., Title, A. M., & Schüssler, M. 2010, ApJ, 720, 233

Chopin, N., & Papaspiliopoulos, O. 2020, Importance Sampling (New York: Springer, Cham), 81

Dacie, S., Török, T., Démoulin, P., et al. 2018, ApJ, 862, 117

Emonet, T., & Moreno-Insertis, F. 1998, ApJ, 492, 804

Fan, Y. 2009, ApJ, 697, 1529

Green, L. M., Démoulin, P., Mandrini, C. H., & Van Driel-Gesztelyi, L. 2003, Sol. Phys., 215, 307

Hale, G. E., Ellerman, F., Nicholson, S. B., & Joy, A. H. 1919, ApJ, 49, 153

Howard, R., Gilman, P. I., & Gilman, P. A. 1984, ApJ, 283, 373

Howard, R. F., Harvey, J. W., & Forgach, S. 1990, Sol. Phys., 130, 295

Jouve, L., Brun, A. S., & Aulanier, G. 2013, ApJ, 762, 4

Kantas, N., Doucet, A., Singh, S., & Maciejowski, J. 2009, IFAC Proc., 42, 774

Lewandowski, D., Kurowicka, D., & Joe, H. 2009, J. Multivariate Anal., 100, 1989

Li, J., & Ulrich, R. K. 2012, ApJ, 758, 115

Lites, B. W., Skumanich, A., & Martinez Pillet, V. 1998, A&A, 333, 1053

Liu, Y., Zhao, X., & Hoeksema, J. T. 2004, Sol. Phys., 219, 39

López Fuentes, M., Mandrini, C. H., Poisson, M., et al. 2018, Sol. Phys., 293, 166

López Fuentes, M. C., Démoulin, P., Mandrini, C. H., & van Driel-Gesztelyi, L. 2000, ApJ, 544, 540

López Fuentes, M. C., Démoulin, P., Mandrini, C. H., Pevtsov, A. A., & van Driel-Gesztelyi, L. 2003, A&A, 397, 305

Luoni, M. L., Démoulin, P., Mandrini, C. H., & van Driel-Gesztelyi, L. 2011, Sol. Phys., 270, 45

MacTaggart, D. 2011, A&A, 531, A108

Mandrini, C. H., Schmieder, B., Démoulin, P., Guo, Y., & Cristiani, G. D. 2014, Sol. Phys., 289, 2041

Martínez-Sykora, J., Moreno-Insertis, F., & Cheung, M. C. M. 2015, ApJ, 814, 2

McClintock, B. H., & Norton, A. A. 2013, Sol. Phys., 287, 215

McClintock, B. H., Norton, A. A., & Li, J. 2014, ApJ, 797, 130

Neal, R. M. 1993, Probabilistic Inference Using Markov Chain Monte Carlo Methods, Tech. rep., University of Toronto

Nikbakhsh, S., Tanskanen, E. I., Käpylä, M. J., & Hackman, T. 2019, A&A, 629, A45

Parzen, E. 1962, Ann. Math. Stat., 33, 1065

Poisson, M., Mandrini, C. H., Démoulin, P., & López Fuentes, M. 2015a, Sol. Phys., 290, 727

Poisson, M., López Fuentes, M., Mandrini, C. H., & Démoulin, P. 2015b, Sol. Phys., 290, 3279

Poisson, M., Démoulin, P., López Fuentes, M., & Mandrini, C. H. 2016, Sol. Phys., 291, 1625

Poisson, M., López Fuentes, M. C., Mandrini, C. H., Démoulin, P., & MacCormack, C. 2020a, A&A, 633, A151

Poisson, M., Démoulin, P., Mandrini, C. H., & Fuentes, M. C. L. 2020b, ApJ, 894, 131

Rempel, M., & Cheung, M. C. M. 2014, ApJ, 785, 90

Salvatier, J., Wiecki, T., & Fonnesbeck, C. 2016, PeerJ Comput. Sci., 2, 55

Sivaraman, K. R., Gupta, S. S., & Howard, R. F. 1993, Sol. Phys., 146, 27

Takasao, S., Fan, Y., Cheung, M. C. M., & Shibata, K. 2015, ApJ, 813, 112

Tlatova, K., Tlatov, A., Pevtsov, A., et al. 2018, Sol. Phys., 293, 118

Valori, G., Romano, P., Malanushenko, A., et al. 2015, Sol. Phys., 290, 491

van Driel-Gesztelyi, L., & Green, L. M. 2015, Liv. Rev. Sol. Phys., 12, 1

Vehtari, A., Gelman, A., Simpson, D., Carpenter, B., & Bürkner, P.-C. 2021, Bayesian Anal., 16, 667

Vemareddy, P., & Démoulin, P. 2017, A&A, 597, A104

Wang, Y. M. 2017, Space Sci. Rev., 210, 351

Wang, Y.-M., Colaninno, R. C., Baranyi, T., & Li, J. 2015, ApJ, 798, 50

Weber, M. A., Fan, Y., & Miesch, M. S. 2013, Sol. Phys., 287, 239

Yardley, S. L., Green, L. M., Williams, D. R., et al. 2016, ApJ, 827, 151
## Appendix A: Half-torus model

We summarize below the flux rope (FR) model used in this paper and developed by Luoni et al. (2011). The model was designed to be the simplest possible while being able to describe the key features of emerging ARs, in particular magnetic tongues. A visualization of the model and its parameters is shown in Figure A.1. The magnetic field has a toroidal geometry with an invariance set along the FR axis. The magnetic twist is set uniform both along and across the FR axis. The axial field $B_α$ and the azimuthal field $B_θ$ are defined as:

$$B_{\alpha} = B_{0} \exp(-\rho/a)^{2}, \qquad (A.1)$$

$$B_{\theta} = \frac{2\rho N_{t}}{R + \rho \cos(\theta)} B_{0} \exp(-\rho/a)^{2}, \qquad (A.2)$$

where {$ρ, α, θ$} are the coordinates for the torus, in which $ρ$ is the distance to the torus axis, $α$ is the location along the torus axis, and $θ$ corresponds to the rotation angle around the torus axis. $a$ is the typical small radius of the flux rope, and $B_0$ is the field strength on the axis. The FR axis has a radius, $R$, and the center of the torus is located at a depth, $d$, below the plane, where we compute the magnetic field to simulate magnetograms. The number of field line turns (twist) along the half-torus is noted as $N_t$. Next, the horizontal position of the torus center is defined with the parameters $x_c$ and $y_c$ and the orientation of the FR with the tilt $φ$. Finally, the model is fully defined via eight parameters.

<figure><img src="image_10.png" /><figcaption>**Fig. A.1.** Diagram of the field morphology of the half-torus model described in Sect. 3. This diagram corresponds to the test model presented in Sect. 5.1. The dotted line corresponds to the torus axis with a field strength $B_0 = 3000$ G. The light green surface shows the tube isosurface defined by a small radius $a = 4.5$ and large radius $R = 12$, both in pixel units. The $x_c$ and $y_c$ parameters correspond to the torus central position in pixel units in the $xy$-plane. $φ$ is the tube tilt angle with respect to the $x$-axis. The photospheric plane is located at a height $d = 6.5$ with respect to the torus center. The red and blue contours over this plane indicates the projection of the torus field in the $z$-direction with a field strength of 500 G and -500 G, respectively.</figcaption></figure>