1 Introduction

Theoretical physicists have been attempting to discover the cause of the acceleration in the expansion of the universe for some decades. Although the observational evidence for a cosmic acceleration first came around two and a half decades ago, from the detected diminishing in the brightness of distant supernovae Ia [1, 2], we still do not have the ultimate answer for what essentially makes the expansion of the universe to accelerate.

The first attempt to explain the cosmic acceleration was indirectly proposed by Einstein himself and is called cosmological constant \(\Lambda \). In the presence of the cosmological constant, the Einstein’s field equations of General Relativity, \(G_{\mu \nu }=8\pi T_{\mu \nu }-\Lambda g_{\mu \nu }\) are capable of describing the acceleration of the expansion of the universe in accordance with observations. Here, \(G_{\mu \nu }\) is the Einstein tensor, \(T_{\mu \nu }\) is the energy–momentum tensor and \(g_{\mu \nu }\) is the metric tensor; moreover we will work with natural units. The cosmological constant is the same that does not allow the space-time to be flat in the absence of sources, as the above equation in this regime reads \(R_{\mu \nu }=\Lambda g_{\mu \nu }\), with \(R_{\mu \nu }\) being the Ricci tensor. \(\Lambda \) is then associated with the vacuum, which intriguingly curves space. In order to adjust to the cosmological observations, \(\Lambda \) must be \(\sim 10^{-52}\)m [1,2,3].

The problem rises when we calculate the theoretical value of the energy density of vacuum, which is higher than the density of \(\Lambda \) by up to 120 orders of magnitude [4]. This spectacularly high disagreement is referred to as the cosmological constant problem.

An alternative is to attempt to treat the cosmic acceleration with no cosmological constant, for instance, explaining such an acceleration as due to a scalar field. These are the so-called quintessence models (check, for instance, References [5,6,7]), in which a scalar field governs the dynamics of the universe, and depending on the form of the potential of such a scalar field, it is possible to explain the cosmic acceleration in accordance with observational data.

Another possibility to evade the cosmological constant problem is to consider modifications or extensions of General Theory of Relativity. In such an approach, the cosmic acceleration rises as a geometrical effect of this “broader” theory of gravity. The extra terms of extended gravity could also naturally induce the existence of a fluid which is capable of generating the repulsive feature necessary to accelerate the universe expansion.

An example of extended gravity theory is the well-known f(R) gravity [8], in which “f(R)” stands for a generic function of the Ricci scalar R to substitute R in the Einstein–Hilbert action. Naturally, this substitution leads to the appearance of extra terms in the resulting field equations, and those could be responsible for driving the universe expansion to accelerate, as aforementioned. In fact, it has been shown to be possible to accelerate the expansion of the universe through f(R) modifications of gravity in [9, 10].

Naturally, an extended gravity theory should be well-performed in different regimes of applications; that is to say that besides explaining the cosmic acceleration with no need for the cosmological constant, it should also behave properly in the stellar and galactic regimes, in the Solar System regime etc. Some f(R) gravity shortcomings are discussed in [11, 12], among other references. Some other shortcomings are mentioned in [13].

Still in [13], the f(RT) gravity theory was proposed, for which the generic function f that substitutes R in the Einstein–Hilbert action also depends on the trace of the energy–momentum tensor T. While in the f(R) gravity, the dependence on higher order terms of R is motivated by the possibility that gravity indeed may behave differently in cosmological scales, the T-dependence is motivated by the possible existence of imperfect and/or extra fluids permeating the universe. It could also be related to quantum effects [13] or an effective cosmological constant “\(\Lambda (T)\)”. Some technical discussion on the T-dependence terms of the f(RT) gravity can be seen in [14].

The list of applications of f(RT) gravity is quite extensive and we mention a few of them in the following. Traversable wormhole solutions can be seen in [15,16,17,18]. The Tolman–Oppenheimer–Volkoff-like equation was first derived and solved in [19]. In [20], the extra polarization states of gravitational waves were calculated for the f(RT) gravity. The effects of f(RT) gravity on gravitational lensing were calculated in [21]. The Solar System consequences of the theory can be seen in [22].

