scieee AI-readable full text Open interactive document viewer

Using the softplus function to construct alternative link functions in generalized linear models and beyond

Wiemann, Paul F. V.,Kneib, Thomas,Hambuckers, Julien

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Wiemann, Paul F. V.; Kneib, Thomas; Hambuckers, Julien Article — Published Version Using the softplus function to construct alternative link functions in generalized linear models and beyond Statistical Papers Provided in Cooperation with: Springer Nature Suggested Citation: Wiemann, Paul F. V.; Kneib, Thomas; Hambuckers, Julien (2023) : Using the softplus function to construct alternative link functions in generalized linear models and beyond, Statistical Papers, ISSN 1613-9798, Springer, Berlin, Heidelberg, Vol. 65, Iss. 5, pp. 3155-3180, https://doi.org/10.1007/s00362-023-01509-x This Version is available at: https://hdl.handle.net/10419/317013 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. http://creativecommons.org/licenses/by/4.0/ Statistical Papers (2024) 65:3155–3180 https://doi.org/10.1007/s00362-023-01509-x REGULAR ARTICLE Using the softplus function to construct alternative link functions in generalized linear models and beyond Paul F. V. Wiemann1,2 ·Thomas Kneib2·Julien Hambuckers3 Received: 25 April 2022 / Revised: 24 May 2023 / Published online: 15 December 2023 © The Author(s) 2023 Abstract Response functions that link regression predictors to properties of the response distribution are fundamental components in many statistical models. However, the choice of these functions is typically based on the domain of the modeled quantities and is usually not further scrutinized. For example, the exponential response function is often assumed for parameters restricted to be positive, although it implies a multiplicative model, which is not necessarily desirable or adequate. Consequently, applied researchers might face misleading results when relying on such defaults. For parameters restricted to be positive, we propose to construct alternative response functions based on the softplus function. These response functions are differentiable and correspond closely to the identity function for positive values of the regression predictor implying a quasi-additive model. Consequently, the proposed response functions allow for an additive interpretation of the estimated effects by practitioners and can be a better fit in certain data situations. We study the properties of the newly constructed response functions and demonstrate the applicability in the context of count data regression and Bayesian distributional regression. We contrast our approach to the commonly used exponential response function. Keywords Generalized linear model ·Link function ·Regression ·Response function ·Softplus 1 Introduction Regression analysis is an essential tool for understanding relationships between variables in many fields, including economics, social sciences, and engineering. Response BPaul F. V. Wiemann [email protected] 1Department of Statistics, University of Wisconsin-Madison, Madison, WI, USA 2Chair of Statistics, University of Göttingen, Humboldtallee 3, 37073 Göttingen, Germany 3HEC Liège, Department of Finance, University of Liège, Liège, Belgium 123 3156 P. F. V. Wiemann et al. functions and their inverse, known as link functions, play a pivotal role in modern regression methods as they relate distribution parameters to predictors. While default response functions such as the logistic and exponential functions are widely used, they may not always provide the best fit for the specific problem at hand. The selection of an appropriate response function impacts the model in two ways: First, unsuitable response functions lead to poor model fit, potentially violating model assumptions. Second, the choice of the response function significantly impacts the interpretation of covariate effects in a regression model. The exponential function is popular for strictly positive parameters due to the interpretability of effects as multiplicative. However, this assumption of multiplicativity can be restrictive, as additive effects are often desired in statistical modeling. Traditionally, researchers resort to not using a response function if they desire additivity of effects. However, this can be problematic when the parameter modeled is strictly positive. Certain covariate combinations might lead to a negative value and, thus, invalidate the model. In this paper, we propose constructing novel types of response functions for strictly positive parameters based on the softplus function softplus(x)=log(1+exp(x)). These response functions may prove valuable when seeking a model with an additive interpretation of effects since they allow for a quasi-additive interpretation over a certain part of the range of predictor values while guaranteeing that the function’s value complies with the positivity restriction. Furthermore, it is a strictly increasing bijective function mapping the real values to its positive subset. Therefore, it is an eligible response function for positively restricted distribution parameters. It can be used instead of the exponential response function (providing a quasi-additive model) or the identity response function (avoiding the restriction of regression coefficients). In addition to the quasi-additive interpretation, the softplus function enables the design of response functions with interesting properties. Augmented with an additional parameter, it yields further flexibility to model the data given, (i) it avoids exponential growth, which can be an issue under certain covariate combinations, and (ii) it enables the construction of an exponential-like function that avoids potential numerical overflow when evaluating it for large positive predictor values. For the choice of the response function, most researchers rely on default choices such as the logistic response function for parameters restricted to the unit interval (e.g., probabilities) or the exponential response function for strictly positive parameters. In generalized linear models (GLMs, McCullagh and Nelder 1989), these defaults can often be justified by their characterization as natural link functions arising in the context of exponential families. In other cases, the default response functions are chosen to entail specific modes of interpretation, e.g., multiplicative effects on odds in the case of the logistic response function or multiplicative effects on the parameter of interest in the case of the exponential response function. The straightforward interpretability is also the reason why Fahrmeir et al. (2013) recommend using the exponential response function for gamma-distributed responses in the GLM framework instead of the canonical link function. Additionally, special situations require the use of rather exotic response functions. For example, the square root link for Poisson distributed data helps to mimic a least squares estimation on the square root transformed data with a likelihood approach within the GLM framework. 123 Using the softplus function to construct... 3157 To determine the correct response function in a set of candidate functions, Ntzoufras et al. (2003) propose employing a reversible jump algorithm instead of resorting to model selection criteria. An alternative to pre-chosen response functions is to estimate the response function flexibly from the data. The most well-known example of this approach is the single-index model introduced by Ichimura (1993). The kernel-based single-index models share the disadvantage that the estimated response function is often too flexible. To counter this characteristic, Yu and Ruppert (2002) and Yu et al. (2017) introduced penalization to single-index models. Recently, Spiegel et al. (2019) presented an approach that combines the single-index models based on penalized splines with the flexibility of generalized additive models (Hastie and Tibshirani 1986). One practical challenge when employing flexible link functions lies in interpreting the resulting model since restrictions must be assigned to the regression predictor to render the response function estimate identifiable. In contrast, simple, fixed response functions considerably facilitate interpretation. Having easily interpretable effects may be why the exponential response function is still the most common approach for positively bounded parameters. Regardless of how well default choices can be justified, no single response function can fit all situations. Pregibon (1980) points out that a misspecification of the response function is systematic model misspecification. Moreover, domain-specific knowledge about the application can invalidate a multiplicative model entirely and, e.g., suggest an additive model. Therefore, investigating alternative response functions is a worthwhile and relevant endeavor. The remainder of this paper is structured as follows: Sect.2introduces the softplus response function, justifies the quasi-additive interpretation, and gives a guideline for its proper use. Furthermore, Sect. 2describes statistical inference when employing the softplus response function. Section3investigates the softplus response function in simulation studies. The practical applicability of softplus-based regression specifications is demonstrated in Sect.4. The final Sect.5summarizes our findings and discusses future research directions. The code associated with this manuscript can be found on GitHub.1 2 The softplus function 2.1 Definition and properties The softplus function (Dugas et al. 2001) has primarily been employed in deep neural networks (Zheng et al. 2015) as a smooth and differentiable approximation of the rectifier function. In the statistics literature, the rectifier function is commonly known as a linear spline, defined as x+=max{0,x}. The softplus function maps real numbers to their positive counterparts, such that the output is always in the positive subset R+. We use a generalized version of the softplus function (similar to Liu and Furber 2016) 1https://github.com/goestats/softplus-response-function. 123 3158 P. F. V. Wiemann et al. Fig. 1 Plot of the softplus function (left) for different values of softplus parameters a. The approximated linear spline is shown as the dotted line that incorporates an extra parameter a>0 and can be defined using the equation softplusa(x)=log (1+exp(ax)) a.(1) When a=1, the function reduces to its simple form. Figure1illustrates the softplus response function for different values of a. By introducing the softplus parameter a, we can control the approximation error with respect to the linear spline. It can be shown that for every ε>0, exists some a>0 such that 0<softplusa(x)−max{0,x}≤log(2)/a<ε holds for all x∈R. The largest approximation error is at x=0 as visually indicated by Fig.1and follows from the reformulation for numerical stability discussed in the Appendix (see Eq. (3) in Sect. A.1). Besides, one can observe in Fig.1that the softplus function follows the identity function very closely in the positive domain and rapidly approaches zero in the negative domain for x→−∞. This behavior can be further accentuated by increasing the parameter a. Therefore, the softplus parameter acan be used to control how long the quasi-linear relationship should be maintained when approaching zero and consequently, how fast the boundary of the linked distribution parameter is approached. The adoption of the softplus function as a response function features two major advantages: •It translates the additivity of effects on the predictor level to the parameter space for a majority of the relevant distribution parameter space while always guaranteeing the positivity of the distribution parameter. This is achieved by being quasi-linear in its argument as long as the predictor is large enough for a given value of a. •The softplus function allows for a straightforward interpretation of the covariate effects. When the predictor value is large enough, the effects can be interpreted directly on the parameter. Consider the linear effect of a covariate xwith the corresponding regression coefficient β. A difference in xby one unit is associated with a difference of βin the predictor and, when using the softplus function, also with a difference of almost βin the distribution parameter or expressed as a formula softplus(β(x+1)) ≈β+βx. 123 Using the softplus function to construct... 3159 Clearly, the quasi-additive interpretation is no longer valid once the argument of the softplus function is not within the approximately linear part of the softplus function, which we define in detail in Sect. 2.2. However, by choosing a sufficiently large a,the linear part covers almost the entire positive domain. In the negative domain and for a sufficiently large a, a slight change of the covariate usually does not cause a relevant change in the parameter value since the softplus function outputs values very close to zero. To ensure the validity of this interpretation, it is necessary to check the range of values of the linear predictor for the observations in the data set. Most of them should be located within the linear part of the softplus function. The quasi-additive interpretation contrasts the usual multiplicative interpretation for positively constrained parameters that arise from using the exponential response function. For example, exp(β(x+1)) =exp(β) exp(βx)leads to the interpretation that a change of one unit in the covariate is associated with a multiplicative change of exp(β) units on the parameter. In contrast to large values for a, which enable the quasi-additive interpretation, with the choice of sufficiently small values for a, the softplus function resembles the exponential function with a scaled and shifted argument. This becomes more obvious when taking into account that log(x+1)is almost linear in x,for|x|1, and thus log(1+exp(ax))/a≈exp(ax −log(a)) for exp(ax)1. Consequently, the choice of the softplus parameter aallows to continuously vary between an identitylike response function (for a→∞) and the exponential response function (with scaled and shifted argument for a→0). This property facilitates the construction of the softplus exponential response function, approximating the exponential function for small arguments but with a limiting gradient (see the Supplementary Material for details). The function can be a viable alternative if one desires an exponential-like response function, but unbounded growth is an (e.g., numerical) issue. 2.2 Linear part of the softplus function A crucial consideration in employing the softplus function as a response function in regression modeling is identifying the region where it behaves approximately linearly. Only within this section the interpretation of regression effects is quasi-additive. However, due to the nonlinearity of the softplus function across its entire domain, it is necessary to specify the conditions under which this interpretation is valid. Consider a change in the regression predictor of γ∈Rstarting from the value η∈R. Using the identity function as the response function, the change in the parameter modeled is equally γ. Thus, a regression effect of size γcan be interpreted as influencing the parameter by γ. When working with the softplus function, it is important to note that the same change in the argument can lead to different changes depending on the location of η. We need to identify the subset of the domain in which the function value change approximately matches the argument’s change. This requires an assessment of the error induced by the softplus function and establishing an acceptable error threshold. 123 3160 P. F. V. Wiemann et al. The error induced by using the softplus function is errora(η, γ ) =γ−(softplusa(η +γ)−softplusa(η)) (2) while the relative error is rerra(η, γ ) =errora(η, γ ) γ=1−softplusa(η +γ)−softplusa(η) γ. We say that interpreting a regression effect γdirectly on the parameter is valid if, for some pre-specified acceptable relative error α, the predictor ηis in the interval [T,∞)⊆Rfor which rerra(T,γ)<αholds. The acceptable relative error, of course, depends on the application and should be chosen carefully. In this work, we consider a relative error of 5% acceptable. 2.3 Choosing the softplus parameter There are two approaches to selecting a value for the softplus parameter a: based on the model fit or to achieve the desired interpretability. In cases where interpretability is of higher priority, we recommend selecting a value for athat permits the quasiadditive interpretation with an relative error margin of no more than five percent. More precisely, after fitting the model, it should be confirmed that the estimated predictors for (almost) all observations are within the interval [T,∞)when interpreting effects of size γ. However, since this assessment can only be done after fitting the model, testing multiple values of amight be required. Additionally, we want to stress that it is at least of equal importance to check that the model assumptions are met. 2.4 Inference Replacing the standard exponential response function with the softplus response functions introduced in this paper does not cause major difficulties as long as the parameter ais fixed. Since the softplus-based response functions are continuously differentiable, standard maximum likelihood inference can be used in GLM-type setting where only the derivative of the link function in the definition of the working weights and the working observations of iteratively weighted least squares (IWLS) optimization have to be replaced (see for example Fahrmeir et al. (2013), for details on the IWLS algorithm). In our simulations and applications, we rely on the Bayesian paradigm for statistical inference, since this allows us to apply the softplus-based response functions also beyond GLMs, for example in generalized structured additive regression models with complex additive predictor (Brezger and Lang 2006) or in structured additive distributional regression models (Klein et al. 2015). For the pre-specified response function with parameter a, we rely on an MCMC simulation scheme where we update the parameter vector block-wise with a Metropolis-Hastings (MH) step in conjunction with IWLS proposals (Gamerman 1997; Klein et al. 2015). IWLS proposals automatically adapt the proposal distribution to the full conditional distribution and therefore 123 Using the softplus function to construct... 3161 avoid manual tuning which is, for example, required in random walk proposals. This is achieved by approximating the full conditional distribution with a multivariate normal distribution whose expectation and covariance matrix match mode and curvature of the full conditional distribution at the current state of the chain which can be determined based on the IWLS algorithm of frequentist maximum likelihood estimation without requiring the normalizing constant of the full posterior. More precisely, the parameters of the proposal distribution are determined by executing one Fisher-Scoring step and using the new position as the mean for the multivariate normal distribution while the covariance of the normal distribution is set to be the inverted observed Fisher- Information at the old position. More formally, let θbe the vector of parameters that should be updated within a MH-block and let L(θ)be the unnormalized full conditional posterior log density with respect to the parameter vector θ. The proposal distribution is Normal with mean μ=θ+gF−1and covariance matrix =F−1 where gdenotes the gradient of L(θ)and Fdenotes the Hessian of −L(θ)each with respect to θ. This sampling scheme has proven effective in various regression models (Lang and Brezger 2004; Klein et al. 2015; Klein and Kneib 2016). Our implementation relies on an extension of the R-package bamlss (Umlauf et al. 2018) which implements methodology described above. 3 Simulations With our simulations, we •conduct a proof of concept evaluation that investigates how reliable models with the softplus response function can be estimated and whether the resulting credible intervals are well calibrated, •study the ability of model selection criteria to distinguish between data-generating processes involving either the softplus or the exponential response function. For all simulations, estimation is conducted within the Bayesian paradigm and carried out in R(R Core Team 2022) with the package bamlss (Umlauf et al. 2018). We use a similar data-generating process varying only the sample size and the response function. In particular, we employ data generated from a Poisson distribution with expectation E(yi)=λi=h(ηi)where h denotes the response function. For a single observation, we choose the predictor structure η=1.0+0.5x1+1.0x2+2.0x3with x1,x2,x3being independent and identically uniform distributed on the interval from −1 to 1. All observations are stochastically independent. Throughout this section, we assume flat priors for all regression coefficients. 3.1 Point estimates and credible intervals In the first segment of the simulation studies, we present the results that demonstrate the reliability of using the softplus function as a response function with well-calibrated posterior means and credible intervals. The simulation scenarios feature the sample sizes n∈{50,100,200,500,1000,5000}and the softplus parameter ais set to a value from {1,5,10}. Within each scenario, we carry out 6150 replications, a number 123 3162 P. F. V. Wiemann et al. Fig. 2 Box plots of deviations from posterior mean estimates of regression coefficients to the true value for different sample sizes and different softplus parameters a. Replications that include an absolute deviation larger than five for one coefficient have been excluded from plotting for better visualization. This applies to one replication with a=5 and to ten replications with a=10 each with a sample size of 50 that is determined by considering the coverage of the true parameter as a Bernoulli experiment and imposing that the normal approximation of the 95% confidence interval for a coverage rate of 0.8 does not surpass 0.02. In the first part of the simulation studies, we show that the softplus function can be reliably used as a response function and that posterior means and credible intervals are well-calibrated. The simulation scenarios feature the sample sizes n∈{50,100,200,500,1000,5000}and the softplus parameter awas set to a value from {1,5,10}. Within each scenario, we simulated 6150 replications. The number 6150 is determined by considering the coverage of the true parameter as a Bernoulli experiment and requiring that the normal approximation of the 95% confidence interval for a coverage rate of 0.8issmallerthan0.02. We run one MCMC chain with 12,000 iterations, of which the first 2000 iterations are deemed the burn-in phase. The results are visualized using box plots of the posterior mean estimates in Fig.2 and coverage ranges of 80% and 95% credible intervals in Fig.3.Insummary,we draw the following conclusions: Bias For most simulation settings, the bias is negligibly small. The only exception is a small sample size in conjunction with a rather large softplus parameter a, where we can observe a slight bias, especially for the intercept. However, one must keep in mind that a large parameter aimplies an almost linear link function such that there is considerably less variability (and therefore information) in data sets with the softplus response function compared to the exponential response function with the same linear predictor value. Furthermore, the softplus function maps even small negative values to a positive value close to zero and thus close to the boundary of the parameter space. The bias quickly diminishes as the sample size increases. 123 Using the softplus function to construct... 3169 Fig. 7 Posterior mean estimates on the predictor of the standard deviation together with 95% point-wise credible intervals (equal-tailed) for both response functions Detailed results concerning the mean predictor and its components are omitted since both models employ the same response functions and the results are very similar (see the Supplementary Material for a full description). We focus on the effect of the response function concerning the standard deviation σi and, in particular, on the smooth effect of dhour and the linear effect of weekend. Figure7shows the estimated effect of the time of the day on the predictor of the standard deviation. We find that both models yield similar patterns. The standard deviation is much larger in the early hours of the day with a peak around 3 am, then drops steeply, crosses the zero line shortly after 5 am and is comparatively low in the morning. Over the course of the morning, the standard deviation increases slightly until lunchtime, then decreases over the early afternoon before starting to increase again around 4 pm. At first slightly and then very steep until it reaches its peak again in the early morning hours. The direct interpretation of these effects is difficult, especially when using the exponential response function. For the softplus model, the estimated values of the linear predictor are larger than 0.42 and, in conjunction with a softplus parameter of 10, covariate effects can be interpreted as quasi-additive effects on the parameter (the relative error for a change of 0.0001 at predictor value 0.42 is smaller than 2%). In the following, consider the difference between the initial peak at 2.5 am and the second peak at lunchtime. In the model with the softplus response function, we observe that the predictor decreases by about 2.7 units and, consequently, the standard deviation likewise. In contrast, for the competing model, the exponential function must be applied to the predictor, and the outcome can subsequently be interpreted multiplicatively. The exponential model outputs an additive change of −1.25 on the predictor ησ, which is reflected in a multiplicative change of the standard deviation by 3.5−1. When considering the variable weekend (Table 3), its effect is similar in both models: the mean rental duration exhibits more variance during the weekend, and both 95% credible intervals exclude zero. However, the interpretation of the exponential model is not straightforward: the posterior mean of the regression coefficient related to weekend is 0. In order to assess the multiplicative effect of weekend on the standard deviation, one needs to consider the posterior mean of the transformed parameter, that is exp(βweekend)=1.48. We conclude that on a weekend, the standard deviation is 1.48 times larger than on weekdays. 123 3170 P. F. V. Wiemann et al. Table 3 Posterior estimates of the linear effects on the predictor of the standard deviation together with their 95% credible intervals (equal-tailed) Exponential Softplus Mean 2.5% 97.5% Exp.(·)Mean 2.5% 97.5% (Intercept) 0.151 0.134 0.168 1.163 1.325 1.303 1.348 weekend 0.392 0.364 0.419 1.480 0.566 0.525 0.604 year 2017 –0.016 –0.037 0.005 0.984 – 0.009 – 0.032 0.014 Fig. 8 Predicted standard deviation over the course of a day. Exemplary for the first day of the year 2016 and July 1st on a working day (Panel A) and on a weekend (Panel B). The solid line refers to predictions for the model with exponential response function while the dashed line refers to the model with softplus response function The softplus model directly outputs the additive effect of weekend. We expect that the standard deviation of the mean rental duration is 0.56 minutes larger on weekends than on working days. In both models, the interpretation of regression effects w.r.t. the predictor ησis straightforward, and the nature of the effects w.r.t. the standard deviation is known (i.e., additive or multiplicative). Despite this, the combination of effects and their interaction with the response function makes assessing the absolute effects on the distribution parameter difficult. However, it becomes more apparent when considering plots of the predicted parameter values. In Fig.8, we show the predicted values (using the posterior mean of the estimated parameters) for σover the course of two selected days of the year 2016 (these are the 1st of January and the 1st of July). We further add the effect of weekend and display the predicted values for both models. We observe that both models output similar values for a weekday on the 1st of July. Even the spike in the early morning appears similar. In the winter or on a weekend, the standard deviation is larger in both models (exponential model: 1.48 times larger on weekends, 1.31 times larger on the 1st of January; softplus model: 0.56min larger on weekends, 0.23min larger on the 1st of January). The difference between the models is most apparent at the 3 am peak, where it is now about one minute. The exponential function’s almost explosive behavior becomes apparent when considering the combined effect (left panel in Fig.7B). The difference between the peak at noon and in the morning is almost 5min with the exponential function (that is a 3.5 fold increase) and just 2.75min with the softplus function. Again, for the remaining time of the day, both 123 Using the softplus function to construct... 3171 models output relatively minor differences. Compared to the right panel in A, we find exp(0.27 +0.39 +1.25)=6.75 fold increase between noon and morning peak with the exponential function. Due to the additive nature of the softplus function, the effects are not multiplied and the difference is just 4.53 fold (4.49min compared to 0.99 min). We can draw the following conclusions from this application: the softplus function can serve as an alternative response function in distributional regression for a bounded parameter and result in improved model fit. Additionally, the limited growth rate of the softplus function can prevent the explosive behavior of the exponential function while also providing a quasi-additive interpretation of regression effects. Even when both functions fit equally well, the softplus function remains a viable alternative, and the choice between the two functions ultimately rests with the practitioner. A final remark: In the distributional regression framework, choosing an appropriate response distribution is essential. In our case, the mean rental duration is modeled, and hence the normal distribution appears to be a natural choice. However, the quantile-quantile plots (shown in the Supplementary Material) of the estimated residuals indicate that potentially skewed distributions with heavier tails may be more suitable and warrant further investigation in future research. 4.3 Operational losses at UniCredit In this section, we demonstrate the usefulness of the softplus function in the context of a distributional regression model. To do so, we employ the data4used in Hambuckers et al. (2018a) where the authors model the size distribution of extreme operational losses in a large Italian bank (i.e., losses stemming from fraud, computer crashes or human errors) given a set of economic factors (e.g., interest rates, market volatility or unemployment rate). This conditional distribution is then used to estimate a quantile at the 99.9% level, a quantity needed to establish the regulatory capital held by the bank, with large quantile values requesting more capital, and to monitor operational risk exposure in various economic situations, such as a financial crisis or economic expansion periods. Since operational loss data are heavy-tailed and the focus is on extreme value dynamics, distributional regression techniques are needed to properly reflect the effect of the covariates on extreme quantiles. Following Chavez-Demoulin et al. (2016), an approach based on extreme value theory is traditionally used: a high threshold τis defined by the statistician, and only losses larger than this threshold are kept for the analysis. Then, we assume that the distribution of the exceedances above the threshold is well approximated by a Generalized Pareto distribution (GPD). In the context of extreme value regression, the parameters of the GPD are additionally modeled as functions of covariates, defining a Generalized Pareto (GP) regression model. Estimated parameters of this model are used to derive the quantile of interest given values of the covariates. For mathematical and conceptual reasons, both parameters of the GPD are restricted to strictly positive values: the scale parameter σ(x)is strictly larger than 0, whereas the shape parameter γ(x)is restricted to positive values to guarantee the consistency 4The data can be accessed through: http://qed.econ.queensu.ca/jae/datasets/hambuckers001/. 123 3172 P. F. V. Wiemann et al. Table 4 Descriptive statistics of the exceedance. iqr denotes the inter-quantile range Category n Mean Median Skewness Kurtosis Iqr CPBP 4034 255,879 29,453 24 674 68,361 EDPM 3302 133,468 15,571 20 539 43,689 EFRAUD 1598 64,027 15,277 37 1412 31,169 Fig. 9 Histograms of the log-losses larger than the 75% quantile per category, for the three event types of the maximum likelihood estimator and to reflect the tail-heaviness of the loss distribution. Thus, an exponential response function is commonly used for computational simplicity, although no theoretical support for a multiplicative model exists (see, e.g., Umlauf and Kneib (2018), Hambuckers et al. (2018b), Bee et al. (2019) and Groll et al. (2019)). However, this choice for γ(x)might quickly generate explosive quantile estimates for some combinations of the covariates, making the model economically unexploitable to derive capital requirements. In addition, it can have a similar undesired effect on uncertainty quantification: the width of the confidence interval on the quantile increases exponentially with the estimated quantile itself. Consequently, it is in times of high estimated risk exposure (i.e., large values of the 99.9% quantile) that risk managers face the highest model uncertainty to take decisions. To illustrate how the softplus function helps mitigate these issues, we reanalyze the UniCredit loss data for three categories of operational losses, namely the categories execution, delivery and process management (EDPM), clients, products, and business practices (CPBP) and external fraud (EFRAUD). The data were collected over the period January 2004–June 2014. As in Hambuckers et al. (2018a), we work with the 25% largest losses in each category. Descriptive statistics and histograms of the data are provided in Table 4and Fig.9. They both highlight the presence of extreme values that need to be accounted for. For each loss registered during a given month, we associate the values taken by a set of economic covariates observed the month before that were found susceptible to influence the loss distribution by Hambuckers et al. (2018a) (the complete list can be found in the Supplementary Material). Denoting by yi=zi−τthe exceedance of a loss ziabove the threshold τ, and by xγ,iand xσ,i the corresponding vectors of covariates for both γand σ, our model can be written in generic form as yi∼G(γ (xi), σ(xi)), 123 Using the softplus function to construct... 3173 Table 5 Deviance information criterion for the different models. Null model refers to the exponential model with no covariates. The smallest value in each category is underlined Category Exp Sofptplus 1 Softplus 5 Softplus 10 Null model CPBP 23,593.24 23,594.99 23,598.48 23,603.37 23,626.18 EDPM 16,532.26 16,532.77 16,535.42 16,540.51 16,542.68 EFRAUD 6547.11 6545.59 6545.89 6546.31 6567.46 Fig. 10 QQ-plots of the RQRs for the different models. The number in parentheses refers to the employed goodness of approximation parameter in the softplus function γ(xi)=hγ(x γ,iβ β βγ), σ(xi)=hσ(x σ,iβ β βσ), with G(·)denoting the cumulative distribution function of the GPD, and β β βγand β β βσ being the vectors of regression parameters for γand σ, respectively. We fit separate GP regression models to each sample with bamlss using 24,000 MCMC iterations, treating the first 4000 iterations as burn-in and applying a thinning factor of 20. We compare the results obtained with various response functions hγ(we keep the exponential function for hσ). Estimated regression parameters can be found in the Supplementary Material. We report the DIC in Table 5, whereas Fig. 10 displays the QQ-plots of the RQRs. They both indicate that the overall goodness-of-fit is 123 3174 P. F. V. Wiemann et al. Fig. 11 Box plots of the estimated 99.9% quantiles of the conditional loss size distribution (x-axis is in log-scale). Fig. 12 Ratio of the sizes of the confidence intervals (sp / exp). Left panel: ratio expressed as a function of the softplus posterior mean estimate. Right panel: ratio expressed as a function of the exponential posterior mean estimate. Each row displays the results with the softplus parameter set to the value indicated on the right (a=1,5,10) satisfactory and similar across models, with a slight preference for the softplus models for EFRAUD, and an advantage of the exponential model for the other categories. However, looking first at the predicted values of the 99.9% quantile of the conditional distributions, models based on the softplus functions generate fewer outliers than the exponential function (Fig.11): the largest predicted quantiles are between 1.5 and 3471 times smaller with the softplus models than with the exponential model. Whereas UniCredit is exposed to extremely high (and unrealistic) capital requirements if it uses the exponential model, this issue is well mitigated with the softplus model. This effect is particularly strong for EFRAUD. Second, looking at the size of the confidence intervals for the 99.9% quantiles, we observe a clear trend: in Fig.12,we show the ratio between the size of the confidence intervals obtained with the softplus functions and those obtained with the exponential function, with values smaller than 1 indicating an advantage for the softplus functions. For large values of the estimated quantile, we obtain much narrower confidence intervals with the softplus functions, with most ratios below 1. This result implies that, in times of financial stress characterized by high values of the quantiles, the softplus models deliver more informative estimations. Finally, we investigate if these results also imply a better fit of the models based on the softplus function for the observations far in the tail. To do so, we report the Anderson-Darling (AD) statistics (Stephens 1974) computed on the RQRs (Fig. 13). Compared to AIC or DIC, the AD statistic gives more weight to extreme residuals and 123 Using the softplus function to construct... 3175 Fig. 13 Anderson-Darling statistics obtained from the RQRs for the three categories is therefore routinely used to assess the goodness-of-fit of extreme value regression models (Choulakian and Stephens 2001; Bader et al. 2018). On this latter criterion, we observe a better fit of the softplus functions for CPBP and EFRAUD. The fit is rather similar for EDPM, although slightly better for the exponential model. Overall, this application demonstrates the usefulness of the softplus function to prevent outliers among estimated quantities of interest (in the present case, a quantile far in the tail) when there are no justifications for a multiplicative model. In addition, it shows that the softplus models provide similar global goodness-of-fit levels but dramatically reduce the uncertainty around large estimated quantities of interest, a desirable feature for end-users. Finally, notice that, once the softplus response function has been chosen to avoid outliers and to decrease estimation uncertainty, one may be interested in selecting an appropriate softplus parameter a, as discussed in Sect. 2.3. In the present case, this selection can be conducted using either an information criterion like DIC, or a goodness-of-fit statistic focusing on the tail observations such as the AD statistic, since this is a primary concern in our application. 5 Summary and conclusion This paper introduces the softplus response function and showcases its applicability in a broad range of statistical models. The novel response function ensures the positivity of the associated distribution parameter while allowing for a quasi-additive interpretation of regression effects for the majority of the relevant predictor space. We highlight the interesting theoretical properties of the softplus response function, justify the quasi-additive interpretation and give a guideline to assess the validity of this interpretation. Particular emphasis is placed on demonstrating the straightforward quasi-linear and quasi-additive interpretation of covariate effects with several applications. Furthermore, we highlight that the limited growth rate of the softplus response function can prevent outliers in predictions and, thus, can reduce prediction uncertainty. Thereby, we show that the new response function is applicable to a great variety of model classes and data situations. Our simulation studies demonstrate that the softplus function behaves well as a response function with no noticeable shortcomings. Estimates are consistent and our 123 3176 P. F. V. Wiemann et al. Bayesian approach yields reliable credible intervals. Furthermore, we show that information criteria can be used to distinguish between data generated by the exponential and the softplus response function. We do not claim that the softplus function is generally a better response function than the exponential function, nor that the softplus response function is always the best choice for a quasi-additive interpretation. Indeed, other response functions to approximate the linear spline can be easily constructed. For example, based on the work of Bacon and Watts (1971) one can construct lim0<→00.5x+0.5√x2+=x+.However, since the implementation of the softplus response function is straightforward, it provides an easy quasi-additive alternative response function for empirical verification. Thus, we are optimistic that the softplus response function will be available in more software for regression modeling, as it is already included in the R-packages brms (Bürkner 2017) and bamlss (Umlauf et al. 2018), and will allow researchers to benefit from it. The work of Weiß et al. (2021), evaluating the softplus response function in the context of INGARCH models, is a first indication for interest of the statistical community in the novel response function. Supplementary Information The online version contains supplementary material available at https://doi. org/10.1007/s00362-023-01509-x. Acknowledgements Financial support from the German Research Foundation (DFG) within the research project KN 922/9-1 is gratefully acknowledged. Julien Hambuckers acknowledges the financial support of the National Bank of Belgium, project REFEX. We thank an anonymous reviewer and an associate editor for their valuable feedback on which we improved the initial manuscript. Funding Open Access funding enabled and organized by Projekt DEAL. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. Appendix A: On implementation and properties of the softplus function A.1: Numerical stability A naive implementation of the softplus function derived from Eq. (1) can easily lead to numerical issues. The value of the exponential function for relatively small inputs is infinity on common computer hardware. To give some intuition, according to the IEEE 754 standard (Zuras et al. 2008) the largest 32-bit and 64-bit floating point numbers are roughly 3.4028 ·1038 and 1.7977 ·10308, respectively. Consequently, calculating exp(89)and exp(710), respectively, yields infinity. 123 Using the softplus function to construct... 3177 This is of special concern for the implementation of softplus function since the argument to the softplus function is multiplied with the softplus parameter abefore the exponential function is applied. Consider a Poisson regression model with softplus response function and a=10. The predictor η=9, targeting an expected value of 9, would already yield infinity on a 32-bit system using the naive implementation although the correct result is between 9 and 9+10−40. Albeit 64-bit CPUs are common nowadays, one should still consider 32-bit floating point arithmetic since it is often used in high-performance computing or when the computation is carried out on graphical processing units (GPUs) or tensor processing units (TPUs). Despite the difficulties described, the softplus function becomes numerically stable by using the equality softplusa(x)=max{0,x}+log(1+exp(−|ax|)) a(3) in conjunction with the log1p procedure. log1p evaluates log(1+x)very precisely even for |x|1 (Abramowitz and Stegun 1972, p. 68) and is available in most programming languages. In this formulation, the exponential function must be evaluated only for arguments less than 0 which can be done accurately. Besides numerical stability, Eq. (3) also implies that the softplus function has its largest approximation error with respect to the linear spline at x=0 with log(2)/a. The correctness of the numerical stable formulation is easily verified by expressing the softplus function in terms of the log-sum-exp (LSE) function and exploiting its translation property. The LSE function takes lreal valued arguments x1,...,xl.Its value is given by LSE(x1,...,xl)=log l  i=1 exp(xi). The translational property (Nielsen and Sun 2016) states that for c∈R LSE(x1,...,xl)=c+log l  i=1 exp(xi−c) holds. Consequently, we have softplusa(x)=log(1+exp(ax)) a=LSE(0,ax) a =max{0,x}+log(exp(0−max{0,ax})+exp(ax −max{0,ax})) a =max{0,x}+log(1+exp(−|ax|)) a where the second line arises by setting c=max{0,ax}and the last line follows from the observation that −|ax|=ax for x<0. 123 3178 P. F. V. Wiemann et al. A.2: On the inverse function The inverse of the softplus is easily derived as softplus−1 a(y)=log(exp(ay)−1) a. However, potential numerical issues have to be taken into consideration when implementing. We suggest to implement softplus−1 a(y)=log(exp(ay)−1) a,ify<log(2) a y+log(1−exp(−ay)) a, otherwise and use the procedure expm1(x) to calculate exp(x)−1. The first derivative is given by d dysoftplus−1 a(y)=1 1−exp(−ay). A.3: Further properties The softplus function shares a number of its properties with the exponential function. Both functions are smooth and bijective mappings from the real numbers to the positive half-axis. The first derivative of the softplus function is always positive and is given by 0<d dxsoftplusa(x)=1 1+exp(−ax)<1. The second derivative is likewise strictly positive 0<d2 dx2softplusa(x)=aexp(ax) (1+exp(ax))2. Therefore, the softplus function is strictly monotonically increasing and strictly convex. References Abramowitz M, Stegun IA (1972) Handbook of mathematical functions. Number 55 in National Bureau of Standards: Applied Mathematics, 10 edn. U.S. Government Printing Office, Washington Agresti A (2013)Categorical data analysis. Number 792 in Wiley Series in Probability and Statistics, 3 edn. Wiley, Hoboken, ISBN 978-0-470-46363-5 Bacon DW, Watts DG (1971) Estimating the transition between two intersecting straight lines. Biometrika 58(3):525–534 Bader B, Yan J, Zhang X (2018) Automated threshold selection for extreme value analysis via ordered goodness-of-fit tests with adjustment for false discovery rate. Ann Appl Stat 12(1):310–329 123