A Bayesian Location‐Scale Joint Model for Time‐To‐Event and Multivariate Longitudinal Data With Association Based on Within‐Individual Variability Authors: Marco Palma, Omar El Makkaoui, Ruth H Keogh, Siobhán B Carr, Rhonda Szczesniak, David Taylor‐Robinson, Angela M Wood, Graciela Muniz‐Terrera, Jessica K Barrett Published: 2026 ABSTRACT ABSTRACTWithin‐individual variability of health indicators measured over time is becoming commonly used to inform about disease progression. Simple summary statistics (e.g., the standard deviation for each individual) are often used but they are not suited to account for time changes. In addition, when these summary statistics are used as covariates in a regression model for time‐to‐event outcomes, the estimates of the hazard ratios are subject to regression dilution. To overcome these issues, a joint model is built where the association between the time‐to‐event outcome and multivariate longitudinal markers is specified in terms of the within‐individual variability of the latter. A mixed‐effect location‐scale model is used to analyze the longitudinal biomarkers, their within‐individual variability and their correlation. The time to event is modeled using a proportional hazard regression model, with a flexible specification of the baseline hazard, and the information from the longitudinal biomarkers is shared as a function of the random effects. The model can be used to quantify within‐individual variability for the longitudinal markers and their association with the time‐to‐event outcome. We show through a simulation study the performance of the model in comparison with standard joint models with constant variance. The model is applied on a dataset of adult women from the UK cystic fibrosis registry, to evaluate the association between lung function, malnutrition and mortality.Keywords: cystic fibrosis, joint model, mixed‐effects location‐scale model (MELSM), within‐individual variability Introduction Longitudinal data are ubiquitous in biomedical studies, where often the evolution of a biomarker over time is monitored to evaluate health status or disease progression. The focus of the analysis is on the trend over time, where steady or sudden changes might be indicative of changes in the health status of an individual. The information about the trend can also be used within a joint model for longitudinal and time‐to‐event data, where the predicted value for a longitudinal biomarker is used to assess risk of death or another outcome [1, 2, 3]. A push towards a richer characterization of longitudinal data beyond the trend has come from different directions. In particular, the notion of visit‐to‐visit (or long‐term) within‐individual variability (WIV), used to quantify fluctuations around the mean, has gained interest in order to answer clinical questions about chronic disease and biomarker monitoring. First considered in cardiovascular research (where it was suggested that blood pressure variability should be taken into account as predictor for stroke [4]), modeling WIV has proved particularly popular in cystic fibrosis (CF) studies. Lung function WIV is a key quantity of interest in CF, as it is often used as an alternative measure to the number of pulmonary exacerbations (acute events associated with decline in CF) whose definition is not fully standardised [5]. For example, lung function variability has been shown to be predictive of future lung function decline [6] and used in a model to predict lung transplant and mortality [7]. The early initiation of a new CF treatment has been shown to reduce lung function variability [8]. In these studies, within‐individual variability is quantified using summary statistics (e.g., standard deviation of the individual observations) or differences with respect to a reference level (the median or the maximum value, possibly within a certain time‐window). These two‐stage approaches, although computationally appealing and immediately interpretable, may incur in biases (e.g., immortal time, when the computation is based on a minimum number of observations) and their precision is rather sensitive to the number of visits (which is often low in biomedical data). In addition, when such measures of variability are used in a time‐to‐event model, their association with the outcome is not accurately estimated and suffers from regression dilution bias towards zero [9]. These limitations motivated novel methodological research in joint modeling to properly address the problem of WIV quantification. A Bayesian joint model was introduced [9, 10], where a mixed‐effects location‐scale model (MELSM [11, 12]) is fitted for the longitudinal biomarker, with a Markov chain Monte Carlo scheme. In this model, both the mean and the residual variability can be expressed as functions of time, covariates as well as subject‐specific random effects, and both the current values of mean and variability are included in the time‐to‐event submodel. In a similar fashion, frequentist approaches [13, 14] were proposed to fit a joint model where the variability of a single biomarker is associated to the hazard of two competing events (of which one is mortality). This setting was further extended for the case of multiple measurements for the same biomarker taken at the same visit, modeling intra‐visit variability as well as WIV [15]. Nevertheless, while multivariate longitudinal models have been explored, even in a location‐scale setting [16], few attempts have been made so far at modeling WIV where (potentially correlated) multiple longitudinal biomarkers are jointly considered with a time‐to‐event outcome. The Bayesian additive model for location, scale and shape (bamlss [17]) offers several approaches to estimate WIV within a joint model [18, 19]. More recently, a novel model with a more parsimonious representation of the mean using functional principal component analysis was proposed, providing another approach to model concurrently both the mean and the variability [20]. Nevertheless, none of these models permit the inclusion of the WIV association term within the time‐to‐event submodel. We propose therefore a Bayesian multivariate joint model with WIV‐based association (JM‐WIV). The longitudinal submodel accounts for modeling both the mean and the within‐individual variability of more than one biomarker, as well as the correlation between biomarkers. The time‐to‐event submodel is a proportional hazard model that includes a function of the variability in the longitudinal biomarkers, with a flexible specification of the baseline hazard based on B‐splines. The association between the longitudinal and the time‐to‐event model is modeled via shared random effects. We provide a novel implementation in Stan for a bivariate longitudinal setting. The article is structured as follows. Section 2 illustrates the structure of the model, with a description of the model assumptions and the key aspects of model fitting. A simulation study showing the advantage of this model against standard joint models in the literature is provided in Section 3. Next, in Section 4 we apply the model on a dataset of women from the UK Cystic Fibrosis registry, where we evaluate the relationship between lung function, body mass index and mortality. Lastly, we discuss the findings, limitations and further developments in Section 5. Methods JM‐WIV Model Formulation Longitudinal Submodel Consider K longitudinal biomarkers yijk (k=1,…,K) for the i‐th subject (i=1,…,N) and j‐th occasion (j=1,…,Ji), observed at subject‐specific ordered time points ti=ti1,…,tiJiT, with ti1≤⋯≤tiJi. As opposed to standard linear mixed models, the independent error terms are assumed normally distributed with non‐constant variance: εijk∼N0,σijk2. A mixed‐effect location‐scale model [11] is proposed for the outcome: where g(⋅)=log(⋅) to ensure that the variance is non‐negative. Note that the formulation for the standard deviation could be also rewritten in terms of the variance and viceversa. For ψ∈{μ,σ}, the fixed‐effect design matrix Xijψk and the random‐effect design matrix Zijψk in the structural additive predictor ηψk(t) can potentially include baseline information or (the basis functions for the additive modeling of) time‐varying covariates: The components of the longitudinal submodel are linked via the random effect vector bi=biμ,biσT∼N(0,∑). As in standard Bayesian joint models [21], to obtain correlations as estimated parameters from the model in an efficient way, we consider an unstructured covariance matrix ∑=TPT with T=diagTμ1,…,TμK,Tσ1,…,TσK. The block Tψk is diagonal with elements τlψk (l=1,…,Lψk) corresponding to the standard deviation of the l‐th element of the random effect vector bψk. The correlation matrix P takes the form with Pψkψk′′=Pψk′′ψkT. For example, Pμ1μ2 refers to the off‐diagonal matrix of correlations between the random effects of the means of biomarker 1 and 2, and Pμ1σ1 refers to the matrix of correlations between the random effects of the mean and the standard deviation of biomarker 1. These matrices reduce to a single number if only random intercepts are used. For the matrix Pψkψk′′, the element ρl,l′ψkψk′′ denotes the correlation between the random effects blψk and bl′ψk′′ (l′=1,…,Lψk′′). It is equal to 1 if ψk=ψk′′∧l=l′ (i.e., the diagonal elements are all equal to 1). Event Submodel Let Ti be the observed right‐censored time (Ti≥tiJi) and δi the event indicator taking value 1 if the event occurred for the i‐th subject and 0 otherwise. The event submodel is specified as a proportional hazard model of the form where ℒi(t) incorporates the information about the longitudinal history, ηiγ is a linear predictor for the baseline covariates of the time‐to‐event submodel, and ηiαℒi(t);t accounts for the association between the hazard function and the longitudinal biomarkers. Let us define the current value of the linear predictor for the mean and standard deviation of all longitudinal biomarkers ηi(t)=ηiμ1(t),…,ηiμK(t),ηiσ1(t),…,ηiσK(t). The association between the longitudinal and time‐to‐event submodels can be specified as: a function of the current value (CV) of the mean and standard deviation ηiαCVℒi(t);t=fηiμ(t),expηiσ(t) a function of the current value (CV) of the mean and standard deviation ηiαCVℒi(t);t=fηiμ(t),expηiσ(t) a function of the current linear predictor of the mean and standard deviation (LP) ηiαLPℒi(t);t=fηiμ(t),ηiσ(t) a function of the current linear predictor of the mean and standard deviation (LP) ηiαLPℒi(t);t=fηiμ(t),ηiσ(t) a function of the random effects (RE) for the mean and standard deviation ηiαREℒi(t);t=fbi a function of the random effects (RE) for the mean and standard deviation ηiαREℒi(t);t=fbi Contrary to standard joint models, all these association structures now incorporate information about the within‐individual variability. Assumptions We assume that the N subjects are independent from each other and the right‐censoring is uninformative [2]. Furthermore, conditional on the random effects, there is independence between the longitudinal outcomes and between each longitudinal outcome and the time‐to‐event one; there is independence between the longitudinal outcomes and between each longitudinal outcome and the time‐to‐event one; the repeated measurements are independent of each other. the repeated measurements are independent of each other. The combined effect of the assumptions above is the following decomposition of the likelihood function: Model Estimation Let θ be the fixed parameter vector. By the assumptions in Equation (3), we can factorize the likelihood function into event and longitudinal processes. The log‐likelihood is therefore equal to For the longitudinal submodel, we use the normal log‐likelihood of the form where σijk is replaced by the corresponding function of the linear predictor for the variability submodel. For the proportional hazard time‐to‐event submodel, the standard likelihood formulation is used [22] where hi(⋅) is given in Equation (2). The logarithm of h0(t) (the baseline hazard) is modeled using penalized B‐splines. Let Bℓ(t):ℓ∈{1,…,L} denote a set of penalized B‐spline basis functions defined over T. The log baseline hazard is expressed as where γh0=γh0,1,…,γh0,LT is the vector of spline coefficients to be estimated. The integral in Equation (5) is approximated using Gauss–Kronrod quadrature with Q nodes, weights wq and locations sq(q=1,…,Q): Left truncation is accounted for in the integral in Equation (5) by evaluating the cumulative hazard over the subject‐specific interval from entry time to the event or censoring time, with the Gauss–Kronrod quadrature nodes taken within this interval. We use common priors for the coefficients. Normally distributed priors are used for the fixed effects for the longitudinal submodel and the baseline covariates for the time‐to‐event submodel. For the random effects, the standard deviations are drawn from a half‐t distribution, while the LKJ prior is used for the correlation matrix. For the log baseline hazard, we impose a smoothness penalty on the spline coefficients via a Bayesian P‐spline prior [23] of the form: where Δr denotes the r‐th order difference penalty matrix, ρ is the rank of Δr⊤Δr, and τh is a smoothing parameter controlling the degree of smoothness of the baseline hazard. This formulation penalizes large differences between adjacent spline coefficients, thereby stabilizing hazard estimation, particularly in regions with few events, while avoiding absorbing variation that is actually due to covariate effects. We also assign a Beta prior distribution to τh, allowing the data to inform the appropriate degree of smoothness while keeping the parameter bounded. Predictive Performance and Model Comparison Predictive performance and model comparison were assessed using approximate leave‐one‐out cross‐validation (LOO) based on Pareto‐smoothed importance sampling (PSIS [24]). Leave‐one‐out cross‐validation estimates out‐of‐sample predictive accuracy by sequentially removing each subject and evaluating the log‐likelihood contribution of the omitted individual under the model fitted to the remaining data. The PSIS‐LOO approach reuses posterior draws to approximate LOO predictive densities via importance sampling weights derived from the full posterior. The resulting expected log predictive density (ELPD) provides a measure of out‐of‐sample prediction, with standard errors allowing uncertainty in predictive performance and differences between models to be quantified. Implementation in Stan Our implementation of the multivariate JM‐WIV (available at https://github.com/marcopalma3/rstanjmwiv) extends the implementation of the Bayesian joint model in Stan [25], now included in the R package rstanarm [ 26], by adding the within‐individual variability models for the longitudinal outcomes and corresponding prior distributions, the penalized B‐splines formulation of the baseline hazard, and the left truncation. Estimation of the model is performed via Hamiltonian Monte Carlo, which explores the parameter space more efficiently than MCMC methods used, for example, in bamlss [ 18, 20]. The current version of the software handles a bivariate longitudinal setting and allows for three association structures: RE, LP and CV. The user can specify the hyperparameters of prior distributions, the number Q of quadrature points (the default used in this work is Q=15) and the number of basis functions for the log baseline hazard functions (here we consider 6 cubic splines). The code and the results in Sections 3 and 4 are available on https://github.com/marcopalma3/JM‐WIV. Simulation Study We illustrate the benefit of our modeling approach via a simulation study, with two aims. First, we show that the inference procedure returns results in line with the simulated data. Second, we compare inference performances with standard joint models (as implemented in the R packages JMbayes2 and rstanarm) which do not offer the possibility of modeling the association of within‐individual variability with the event of interest. We designed a simulation scenario where the correct model includes association between the WIV of the longitudinal biomarkers and time‐to‐event submodel, adapting the structure illustrated for standard joint models [27] to the MELSM case Algorithm (1). We consider the case of K=2 normally‐distributed longitudinal biomarkers with both mean and standard deviation dependent on a fixed time effect and a random intercept: Simulation From Cox‐Exponential JM‐WIV Model With LP Association. For i=1,…,N individuals Random effects Simulate bi∼N4(0,TPT) Time‐to‐event process Draw w1i (from a binomial distribution) and w2i (from a standard normal distribution). Specify A and B as follows: so that hit=explogλ+WiTγ+A+Bt hi(t)=explogλ+wiTγ+A+Bt Draw Ui∼Unif(0,1) and generate event times: Generate independent censoring time Ti*∼Unif0,Tmax. Assign event indicator δi=1 if Ti≤Ti* (zero otherwise). Longitudinal process Generate measurement schedule at regular times between 0 and Tmax. Generate the biomarker values following the MELSM model in Equation (9). To generate the longitudinal observations, we consider a regular schedule every 1 time unit from 0 to Ti (or Ti* for censored observations). For the time‐to‐event submodel, we specify a Cox model with constant baseline hazard function (also known as Cox‐Exponential model [28]) and two baseline covariates (w1 binary, w2 normally distributed). The association parameters for each biomarker are based on the current value of the linear predictors (LP) μijk(t) and logσijk(t): The parameters of the simulation study are reported in Table 1 and in the Supporting Information. For the longitudinal submodel, the correlation structure for the random effects is approximately equal to the corresponding variance–covariance matrix in the CF registry data application in Section 4. In particular, there is positive correlation between mean and standard deviation in both longitudinal biomarkers, and a positive correlation between the means of the two outcomes. TABLE 1Simulation results.InputJM‐WIVSTANJMJMbayes2MeaneSDCoverageMeaneSDCoverageMeaneSDCoverage Longitudinal—y1 β0μ1—Intercept2.1902.1890.0280.9502.1910.0280.9552.1910.0280.955 β1μ1—Time−0.040−0.0400.0010.955−0.0400.0020.985−0.0400.0020.975 τμ1—Random effect SD0.8100.8120.0200.9350.8160.0200.9250.8150.0200.955 β0σ1—Intercept−1.360−1.3640.0270.965−1.2520.027—−1.2520.027— β1σ1—Time−0.020−0.0200.0070.935—————— τσ1—Random effect SD0.4400.4450.0200.930—————— Longitudinal—y2 β0μ2—Intercept1.0401.0360.0330.9401.0390.0340.9401.0390.0340.935 β1μ2—Time0.3500.3500.0090.9300.3510.0090.9250.3510.0090.915 τμ2—Random effect SD0.5200.5180.0280.9650.5140.0290.9650.5120.0290.925 β0σ2—Intercept0.1600.1600.0190.9800.2100.014—0.2100.014— β1σ2—Time0.0100.0100.0050.940—————— τσ2—Random effect SD0.1600.1570.0200.945—————— Event γ1—Binary0.9300.8880.1470.9500.8160.1460.8400.8240.1470.925 γ2—Normal−2.300−2.1900.1130.895−1.9760.1080.210−1.9880.1090.190 αμ1—Mean of y1 −2.240−2.0790.1290.925−1.8300.1970.395−1.8440.2060.260 ασ1—WIV of y1 1.9001.5020.2280.755—————— αμ2—Mean of y2 0.5500.5610.1691.0000.5270.4010.8750.5430.4490.685 ασ2—WIV of y2 0.3500.3980.4031.000—————— Note: For each model, the mean and standard deviation (eSD) of the 200 posterior means are reported, alongside the coverage probability (proportion of times the input value is included in the 95% credible interval). Simulation results. Note: For each model, the mean and standard deviation (eSD) of the 200 posterior means are reported, alongside the coverage probability (proportion of times the input value is included in the 95% credible interval). We simulate 200 datasets with N=1000 individuals each (summary statistics about the datasets are reported in the Supporting Information). We compare our proposed model (JM‐WIV) with two existing joint modeling approaches: the standard joint model as implemented in the R package JMbayes2 [ 29], and the joint model fitted in Stan [25], implemented in stan_jm from the R package rstanarm [ 26]. Both use the correct mean specification for the longitudinal submodels, while the standard deviation is assumed constant. The joint model in JMbayes2 is fitted with a burn‐in of 1000 iterations and a total of 11 000 MCMC iterations, while the Stan‐based joint model in rstanarm uses the default sampling settings provided by the package. For JM‐WIV, 6000 iterations are run, of which the first 3000 are discarded as burn‐in. The results for bias and coverage are reported in Table 1. The simulation shows that the estimation of the parameters of the means of the longitudinal biomarkers remains essentially unaffected by the modeling of the standard deviation. In the time‐to‐event submodel, we observe a difference between the models: the mean estimates in JMbayes2 and rstanarm are on average further from the simulated value compared to JM‐WIV, and the coverage is well below the nominal level of 0.95, not only for the mean association parameters, but also for the baseline coefficients. For JM‐WIV (i.e., the correctly specified model in this instance), the coverage is consistent with the nominal level for all parameters except the association with WIV of the first longitudinal biomarker and the baseline normal covariate, which exhibit slight undercoverage. Similar conclusions can be drawn for a simulation setting where the WIV contribution to the time‐to‐event outcome is closer to zero (reported in the Supporting Information). We compared the three models in terms of predictive performances (Table 2) and computation time (in the Supporting Information). The joint model with within‐individual variability (JM‐WIV) achieved the highest expected log pointwise predictive density (ELPD) across all the 200 simulated datasets, indicating superior out‐of‐sample predictive accuracy compared to both rstanarm and JMbayes2. These results confirm that, while being more computationally demanding (especially against the highly optimized JMbayes2, but also compared to its Stan counterpart), correctly accounting for within‐individual variability leads to improved predictive performance. TABLE 2Leave‐one‐out cross‐validation results for the simulation study based on 200 replicated datasets.Model ELPDloo SDJM‐WIV−8395.02200.30 rstanarm −8907.08225.98 JMbayes2 −11119.30231.71 Note: The table reports the mean expected log pointwise predictive density (ELPD ) and its standard deviation across simulations for each model. Higher ELPD values indicate better predictive performance. Leave‐one‐out cross‐validation results for the simulation study based on 200 replicated datasets. Note: The table reports the mean expected log pointwise predictive density (ELPD ) and its standard deviation across simulations for each model. Higher ELPD values indicate better predictive performance. Application Cystic fibrosis (CF) is a genetic condition due to a mutation in the cystic fibrosis transmembrane conductance regulator CFTR gene (responsible for the movement of salt in cells), which results in mucus accumulation in the lungs and other organs. Infections and chronic inflammation due to CF often lead to a poor quality of life and lower life expectancy than the general population. Approximately 11 000 people in the UK are currently affected by cystic fibrosis [30]. Lung function is the most relevant biomarker in CF monitoring and its decline is associated with a higher mortality risk. Malnutrition is often observed in people with cystic fibrosis, as it is correlated with worse lung function and increased mortality [31]. In this work, we aim to provide some insights about the progression of CF, by jointly modeling WIV in lung function, BMI and their association with mortality. The data comes from the UK CF registry, containing anonymised electronic health records from people with CF between 1996 and 2020. Clinically stable individuals are called to a clinic for an annual encounter, during which a large range of variables about the lungs and other organs are recorded. We focus the analysis on women with at least one record in the registry during the follow‐up period while they are between 18 and 49 years old (which accounts for almost the totality of the records) and we introduce administrative censoring at 50 years old (or at the end of the study period) if they have not experienced the event by then. The inclusion criteria are illustrated in a previous work [32]. The number of individuals in the dataset is 3012, for a total number of annual visits of 21 910. The distribution of the number of encounters for each woman is shown in Figure 1: it ranges between 1 and 23 (with a median of 8 encounters and interquantile range [5;12]), with a non‐negligible share of women having very few encounters. Histogram of annual encounters in the adult women subset. The F508 (often referred to as F508del) mutation in the CFTR gene is the most prevalent genetic alteration causing cystic fibrosis. We considered a binary variable for F508 (homozygous—2 alleles vs. non‐homozygous—0,1, or missing information). The Kaplan–Meier curves by number of F508 alleles in Figure 2 show that those with two F508 alleles (F508 homozygous) women tend to have lower survival probability across almost all the time range. No relevant differences between the Kaplan–Meier curves for the subgroups of non‐homozygous were observed (as shown in the Supporting Information, Figure S1). Kaplan–Meier curves by F508 (0: Non homozygous; 1: Homozygous). We build a bivariate joint model as in Equation (11) for the i‐th individual, j‐th encounter and k‐th biomarker. We consider a measure of lung function (FEV1, forced expiratory volume in 1 s, measured in liters of air) as first biomarker (k=1) and body mass index (BMI) as second (k=2). Both the biomarkers (and their within‐individual variability) are modeled as function of age and a random intercept, with baseline covariates as F508 class and age at diagnosis (before/after first year of life). In the time‐to‐event submodel, we include the current values for both means and variabilities for FEV1 and BMI, as well as F508 class and age at diagnosis. We choose 6 cubic B‐spline basis functions to flexibly model the log baseline hazard. We fit the model using Stan, with 2 chains, 1000 burn‐in iterations and a total of 2000 iterations. The posterior estimates and 95% credible intervals of all variables in the longitudinal submodel are reported in Table 3. TABLE 3Results for the CF longitudinal submodel: Posterior mean and standard deviation, MCMC standard error (defined as the ratio between standard deviation and square root of effective sample size), 95% credible interval and R^ statistic.MeanMCMC‐SESD2.5%97.5% R^ Longitudinal—FEV1 mean β0μ1—Intercept1.8330.0020.0141.8071.8611.030 β1μ1—Age−0.0390.0000.000−0.040−0.0381.001 β2μ1—Diagnosed after 1 year old0.3040.0060.0320.2340.3691.084 β3μ1—F508 homozygous−0.2300.0040.029−0.288−0.1741.024 τμ1—Random effect SD0.7790.0010.0110.7570.8011.010Longitudinal—FEV1 log(SD) β0σ1—Intercept−1.5510.0000.012−1.574−1.5281.003 β1σ1—Age−0.0210.0000.001−0.023−0.0181.000 β2σ1—Diagnosed after 1 year old0.0160.0010.023−0.0290.0621.000 β3σ1—F508 homozygous0.0490.0010.0230.0030.0930.999 τσ1—Random effect SD0.4460.0000.0090.4270.4651.002Longitudinal—BMI mean β0μ2—Intercept21.5370.0050.06121.41821.6631.004 β1μ2—Age0.0460.0000.0020.0410.0511.000 β2μ2—Diagnosed after 1 year old0.8660.0170.1340.6071.1411.030 β3μ2—F508 homozygous−0.8910.0120.124−1.149−0.6731.013 τμ2—Random effect SD3.2430.0030.0483.1503.3371.002Longitudinal—BMI log(SD) β0σ2—Intercept0.1600.0010.0120.1370.1831.005 β1σ2—Age0.0000.0000.001−0.0030.0021.000 β2σ2—Diagnosed after 1 year old0.0160.0010.023−0.0300.0611.001 β3σ2—F508 homozygous−0.0770.0010.023−0.121−0.0331.010 τσ2—Random effect SD0.4610.0000.0100.4420.4801.006 Note: Intercepts values reported in this table refer to centered covariates. Age in the model is chronological age minus 18. Results for the CF longitudinal submodel: Posterior mean and standard deviation, MCMC standard error (defined as the ratio between standard deviation and square root of effective sample size), 95% credible interval and R^ statistic. Note: Intercepts values reported in this table refer to centered covariates. Age in the model is chronological age minus 18. As expected, FEV1 tends to decrease at older ages; women with a later diagnosis show better lung function on average compared to those diagnosed soon after birth, and the same conclusion applies for non‐homozygous women compared to homozygous ones. FEV1 variability instead tends to decline as age increases (as shown also in our previous work [32]) and is slightly higher on average for homozygous women. For BMI, the mean tends to be increasing as age increases. Women with later diagnosis and F508 non‐homozygous show on average higher BMI measurements than the other groups. In the variability submodel for BMI, no age change is found, while only F508 has a non‐zero estimate, with lower WIV observed for homozygous women on average. The 95% credible intervals of the four random effects are all far from zero, indicating that there is still additional variability in the mean and standard deviation submodels which is not captured by the covariates in the model. In addition, the posterior means of the correlation structure (reported in the Supporting Information) for the random effects suggest that there is a positive correlation between the FEV1 and BMI mean (approximately equal to 0.5), as well as for mean and WIV for both biomarkers. These results agree with the physiology of the problem: especially for FEV1, when an individual has lower functionality due to lung damage the fluctuations will also have a limited range. The longitudinal submodel fits the data well, as shown by the posterior predictive checks in Figure 3, for both biomarkers. Posterior predictive checks for longitudinal submodel (left: FEV1; right: BMI). The estimates for the hazard ratios of the longitudinal biomarkers in the time‐to‐event submodels are reported in Table 4. The hazard ratios with FEV1 are expressed in dL for better interpretability. TABLE 4Association between current values for longitudinal biomarkers and mortality. FEV1 hazard ratios are expressed per dL.HR2.5%97.5%Association with mean FEV1 (in dL)0.8070.7880.827Association with WIV of FEV1 (in dL)1.3091.1741.457Association with mean BMI0.8640.8140.917Association with WIV of BMI1.4651.1091.869 Association between current values for longitudinal biomarkers and mortality. FEV1 hazard ratios are expressed per dL. Both FEV1 and BMI mean show a hazard ratio (HR) lower than 1, indicating that worse lung functionality and lower body mass index are both associated with higher risk of death. In addition, the within‐individual variability for both variables shows a 95% credible interval above 1, indicating that higher FEV1 variability and higher BMI variability are also associated with increased mortality. We also display the fitted values for two randomly selected individuals (with a similar age at last observation) in the dataset in Figure 4. The predicted survival curves are very different: the woman with better lung functionality and nutrition status shows a higher survival probability than the other woman across all the age range. Predictions for two random individuals in the dataset (left: Censored; right: Dead). Black line and dots are the observed data, while the red line is the model prediction and the red bands show the estimated variability. As an additional measure of predictive performance, we fitted another joint model using stan_jm in rstanarm to the same cohort of women (with results reported in the Supporting Information, Table S.5). Unlike the proposed JM‐WIV, the rstanarm implementation does not model within‐individual variability, and we observe smaller association terms with mean FEV1 and mean BMI compared with JM‐WIV. The analysis with the proposed JM‐WIV model took approximately 14.6 h, while the analysis with rstanarm took approximately 1.3 h (reported in the Supporting Information). Predictive performance results, reported in Table 5, show a higher expected log pointwise predictive density (ELPD) for the JM‐WIV, indicating superior out‐of‐sample predictive accuracy compared to the standard joint model. TABLE 5Leave‐one‐out cross‐validation results for the analysis study. ELPDloo SEJM‐WIV−41527.6557.5 rstanarm −48051.9729.8 Note: The table reports the mean expected log pointwise predictive density (ELPD) and its standard deviation. Higher ELPD values indicate better out‐of‐sample predictive performance. Leave‐one‐out cross‐validation results for the analysis study. Note: The table reports the mean expected log pointwise predictive density (ELPD) and its standard deviation. Higher ELPD values indicate better out‐of‐sample predictive performance. Discussion In this work, we proposed a joint model which allows the quantification of within‐individual variability in multivariate longitudinal data and its association with a time‐to‐event outcome. The proportional hazard model includes the association with the means and the within‐individual variabilities of the longitudinal biomarkers and the baseline hazard can be flexibly specified using penalized B‐splines. Our simulation study shows that when there is an association between the within‐individual variability and the event, neglecting the corresponding coefficients leads to bias and loss of coverage of the other coefficients in the time‐to‐event submodel. In the cystic fibrosis application, we have shown that both higher lung function and BMI within‐individual variability are associated with a higher risk of death, confirming and extending preliminary work [33]. One advantage of this model is the additive structure for each longitudinal biomarker, that is, the ability to accommodate changes over time, baseline covariates and random effects as in a generalized additive model. Due to the shared random effect structure, one can easily model the individual means and variabilities, as well as correlations between subject‐specific random effects. In addition, compared to the summary statistics often used in clinical settings, the use of random effects as subject‐specific deviations from the population variability retains a similar level of interpretability, as one could, for example, read a positive random effect in the variability submodel as a higher WIV than the population standard deviation, accounting at the same time for time and covariate effects. This Bayesian joint model makes better use of all information available in the dataset, as all observations contribute to the estimation of the population standard deviation, without the need to exclude individuals with few visits and introduce immortal time bias (although interpretation of within‐individual variability for individuals with very low sample size is to be taken with care). There are some limitations in the modeling strategy proposed here. As pointed out in a recent publication [34], the within‐individual variability is no longer distinguishable from the measurement error, therefore caution must be adopted if clinical knowledge indicates that the longitudinal biomarker might be measured with error (as the association would likely be biased towards the null due to the noise introduced by measurement error). Other quantifications of variability (e.g., based on the second derivative of the mean function [34, 35]) can nevertheless be integrated in the location‐scale model to characterize different aspects of variability. We leave this aspect for future work. Furthermore, while in theory the model can be extended to any number of longitudinal biomarkers, the estimation of the model might become difficult for a large number of random effects (as in most multivariate models with shared random effects). In our application we used only one random intercept for each parameter of the distribution, for a total of two random effects per biomarker. If one wants to include additional random effects over time (either as random slope or random effects for spline basis functions), or increase the number of biomarkers, the number of parameters in the model becomes large (as well as the parameters in the correlation matrix, which is specified to be unconstrained). We recommend to use a moderate number of biomarkers and, wherever possible, a parsimonious number of random effects (or constraints on the correlation structure). Alternatively, to reduce the computational burden one could explore a more parsimonious specification based on functional data [20], or develop alternative approaches for dimension reduction in multivariate longitudinal data analysis. The current version of the code (available on https://github.com/marcopalma3/JM‐WIV) can be also extended to include more flexibility, by including more than two outcomes, increase the number of random effects and introduce constraints on their correlation matrix. Other forms of association (as function of lagged predicted value, slope, area under the curve of the linear predictors and interactions [19]) or curvature‐based measures [35] could also be adapted for within‐individual variability, but they are not implemented in the current version and we leave them as further direction. In computational terms, our model has a higher number of parameters and is more demanding than the corresponding Stan model without within‐individual variability in rstanarm, although the overall variability in computation time between the two is comparable. More work should be done in order to improve the computation efficiency of the current implementation. The joint model structure presented here might also be developed in other directions. For the longitudinal submodel, the model proposed relies on the assumption that, although restricted to a normal distribution, modeling both the mean and the standard deviation gives enough flexibility to reconstruct the shape of the outcome distribution (and in the case of the cystic fibrosis application, the posterior predictive checks provide good indication). The assumption of normal distribution can be relaxed by using other distributions with more flexible parameterisation, for example, drawing from the work on generalized additive models for location, scale and shape [36]. The potential drawback is that the direct interpretation of the standard deviation parameter as within‐individual variability is not preserved in non‐normal settings. The definition of within‐individual variability in these cases (e.g., in discrete distributions) is still an open question which needs further investigation, given also the large availability of discrete biomarkers in biomedical applications (e.g., beta‐binomial model [37]). For the cystic fibrosis application, by comparing the results obtained with this model and those based on summary statistics, one could confirm the relevance of within‐individual variability in defining the hazard of an event [38]. While in the model proposed we kept the relationship between the longitudinal outcomes and age as linear, more complicated functional forms may be investigated in order to better characterize the relationship between mean and variability (this topic is of interest also from a methodological perspective—while analyzed in mixed‐effect location‐scale models [39], its consequences in joint models are less clear). In addition, the model could be further extended to address potential issues around informative censoring, by, for example, including a competing risk approach for the analysis of transplant information. Large interest is also in the effect of recently introduced medications (triple combination therapies, with promising results) on the within‐individual variability, by using a change‐point structure in the variability submodel. In this direction, the availability of CF registries with different structures (annual measurements in UK, monthly records in Denmark, irregular encounters in the USA) might require an adaptation of the model to efficiently model WIV and the relationship with potentially informative measurement schedule. In addition, the results of the analysis presented here open avenues for a better characterization of within‐individual variability in disease progression and dynamic risk prediction to assess the effective contribution of WIV in this setting (e.g., extending available models [40]). More work could be done to explore further clinical uses of within‐individual variability (e.g., consider whether it could be used for risk stratification). Furthermore, new approaches for efficient sequential WIV quantification in online data streaming (especially in electronic health data) need to be developed, in order to potentially introduce the use of these WIV approaches in clinical settings. Author Contributions Conceptualisation: all authors (equal contribution). Formal analysis: M.P. (lead contribution), O.E.M. (supporting contribution). Funding acquisition: J.K.B., G.M.‐T. (lead contribution), R.H.K., A.M.W. (supporting contribution). Methodology: M.P., J.K.B., G.M.‐T., R.H.K., A.M.W. (equal contribution). Software: M.P., O.E.M. (equal contribution). Supervision: J.K.B. Visualization: M.P. (lead contribution), O.E.M. (supporting contribution). Writing – original draft: M.P. Writing – review and editing: all authors (equal contribution). Funding This work was supported for M.P. by the UK Medical Research Council (MRC) grant “Looking beyond the mean: what within‐person variability can tell us about dementia, cardiovascular disease and cystic fibrosis” (MR/V020595/1). MP's research is currently supported by the Ulverscroft Vision Research Group (UCL). J.K.B. was supported through the UK Medical Research Council programme (grant MC_UU_00002/5) and Unit theme (grant MC_UU_00040/02—Precision Medicine) funding. R.H.K. was funded by UK Research and Innovation (Future Leaders Fellowship MR/X015017/1). RS was supported by the National Heart, Lung and Blood Institute of the National Institutes of Health (R01 HL141286) and Cystic Fibrosis Foundation (Naren19R0 and SZCZES22AB0). D.T.‐R. is supported by the NIHR on a Research Professorship (NIHR 302438). G.M.‐T. acknowledges the support of the Osteopathic Heritage Foundation through funding for the Osteopathic Heritage Foundation Ralph S. Licklider, D.O., Research Endowment in the Heritage College of Osteopathic Medicine. A.M.W. is supported by the BHF Data Science Centre (HDRUK2023.0239), Health Data Research UK (Big Data for Complex Disease‐HDR‐23012), and as an NIHR Research Professor (NIHR303137). This research was also supported by core funding from the British Heart Foundation (RG/F/23/110103), NIHR Cambridge Biomedical Research Centre (NIHR203312) [*], BHF Chair Award (CH/12/2/29428), Cambridge BHF Centre of Research Excellence (RE/24/130011), and by Health Data Research UK (HDRUK2023.0028), which is funded by the UK Medical Research Council, Engineering and Physical Sciences Research Council, Economic and Social Research Council, Department of Health and Social Care (England), Chief Scientist Office of the Scottish Government Health and Social Care Directorates, Health and Social Care Research and Development Division (Welsh Government), Public Health Agency (Northern Ireland), British Heart Foundation and the Wellcome Trust. *The views expressed are those of the authors and not necessarily those of the NIHR or the Department of Health and Social Care. For the purpose of open access, the authors have applied a Creative Commons Attribution (CC BY) license to any Author Accepted Manuscript version arising from this submission. Conflicts of Interest J.K.B. has received research funding for unrelated work from F. Hoffmann‐La Roche Ltd. Supporting information Data S1: Supplementary Information. Acknowledgments We thank the Cystic Fibrosis Epidemiological Network (CF‐EpiNet) Strategic Research Centre data group and Elaine Gunn for contributions to data preparation and cleaning. We thank people with cystic fibrosis and their families for consenting to their data being held in the UK CF Registry, and NHS teams in CF centres and clinics for the input of data into the Registry. The UK cystic fibrosis registry is supported and coordinated by the UK Cystic Fibrosis Trust. We thank the reviewers for their detailed and insightful feedback. Contributor Information Marco Palma, Email: marco.palma@mrc-bsu.cam.ac.uk. Jessica K. Barrett, Email: jessica.barrett@mrc-bsu.cam.ac.uk. Data Availability Statement This work used anonymised data from the UK Cystic Fibrosis Registry, which has research ethics approval (Research Ethics Committee reference number 07/Q0104/2). Use of the data was approved by the Registry Research Committee (data request 426). Data are available following application to the Registry Research Committee (www.cysticfibrosis.org.uk/the‐work‐we‐do/uk‐cf‐registry/apply‐for‐data‐from‐the‐uk‐cf‐registry). The R code is available at https://github.com/marcopalma3/JM‐WIV. References Associated Data Supplementary Materials Data S1: Supplementary Information. Data Availability Statement This work used anonymised data from the UK Cystic Fibrosis Registry, which has research ethics approval (Research Ethics Committee reference number 07/Q0104/2). Use of the data was approved by the Registry Research Committee (data request 426). Data are available following application to the Registry Research Committee (www.cysticfibrosis.org.uk/the‐work‐we‐do/uk‐cf‐registry/apply‐for‐data‐from‐the‐uk‐cf‐registry). The R code is available at https://github.com/marcopalma3/JM‐WIV.