The f(RT) function is generic, although some constraints are commonly put to it, for instance, from the energy conditions [23]. In the f(RT) gravity, in a first analysis, the energy–momentum tensor does not conserve, although some “conservative models” were presented in the literature. For instance, in a cosmological perspective, it was shown in [24] that a conservative model like \(f(R,T)=R+\alpha \sqrt{T}\), with \(\alpha \) being a free parameter, is capable of describing the cosmological observational data in great accordance. Moreover, the hydrostatic equilibrium configurations of neutron stars were presented for a conservative f(RT) model in [25], and the results are capable of predicting the existence of massive pulsars, such as those reported in [26,27,28]. In any case, as the functional form of the f(RT) function is an “open question”, such an investigation is valid and welcome, and can strongly contribute to the modified gravity literature. Even the “non-conservative” models consideration is highly motivated as they are related to possible quantum effects which are not considered in the ”conservative models” [13, 29].

There are several other alternative gravity theories that underline cosmological models that accelerate the universe expansion, such as Gauss–Bonnet gravity [30], extra-dimensional models [31] and \(f(\mathcal {T})\) gravity [32], for which \(\mathcal {T}\) stands for the torsion scalar.

It is worth remarking that alternative gravity theories are also motivated by the lack of dark matter particle detection [33,34,35,36,37]. There are several astrophysical evidences pointing to dark matter existence, such as those reported in References [38,39,40,41], among others. On the other hand, there are several dark matter particles modelling in the present literature [42,43,44,45,46,47], but with no experimental counterpart, as just mentioned. This leads to the possibility that dark matter is simply a gravitational effect of an extended theory of gravity [48,49,50].

Despite the problems regarding the “dark sector” of the universe in standard cosmology, namely dark energy and dark matter, there is also another observational issue nowadays, which is referred to as the Hubble tension. The Hubble tension is a discrepancy between measures of the universe expansion rate obtained by different observational methods [51,52,53,54,55]. Modified gravity has also been invoked to treat the Hubble tension [56,57,58,59].

In the aforementioned \(f(\mathcal {T})\) gravity, f is also a generic function of the argument. In [60], the gaussian processes (GPs) and Hubble function data were applied to \(f(\mathcal {T})\) cosmology to construct the \(f(\mathcal {T})\) functional form for the first time. The GP will be explained below. For now, it is worth mentioning that it is a powerful tool one can use to construct the behavior of a function directly from a data set [61].

In the present article we will apply the GP using Hubble parameter H(z) data in order to construct the f(RT) functional form. The article is organized as follows. In Sect. 2 we present the f(RT) gravity, its field equations and we obtain its Friedmann-like equations. In Sect. 3 we present the GP, and numerically and analytically reconstruct the f(RT) function. We discuss our results and present our concluding remarks in Sect. 4.

2 The f(RT) gravity

Proposed by Harko and collaborators in Reference [13], the f(RT) theory of gravity starts from the action

$$\begin{aligned} S=\int d^4x\sqrt{-g}\left[ \frac{f(R,T)}{16\pi }+L\right] . \end{aligned}$$
(1)

In the above equation, g is the metric determinant and L is the matter lagrangian density. Moreover we will assume natural units, such that \(G=c=1\).

The f(RT) gravity field equations are obtained from the variation of the above action with respect to the metric \(g_{\mu \nu }\) and yield

$$\begin{aligned} (R_{\mu \nu }+g_{\mu \nu }\Box -\nabla _\mu \nabla _\nu )f_R -\frac{fg_{\mu \nu }}{2}=8\pi T_{\mu \nu }+f_T(T_{\mu \nu }-Lg_{\mu \nu }), \end{aligned}$$
(2)

with \(R_{\mu \nu }\) being the Ricci tensor, \(f_R\equiv \partial f/\partial R\),

$$\begin{aligned} T_{\mu \nu }=\frac{-2}{\sqrt{-g}}\frac{\partial (\sqrt{-g}L)}{\partial g^{\mu \nu }} \end{aligned}$$
(3)

the energy–momentum tensor and \(f_T\equiv \partial f/\partial T\).

In order to proceed and with the purpose of particularly investigating the T-dependence of the theory and its consequences, we will from now on assume \(f(R,T)=R+2f(T)\). This assumption has been made in several works, such as [16,17,18, 23, 24, 62,63,64,65]. We consider that the Universe can be modeled as a perfect fluid consisting entirely of matter, with no other forms of energy or pressure present. The above assumptions allow us to express

$$\begin{aligned} R_{\mu \nu }-\frac{1}{2} R g_{\mu \nu }=8\pi T_{\mu \nu } +2f_T T_{\mu \nu }+f(T)g_{\mu \nu }. \end{aligned}$$
(4)

In order to establish the background cosmological framework, we assume the principle of homogeneity and isotropy of the Universe by adopting the Friedmann–Lemaître–Robertson–Walker metric

$$\begin{aligned} ds^2=dt^2-a^2(t)\delta _{ij}dx^idx^j \end{aligned}$$
(5)

where a(t) is the scale factor. Applying the metric into Eq. (4), we write the Friedmann equations of f(RT) gravity as follows:

$$\begin{aligned} H^2= & {} \frac{8\pi \rho _m}{3}+\frac{2f_T}{3}\rho _m-\frac{f(T)}{3}; \end{aligned}$$
(6)
$$\begin{aligned} \dot{H} +H^2= & {} \frac{\ddot{a}}{a}=-\frac{4\pi }{3}\rho _m-\frac{1}{3} \left[ f_T\rho _m+f(T)\right] , \end{aligned}$$
(7)

in which \(H\equiv \dot{a}/a\) is the Hubble parameter, \(\rho _m\) is the energy density of matter and dots represent derivative with respect to time t. The application of the GPs method, which will be presented in the next section, will rely on these equations as a fundamental component. In particular, if we consider a universe comprised entirely of matter and set the function f(T) as \(f(T)=2T\), with \(p=0\), then \(T=-\rho \), and the resulting theory can be regarded as a cosmological model with an effective cosmological constant that is proportional to the Hubble parameter.

3 Reconstruction of f(RT) through Gaussian process

3.1 Gaussian process

The GP can be employed as a non-linear regression approach for reconstructing a function using observational data, without assuming a parametric model. These processes can be seen as a collection of random variables, where each finite set is associated with a Gaussian distribution [61, 66, 67].

A GP can be considered as a generalization of a Gaussian distribution. While a Gaussian distribution is related to the distribution of a random variable, a GP describes a distribution over functions in such a way that it is completely specified through its mean and covariance functions. When a function f is reconstructed via GPs, the value of f computed at a point x is a random variable with mean \(\mu (x)\) and variance \(\text {Var}(x)\). This value is dependent on the value of the same function evaluated at \(\tilde{x}\), particularly when these points are in close proximity to each other. These values are related through a covariance function \(\text {cov}\left( f(x),f(\tilde{x}) \right) = k(x,\tilde{x})\), also known as a kernel in the computational context. Therefore, the distribution of functions can be expressed by the following equations [61, 66]:

$$\begin{aligned} \mu (x)= & {} \mathbb {E}[f(x)]\,, \end{aligned}$$
(8)
$$\begin{aligned} k(x,\tilde{x})= & {} \mathbb {E}[(f(x)-\mu (x))(f(\tilde{x}) -\mu (\tilde{x}))]\,, \end{aligned}$$
(9)
$$\begin{aligned} \text {Var}(x)= & {} k(x,x)\,, \end{aligned}$$
(10)

where the GP is expressed as:

$$\begin{aligned} f(x) \sim \mathcal{G}\mathcal{P}\left( \mu (x), k(x,\tilde{x})\right) \;. \end{aligned}$$
(11)

When dealing with regression problems [67], it is common to approximate the nonlinear function that represents the observed data and the measured points (e.g., Hubble parameter H(z) at a specific redshift z) using a set of basis functions. These functions have parameters that are optimized during the regression process, and the kernel function is derived from them. Although there are several types of kernel functions used in different computational approaches, this work focuses on the squared exponential covariance function:

$$\begin{aligned} k(x,\tilde{x}) =\sigma _f^2 \exp \left( -\frac{(x - \tilde{x})^2}{2\ell ^2} \right) . \end{aligned}$$
(12)

The squared exponential kernel function is a covariance between the output data, expressed in terms of the input data, used to approximate a non-linear function that represents observational data and the points at which they were measured, such as the Hubble parameter H(z) at a specific redshift z, during regression problems [67]. The covariance approaches 1 when the input variables are close and decreases as the distance between them increases. Additionally, this kernel function is infinitely differentiable, making it useful for reconstructing derivatives of a function. The hyperparameters \(\sigma _f\) and \(\ell \) characterize the Gaussianity of the kernel function. \(\sigma _f\) represents the distance one must travel on the x axis to compute a significant change in f(x), while \(\ell \) represents a change in the y axis. This information can be found in [61, 66].

3.2 Data and numerical reconstruction

To reconstruct the f(RT) function, the first step is to utilize a series of measurements of the Hubble parameter, H(z), to apply GPs and deduce its evolution. This process will enable the reconstruction of a range of f(RT) functions using the Friedmann equation, which can then be compared with the current concordance cosmological model (\(\Lambda \) Cold Dark Matter model).

We reconstruct the H(z) function using a dataset compiled in [68], which included 41 measurements of H(z) obtained from two distinct methods – displayed in Table 1 below. The Cosmic Chronometers method measures the age difference between pairs of ancient spiral galaxies that formed at similar epochs and redshifts, while the method based on the position of the peak of the Baryonic Acoustic Oscillations provides a standard ruler in the radial direction by measuring clusters of galaxies [69,70,71]. We processed these observational data using a publicly available Python algorithm |GAPP| developed by Seikel et al. [61]. This enabled us to reconstruct H(z) with statistical confidence regions at \(1\sigma \) and \(2\sigma \) levels in Fig. 1. The reconstructed function H(z) will be used to reconstruct the f(RT) function, as described above.

Table 1 41 measures of H(z) used for the reconstruction of f(RT)
Fig. 1
figure 1

The reconstructed evolution of H(z) from the data using Gaussian Process. The 1 and 2 sigma regions of statistical confidence are plotted as the orange-shaded area

In our reconstruction of the \(f(R,T)=R+2f(T)\) function, we adopted a methodology similar to that proposed in [86] for the case of teleparallel gravity. Given that the dynamics of f(T) are governed by the Friedmann equation via Eq. (6), we express all relevant quantities in terms of redshift and leveraged our reconstruction of H(z) to obtain the desired curve. To approximate the function for small redshift differences \(\Delta z\), we employ the following expression:

$$\begin{aligned} f_{T} \equiv \frac{df(T)}{dT} = \frac{df/dz}{dT/dz}=\frac{f'}{T'} ~, \end{aligned}$$
(13)

where \(T^\prime = -(9H_0^2\Omega _{m0}/8\pi )(1+z)^2\). Then, it is assumed that \(f^\prime \) is given by:

$$\begin{aligned} f^{\prime }(z) \approx \frac{f(z+\Delta z) - f(z)}{\Delta z} ~. \end{aligned}$$
(14)

In this way, it is possible to relate the values of f at \(z_{i+1}\) and \(z_i\). By applying this relation to the Friedmann equation, we obtain:

$$\begin{aligned} f(z_{i+1})= & {} f(z_i)-\frac{9}{2}\frac{\left( z_{i+1}-z_i\right) }{\left( 1+z_i\right) }\nonumber \\{} & {} -\bigg [H^2H_0^2\Omega _{m0} \left( 1+z_i\right) ^3+\frac{f(z_i)}{3}\bigg ]. \end{aligned}$$
(15)

To apply GPs, an initial condition needs to be imposed to solve the above recurrence relation. Therefore, we compute the Friedmann equation for \(z=0\) by assuming \(f_T\approx 0\), which results in:

$$\begin{aligned} f(z=0)=3H_0^2\left( \Omega _{m0}-1\right) , \end{aligned}$$
(16)

with \(\Omega _{m0}=0.315\pm 0.007\) from the last Planck data release [87]. Thus, given the relationship between T and H(z), it is possible to reconstruct the f(T) function and consequently the f(RT) function. The results are shown in Fig. 2, where the statistical confidence regions are plotted.

Fig. 2
figure 2

The reconstructed f(T) curve plotted alongside its regions of statistical confidence

3.3 Analytical fit of the reconstructed function

To gain deeper insight into the behavior of the reconstructed function f(T), it is helpful to express it analytically through polynomial fitting. This approach serves as a cross-check to validate our findings and has been employed in other studies focused on model-independent reconstructions [60, 86, 88].

Through the use of 200 reconstructed f(T) points obtained via GP, we introduce an analytical relation written in terms of the hyperbolic tangent function (which we will, from now on, refer to as HTP model):

$$\begin{aligned} f(T)=\alpha T^2+A\tanh \left[ \lambda \left( T+T_0\right) \right] +\beta T+ \gamma , \end{aligned}$$
(17)

in which \(\alpha , \beta , \gamma , A, \lambda \) and \(T_0\) are constants.

To compare the above model with the current concordance cosmological model \(\Lambda \textrm{CDM}\), first, we plug the considered analytic f(T) curve into the Friedmann equation to find the evolution of the Hubble parameter H(z), then we calculate the \(\chi ^2\) statistics as follows:

$$\begin{aligned} \chi ^2_{H(z)}=\sum ^{41}_{i=1}\frac{\left( H_{obs, i}-H_{fit, i} \right) ^2}{\sigma ^2_{H_{obs,i}}}, \end{aligned}$$
(18)

with \(H_{obs}\) being the Hubble parameter measurements, \(\sigma _{H_{obs}}\) the related errors and \(H_{fit}\) the values provided by the analytic fitting. Following [88], we evaluate our models by computing the quantity \(\Delta \chi ^2\), defined as \(\Delta \chi ^2=\chi ^2_{model}-\chi ^2_{\Lambda \textrm{CDM}}\). This approach serves as our preferred method for comparison. In contrast, alternative techniques such as the Bayesian Information Criterion (BIC) or Akaike Information Criterion (AIC) may impose penalties based on the complexity of our models and the number of parameters they encompass. A lower \(\chi ^2\) value indicates a superior fit, while a smaller \(\Delta \chi ^2\) indicates a preference for the current model over the \(\Lambda \textrm{CDM}\) model.

In Table 2, we present the \(\chi ^2\) and \(\Delta \chi ^2\) values for the models investigated in our study. The results underscore that the HTP model stands out with the lowest \(\chi ^2\) value, indicating its superior fit among the models under examination.

Table 2 The \(\chi ^2\) and \(\Delta \chi ^2\) values for the f(T) models considered in the present work

Our analysis shows that the HTP model is the best fit for the data, as it has the lowest \(\chi ^2\) value and a significant difference in \(\Delta \chi ^2\) compared to the \(\Lambda \textrm{CDM}\), that is, the HTP model is the preferred model for describing the behavior of the reconstructed f(T) curve, with the following values for its parameters: \(\alpha = -1.83\times 10^{-5}\), \(A=-1.05\times 10^4\), \(\lambda =-2.39\times 10^3\), \(T_0=2.58\times 10^3\), \(\beta =-2.99\) and \(\gamma =-1.61\times 10^4\). We emphasize that with these parameter values, we were able to validate the assumption that \(f_T\approx 0\) holds true within this model. In Fig. 3 we plot the preferred model in comparison to the GP reconstructed one.

Fig. 3
figure 3

The analytic fit of the reconstructed f(T) function (black-dashed line) from the hyperbolic tangent polynomial model (orange-solid line)

Now, to further validate the HTP model here obtained, we compare the evolution of H(z) using the Friedmann equation with that of the \(\Lambda \textrm{CDM}\) model in Fig. 4 below.

Figure 4 shows the H(z) function for the preferred analytic model, as well as the \(\Lambda \textrm{CDM}\) model using the latest Planck data release [87], and the GPs reconstructed relations for the same parameter. The comparison reveals that the H(z) curves are in strong agreement for redshifts approximately less than 1.7. However, for larger redshift values, the \(\Lambda \textrm{CDM}\) curve shows a discrepant behavior, which may be attributed to the lack of H(z) measurements in this range. This provides further support for the HTP model as a better fit for the data. The Friedmann equation comparison serves as another useful cross-check to validate our findings and reinforces the effectiveness of the HTP model for describing the behavior of the reconstructed f(T) curve.

Fig. 4
figure 4

Comparison between the hyperbolic tangent f(T) model (red-solid line) and the \(\Lambda \textrm{CDM}\) cosmological concordance model (blue-solid line). The reconstructed evolution of H(z) is plotted as a black-dashed line alongside its \(2\sigma \) uncertainties as a shaded area

We also stress that by using the HTP model into the Friedmann equation and extrapolating to \(z=0\) we can constrain the Hubble parameter to \(H_0 = 69.97\pm 4.13\ \hbox {km}\ \hbox {s}^{-1}\ \hbox {Mpc}^{-1}\), which is consistent with previous measurements [87, 89]. Figure 5 displays our result alongside the last Planck data release and the SH0ES team.

Fig. 5
figure 5

The reconstructed Hubble constant found in this study compared to the values of the last Planck data release and the value provided by the SH0ES collaboration

4 Discussions

Many alternatives to General Relativity have been proposed with the main purpose of evading the cosmological constant problem. Other problems, such as the dark matter problem and the Hubble tension also motivate the search for broader theories of gravity.

Among the alternatives that we see in the present literature, the f(RT) gravity has emerged as one of the most optimistic possibilities. Besides the f(RT) gravity applications that we mentioned in the Introduction, we should add the following. The Palatini formulation of f(RT) gravity and its cosmological consequences can be seen in [90]. The study of scalar cosmological perturbations was made in [91]. Different cosmological models, such as Chaplygin gas and quintessence models, were reconstructed in the framework of f(RT) gravity in [92]. f(RT) cosmological solutions were investigated through the phase-space analysis in [93]. A particular model to describe inflation in the f(RT) gravity was presented in [94]. Further wormhole solutions in f(RT) gravity can be seen in [95]. The idea of “unimodular gravity” was extended to f(RT) theory in [96]. Finally, in [97], T was taken as the energy–momentum tensor of a scalar field, and for a given scalar field potential, the obtained cosmological model was able to describe the complete history of the universe evolution, including a graceful exit from the inflationary to the radiation-dominated era.

In the present article, we have, for the first time in the literature, implemented the Gaussian Process to the f(RT) gravity framework. Through analysis of 41 measurements of the Hubble parameter H(z), we were able to reconstruct both numerically and analytically the f(T) function within \(f(R,T)=R+f(T)\), by arriving in a novel f(RT) model: the HTP model. Using the Bayesian Information Criterion, our analysis provides strong evidence in support of the HTP model when compared to the current cosmological concordance model. In the current scenario of extended gravity theories, this raises as a good alternative to evade the cosmological constant problem.

The introduction of this new model opens up unexplored avenues for testing against further cosmological and astrophysical data. For instance, in the Introduction we have mentioned that not only the cosmological constant problem needs deep attention in standard cosmology framework, but also the absence of dark matter detection. It has, indeed, been shown that the dark matter gravitational effects in the rotation curves of galaxies can be simply predicted in the weak-field regime of broader gravity formalisms [98, 99]. The next step would be to apply the HTP model here obtained to the galactic dynamics regime to check if it is also capable of describing dark matter effects.

A third observational issue that needs attention in standard cosmology is the Hubble tension (also mentioned in the Introduction). Could it also be analysed under extended gravity? Extrapolation of our analysis to redshift \(z=0\) yields a value of \(H_0=69.96\pm 4.13\ \hbox {km}\ \hbox {s}^{-1}\ \hbox {Mpc}^{-1}\) for the Hubble constant, consistent with other works [100, 101] at the \(1\sigma \) statistical confidence level. It is remarkable that our value for \(H_0\) fits both Planck data and SH0ES collaboration value, which could be understood as an alleviation of the Hubble tension under the HTP model. Of course, it is important to consider the uncertainties that arise from our results, which may be attributed to the need for additional H(z) measurements at high redshifts. A more precise determination of \(H_0\) has the potential to provide valuable insights into the tension and maybe offer a better understanding of the underlying gravity theory being considered.