{'fraction_non_alphanumeric': 0.03465222823823407, 'fraction_numerical': 0.016597251145356103, 'mean_word_length': 4.329744728079911, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On Prediction and Tolerance Intervals for Dynamic Treatment Regimes

We develop and evaluate tolerance interval methods for dynamic treatment regimes (DTRs) that can provide more detailed prognostic information to patients who will follow an estimated optimal regime. Although the problem of constructing confidence intervals for DTRs has been extensively studied, prediction and tolerance intervals have received little attention. We begin by reviewing in detail different interval estimation and prediction methods and then adapting them to the DTR setting. We illustrate some of the challenges associated with tolerance interval estimation stemming from the fact that we do not typically have data that were generated from the estimated optimal regime. We give an extensive empirical evaluation of the methods and discussed several practical aspects of method choice, and we present an example application using data from a clinical trial. Finally, we discuss future directions within this important emerging area of DTR research.


Introduction
Dynamic Treatment Regimes (DTRs), also known as adaptive treatment strategies or treatment policies, are a key tool for providing data-driven sequential decision-making support. A DTR is a sequence of decision functions that take up-to-date patient information as input and produce a recommended treatment. Thus, a DTR is a mathematical representation of the sequential decision-making process. Using this representation, we can use previously collected decision-making data to estimate an "optimal" DTR, where optimality is most often defined in terms of expected outcome. That is, a DTR is optimal if it produces the best outcome, on average, over a patient population. We will use this definition of optimality throughout our work.
Each decision in an optimal DTR is made in the service of achieving maximal expected outcome. However, the outcome of any particular individual under an optimal regime may vary widely from this expectation. Indeed, DTRs have been applied in many very challenging areas of medicine, including psychiatry, cancer, and HIV, where patient outcomes are known to be highly variable, or, equivalently from our perspective, difficult to predict.
It is with this variability in mind that we consider different methods for assessing the variability in individual outcomes under a given DTR. Our objective is to quantify for the decision-maker not our certainty about the expectation of outcomes, but rather our uncertainty about what the observed outcome might be for a particular patient.
We begin by formally defining DTRs, and we review point and interval estimation techniques for relevant parameters of the optimal DTR. We then review definitions and existing methods for confidence intervals, 1 prediction intervals, and tolerance intervals. Following this background, we formally describe our problem of interest in the context of using DTRs to provide decision support.
We will see that the main technical challenge associated with constructing tolerance intervals for DTRs stems from not having a sample drawn from the correct distribution. Thus, our methods will use re-weighting and re-sampling to allow us to apply existing tolerance interval methods in this setting. To help illustrate the technical challenge, we first describe a naïve strategy for constructing tolerance intervals whose performance is poor, and we then present two novel strategies for constructing valid tolerance intervals for the response under a given dynamic treatment regime. We present an empirical evaluation of the methods, and we conclude by discussing their implications and directions for future work.

Background
In the following, we review basic concepts pertaining to DTRs, the estimation of optimal regimes, and concepts and issues surrounding interval estimation and prediction.

Dynamic Treatment Regimes
DTRs are a mathematical formalism meant to capture the decision-making cycle of information gathering, followed by treatment choice, followed by outcome evaluation. They have been defined at different levels of generality by many authors [Schulte et al., 2014, Laber et al., 2014b,a, Lizotte et al., 2012, Nahum-Shani et al., 2012a,b, Lizotte et al., 2010, Shortreed et al., 2011. Here, we focus on regimes with two decision points; thus for this work we consider a DTR to be a sequence of two functions (π 1 , π 2 ) which map up-to-date patient information at the first and second decision points, respectively, to distributions over the space of available treatments at each decision point. We represent the information (covariates) about a given patient at point t by s t , which we view as a realization of a random variable S t . Similarly, we denote the chosen treatment (action) by a t , which is a realization of A t . For a patient who follows a DTR (π 1 , π 2 ), we will have A 1 ∼ π 1 (s 1 ) and A 2 ∼ π 2 (s 1 , a 1 , s 2 ). We let y be the observed outcome or reward attained by a patient after following a regime, and we follow the convention that larger values of y are preferable. For a patient following a given regime, we observe (s 1 , a 1 , s 2 , a 2 , y), the trajectory for that patient.
Trajectory data may come from various observational and experimental sources, for example from Sequential Multiple Assignment Randomized Trials (SMARTs) [Nahum-Shani et al., 2012a,b, Collins et al., 2014. A SMART is an experimental design under which patients follow a DTR that applies randomly assigned treatments. We will call such a DTR an exploration DTR or exploration policy. The goal of running a SMART is analogous to that of running a pragmatic randomized controlled trial-to evaluate the comparative effectiveness of different treatment options in an unbiased way. This comparative effectiveness information can then be used to estimate an optimal DTR. An optimal DTR is a pair of decision functions (π 1 , π 2 ) that maximize E[Y |S 1 , A 1 , S 2 , A 2 ; π 1 , π 2 ] where A t ∼ π t (S t ). Thus, an optimal DTR produces maximal expected outcome when applied to a population of patients. In this work, we focus on the setting where the exploration DTR is stochastic, but the candidate optimal DTRs under consideration are deterministic.

Q-learning
Several methods are available for estimating an optimal DTR from data collected under an exploration DTR. Here, we review one such method called Q-learning [Schulte et al., 2014, Huang et al., 2015. Q-learning works by estimating Q functions (Q for "quality") that predict expected outcome given current covariates and treatment choice. In our 2-decision point setting, we have Note that unlike the expectation in the previous section which averages over patients, Q 2 gives the expectation of Y conditioned on particular patient observations and treatment choices. The definition of Q 2 implies an optimal decision function π * 2 (s 1 , a 1 , s 2 ) = arg max a 2 Q 2 (s 1 , a 1 , s 2 , a 2 ). Q 2 can be estimated using any 2 regression method. Having obtained an estimateQ 2 of Q 2 , our estimate of the optimal second decision function isπ * 2 (s 1 , a 1 , s 2 ) = arg max a 2Q 2 (s 1 , a 1 , s 2 , a 2 ). The optimal Q-function for the first decision point produces the conditional mean of Y given S 1 and A 1 and given that the optimal decision function π * 2 is used at the second decision point. In Q-learning, we estimate Q 1 byQ where the expectation is over S 2 conditioned on S 1 and A 1 . The quantity max a 2Q 2 (s 1 , a 1 , S 2 , a 2 ) is sometimes called the pseudooutcome, and is denotedỹ. In order to estimate Q 1 , we compute the pseudooutcome for each trajectory in our dataset, and then regress them on S 1 and A 1 to estimate Q 1 . Again, any regression method can be used to estimate Q 1 , in principle. Our corresponding estimate of the optimal first decision function is thenπ * 1 (s 1 ) = arg max a 1Q 1 (s 1 , a 1 ), and our estimate of the optimal DTR is (π * 1 ,π * 2 ). Note that this DTR is deterministic.

Interval Estimation
For consistency, in the following we use ys to represent observed outcomes, and xs to represent covariates, even in non-regression settings.

Confidence Intervals
A confidence interval ( c , u c ) with level 1 − α for a parameter θ is a functional of a dataset Y = {y 1 , ..., y n } of realizations of a random variable Y , with the property that (1) The probability statement (1) is over datasets containing i.i.d. samples of Y . The goal of a confidence interval is to provide confidence information about the estimated location of an underlying distributional parameter.
Though not our main focus, confidence intervals are by far the most well-known class of interval estimates, and they are closely related to the prediction and tolerance intervals we will develop and investigate.

Prediction Intervals
A prediction interval ( p , u p ) with level 1 − α is a functional of a dataset Y = {y 1 , ..., y n } of realizations of a random variable Y , with the property that Here, Y new represents a single future observation that was not contained in the original data Y. The goal of a prediction interval is to provide confidence information about where this new observation might fall. However, we note, as others have [Vardeman, 1992], that there is often confusion surrounding the probability statement (2). In particular, the statement is over the joint distribution of Y 1 , ..., Y n , Y new . A prediction interval formed from a dataset traps one additional observation with probability 1−α. It offers no guarantees about trapping more than one additional observation, and indeed no guarantees regarding our confidence in the content of an interval, that is, of the quantity (For example, a prediction interval that has content 1.0 half the time and content 0.9 half the time has property (2) for α = 0.05, as does an interval that always has content 0.95.) The well-known normal-theory prediction interval for Y [Neter, John and Wasserman, William and Kutner, 1989] is given by whereȳ is the sample mean,σ Y the sample standard deviation, and t α/2;n−1 is the α/2 quantile of a tdistribution with n − 1 degrees of freedom. Note that the validity of (3) is predicated on normality of Y , regardless of sample size. The corresponding prediction interval for Y |X=x in the linear regression setting on p parameters is where x represents the location of a new sample,ŷ is the prediction of E[Y |X=x],σ Y |X=x is the sample standard deviation of the residuals, X is the design matrix for the regression, and t α/2;n−p is the α/2 quantile of a t-distribution with n − p degrees of freedom. Equation (4) is predicated on the normality of Y |X = x and on homoscedasticity of the residuals.

Tolerance Intervals
A tolerance interval ( t , u t ) with level 1 − α and content γ is also a functional of a dataset Y = {y 1 , ..., y n }.
It has the property that where F Y is the cumulative distribution function of Y . Thus, a tolerance interval formed from a dataset traps at least γ of the probability content of Y with probability 1 − α, where the 1 − α probability is over datasets.
One well-known normal theory approximate tolerance interval for Y with confidence 1 − α and content γ is given by Krishnamoorthy, Kalimuthu and Mathew [2009] as whereȳ is the sample mean, χ 2 γ;1,1/n is the γ quantile of a non-central χ 2 distribution with 1 degree of freedom and noncentrality parameter 1/n, and χ 2 α;n−1 is the α quantile of a χ 2 with n − 1 degrees of freedom. The corresponding tolerance interval for Y |X=x in the linear regression setting on p parameters is [Young, 2013] ( t , u t ) N =ŷ ∓σ Y |X=x (n − p)χ 2 γ;1,1/n * χ 2 α;n−p whereŷ is the prediction of E[Y |X=x],σ Y |X=x is the sample standard deviation of the residuals, n * = σ 2 Y |X=x /σ 2 y is Wallis' "effective number of observations" (1951), andσŷ is the standard error ofŷ|X=x. Again, validity of (6) and (7) is predicated on the normality of Y and Y |X=x, respectively; (7) is also predicated on homoscedasticity. Wilks [1941] proposed a non-parametric tolerance interval that assumes only continuity of F Y . The interval is given by the sample values corresponding to the minimum and maximum ranks r for which where F Beta is the beta cumulative distribution function. Thus, the interval is constructed simply by truncating the sample to the ranks satisfying (8), and then taking the minimum and maximum of the truncated sample to be the lower and upper limits of the tolerance interval, respectively.

DTRs for Decision Support
DTRs are an ideal formalism for providing data-driven decision support. The most basic approach to providing decision support would be to estimate an optimal DTR from SMART data, and then provide the estimated DTR (π * 1 ,π * 2 ) to a decision maker, perhaps as a computer-based tool that produces the estimated optimal treatment by using current patient information as input to the previously estimated DTR.
Early in the development of DTRs it was recognized that this approach is problematic because it provides no confidence information about our recommendations. Just as we would not recommend one treatment over another if no statistically significant difference were obtained from a standard randomized controlled trial (RCT), neither should we recommend a single treatment in a DTR if in fact the alternatives are not known to be inferior with high confidence. This led to the development of confidence interval methods for the difference in mean expected outcome under different treatment choices within a regime [Chakraborty et al., 2010, 2013, Chakraborty and Moodie, 2013, Laber et al., 2014b, Chakraborty et al., 2014.
Such intervals can give us confidence that if we do recommend a single treatment, that treatment will provide a better outcome, in expectation over patients. However, they do not provide any information about what the range of possible outcomes might actually be for an individual patient. In particular, large SMARTs with 100s to 1000s of patients may discover statistically significant differences in mean outcome even when the effect sizes are small to moderate and variance in outcomes is still substantial. If this is the case, it may be better to avoid recommending a single treatment, or at least to provide more nuanced information about what the patient's experience is likely to be under the different treatment options.
In this work, we consider tolerance intervals as one method for providing this information. For a patient with S 1 = s 1 at the first decision point, rather than recommending treatmentπ * 1 (s 1 ) (even if it is statistically significantly better than the alternative in terms of mean outcome) we would present tolerance intervals for the outcome Y under each possible action, and allow the decision-maker (or the patient-clinician dyad, in the context of patient-centred care [Barry and Edgman-Levitan, 2012]) to decide on treatment based on the range of probable outcomes indicated by the intervals. For each interval, we condition on the observed s 1 , the hypothetical a 1 , and the estimated optimal regimeπ * 2 for the second stage. Thus, we will construct tolerance intervals for Y |S 1 = s 1 , A 1 = a 1 ; π 2 =π * 2 , marginal over S 2 (whose distribution is governed by S 1 and A 1 ) and A 2 (whose distribution is governed by A 1 , S 1 , S 2 and π 2 .) To do so, we will adapt several standard methods because typically we do not have observations drawn from this distribution. This is because, as we noted above, data from SMART studies and similar sources are generated according to an exploration DTR (π 0 1 , π 0 2 ), rather than according to an estimated optimal DTR (π * 1 ,π * 2 ).

Aside: Non-regularity
It is well-known that many kinds of inference on the parameters of an estimated optimal dynamic treatment regime, including confidence intervals, are plagued by issues of non-regularity [Laber et al., 2014b]. Briefly, non-regularity is a result of the sampling distributions of corresponding estimators changing abruptly as a function of the true underlying parameters. It can lead to bias in estimates and anti-conservatism in inference. In dynamic treatment regimes, non-regularity occurs and inference is problematic when two or more treatments produce (nearly) the same mean optimal outcome. In this work, we will not specifically develop methods that are robust to non-regularity. This is because even in the absence of non-regularity, i.e. when optimal Q values are well-separated from sub-optimal ones, there is significant variability in the performance of "standard" tolerance interval methods that is worthy of exploration and analysis. We will return to this point in the Discussion.

Methods
We now detail our strategies for constructing tolerance intervals for Y |S 1 =s 1 , A 1 =a 1 ; π 2 =π * 2 . As we mentioned above, the fundamental challenge of constructing intervals for this quantity is that in general we do not have samples drawn from this distribution-otherwise, we could use off-the-shelf tolerance interval methods. Note that we can use off-the-shelf methods for tolerance intervals for Y |S 2 =s 2 , A 2 =a 2 , because there is no need to account for future decision-making in that case; thus our work focuses on the first decision point. We begin by presenting a naïve approach to constructing tolerance intervals that helps illustrate the main technical challenge to be addressed, and then we present our two proposed strategies: inverse probability weighting, and residual borrowing.

Naïve Q-Learning Tolerance Intervals
Standard Q-learning involves estimating Q 1 (s 1 , a 1 ), which predicts the expected Y under the optimal regime. However, it does so using the pseudooutcomeỸ = max a 2Q 2 (s 1 , a 1 , s 2 , a 2 ) as the regression target, rather than the observed Y . Since the pseudooutcome targets are themselves predicted conditional means of Y , they carry no variance information about Y |S 2 , S 1 , A 1 under the estimated optimal policy, even among trajectories that (by chance) followed the estimated optimal policy. To see this, suppose that we had several trajectories, all of which had the same s 1 , a 1 , s 2 , a 2 , and all of whom happened to follow the estimated optimal policy. Even though their observed outcomes y might have all been different, simply due to unexplained (but still important) variation in Y , they would all be assigned the same pseudooutcome value, and the sample variance of the pseudooutcomes in this group is zero.
This observation highlights the key aspect of Q-learning and related methods that precludes direct estimation of variability in Y . Dynamic programming methods for estimating conditional means of sequential outcomes can "throw away" residual variance without negative repercussions when backing up values, essentially because of the law of total expectation. The benefit of this approach is a reduction in the variance of Q estimates by allowing the use of the entire dataset of trajectories for estimating Q-functions for earlier decision points. The drawback is that such methods cannot directly estimate other distributional properties of Y , including variance and higher-order moments, quantiles, and so on.
If most of the variability in Y were explained by S 2 and A 2 -that is, if the variance of Y |S 2 , A 2 were nearly zero-we might be able to construct approximate tolerance intervals for Y by constructing parametric tolerance intervals for the pseudooutcome, for example using (7). In the case of a saturated model with discrete S 1 and A 1 , we could construct non-parametric tolerance intervals for each pattern of (s 1 , a 1 ) using the pseudooutcome with (8). However, as expected, will see in our empirical results that this approach is not very effective if in fact the variance of Y |S 2 , A 2 is not near zero.

Inverse Probability Weighting
One approach to obtaining variance information about Y underπ * 2 is to select from our dataset only those trajectories whose second-stage treatment matches whatπ * 2 would have assigned, i.e., the trajectories (s 1 , a 1 , s 2 , a 2 , y) for which a 2 =π * 2 (s 1 , a 1 , s 2 ). This subset contains all of the trajectories that have positive probability under the estimated DTR.
Consider a joint distribution over S 2 , A 2 , Π, A 0 2 , A * 2 , M, Y conditioned on S 1 and A 1 . (All statements in the remainder of this subsection are implicitly conditioned on S 1 and A 1 ; explicitly maintaining this is too cumbersome.) Here, A 0 2 is the action chosen by π 0 2 , and A * 2 is the action chosen byπ * 2 , which is assumed to be deterministic given S 2 . Let M (for match 1 ) be 1 if A * 2 = A 0 2 , or 0 otherwise. Let Π be binary, and define The dependencies among all of these variables are illustrated in Figure 1 using a directed graphical model [Koller and Friedman, 2009].
The distribution of Y among matched trajectories is governed by We describe this phenomenon using the following lemma.
Note that the structure is the same for all values of S 1 and A 1 .
Proof. In the following, we abuse notation by allowing Pr to represent a probability or a density, as appropriate, and we allow to indicate a sum or an integral. The message in any case remains the same. First we note that The data generating distribution underπ * 2 is where the last step follows from conditional independence of Y and (Π, M ) given S 2 and A 2 . Furthermore, where the second step follows because A * 2 is deterministic given S 2 2 and from the definition of Π and M , and the third step follows from independence of S 2 and Π. By combining (10) and (11) and comparing with (9), we obtain where the final step is by independence of S 2 and Π.
Proof. Follows immediately from Lemma 1.
To achieve independence of S 2 and M , we could ensure during data collection that A 0 2 is independent of S 2 , which in turn can be achieved by equal randomization independent of S 2 . This is common, but not universal, in SMART designs [Collins et al., 2014].
Dependence of M on S 2 is problematic because of the effect of S 2 on Y . When M depends on S 2 , conditioning on M can affect the distribution of Y through S 2 , meaning that the distribution of Y |S 1 , A 1 , Π=0, M =1 we estimate by collecting data under π 0 2 is not what we would have obtained had we collected data underπ * 2 and ignored (i.e. marginalized over) M . To correct the problem of the distribution of S 2 |S 1 , A 1 among the matched trajectories, we employ inverse probability weighting. To do so, we construct a propensity score model, not for the probability of treatment, but for the probability of following the estimated optimal DTR, i.e. Pr(M =1|S 2 , S 1 , A 1 ). Using this model, we can then re-weight the trajectories so that the distribution of S 2 |M =1, S 1 , A 1 matches the distribution of S 2 |S 1 , A 1 as well as possible. The weight function is therefore These are sometimes known as importance weights. We note that in causal inference, importance weights are sometimes used to adjust for an association between the probability of receiving treatment and the observed outcome. Here, they are used to adjust for an association between the probability of following the estimated optimal policy and the observed outcome through the variable S 2 . Note that estimating the two densities in (12) separately is not necessary to estimate the function w; it can be estimated using any density ratio estimation method. Logistic regression is one common approach but many others are available. In related weighting methods for causal inference, practitioners have found that a flexible model for w is often preferable to a simpler one [Ghosh, 2011].
To use the weighted data for building tolerance intervals, we must adapt existing methods for use with the weights. To build normal-theory regression tolerance intervals using the weighted data, we first estimate y|X=x using weighted least squares. We then use the resulting mean estimate, together with a weight-based sandwich estimate ofσŷ to construct the tolerance interval as per (7). To build non-parametric tolerance intervals, we obtain weighted estimates of the ranks obtained by linear interpolation of the weighted empirical distribution [Harrell et al., 2015]. We then construct the Wilks interval as per (8). Figure 2 shows the empirical results of applying weighted tolerance intervals in a simple scenario. Our goal here is to verify that the weighting scheme can counteract some of the dependence on M . (We will evaluate them more fully in the next section.) The data are drawn from a two-variable generative model with M ∼ Bernoulli(0.5) and Y |M =m ∼ N (µ m , σ m ). Our goal is to produce a tolerance interval for Y , marginal over M , using only data for which M =1. The sample size for M = 1 was n = 500, and the weights were computed analytically. Parameters for Y |M =0 were fixed at µ 0 = 0 and σ 0 = 1. Parameters for Y |M =1 were varied to illustrate how performance of the weighted tolerance intervals changed as the distribution of Y |M =1 deviated from the marginal distribution of Y . The top row of heatmaps shows the coverage of each method, that is, the proportion of times out of 1000 Monte Carlo replicates for which the computed tolerance interval had at least γ = 0.9 probability content. The confidence level 1 − α was set to 0.95; in the plot, Monte Carlo coverages that are not statistically significantly different from 0.95 are coloured pure white. Over-coverage is coloured blue, and under-coverage is coloured orange. The second row plots the average width of the tolerance intervals, normalized by the width of the optimal tolerance interval constructed from the true quantiles of Y , with unit relative width coloured white.
Methods beginning with U are unweighted, and methods beginning with W are weighted. Methods containing NP are nonparametric, and those without NP are normal-theory. (Table 1 gives the complete key to the method names.) Note that except when µ 1 = 0 and σ 1 = 1, Y is nonnormal. As one would expect, performance when µ 1 = 0, σ 1 = 1 is very good across all methods; in this case, Pr(Y |M = 1) = Pr(Y ), and weighting is not needed. When µ 1 is near zero and/or σ 2 is larger than σ 0 , most of the mass of Pr(Y |M = 1) overlaps the mass of Pr(Y ), and all intervals tend to over-cover. This is indicated by the blue regions in the upper-left corner of the coverage plots, and is larger in the weighed methods than the unweighted Weighted Normal-theory TI methods. Conversely, when Pr(Y |M = 1) does adequately overlap the mass of Pr(Y ) because µ 1 is farther from 0 and/or σ 1 is less than σ 0 , we see undercoverage indicated by the orange in the lower-right of the plots. Again, this is mitigated by weighting. The non-parametric methods provide better coverage than the normal-theory methods; this is not surprising since Y is not normal in most cases. The width plots verify that the weighted methods bring the extreme widths observed from the unweighted methods closer to optimal. This example verifies that the weighted methods we propose can substantially reduce over-and undercoverage in cases where there is mismatch between the observed distribution and the distribution of interest. However, they cannot eliminate it entirely when the distributions of Y and Y |M =1 are very different. This is to be expected; estimating say the mean of one distribution using an importance-weighted sample is challenging in practice. Estimating the tails of that distribution is even more challenging. Nonetheless, there is value in the weighted approach, and we will explore it further in the DTR setting in the next section.

Residual Borrowing
We now present a different approach to ensuring that our analysis captures the joint distribution Y, S 2 |S 1 , A 1 correctly, and hence captures variability in Y |S 1 , A 1 correctly when we marginalize over S 2 . To do so, we return to the Q-learning approach, which estimates E[Y |S 2 , A 2 ] using regression. As discussed above, the pseudooutcomeỹ for each trajectory represents our best estimate of E[Y |S 1 =s 1 , A 1 =a 1 , S 2 =s 2 , A 2 ] when A 2 ∼ π * 2 (s 1 , a 1 , s 2 ). This estimate is available for all trajectories in our dataset, including those for which M =1. Rather than naïvely constructing tolerance intervals based on the regression ofỸ on S 1 and A 1 , we create a new pseudooutcomey for each point: For trajectories with m=1, we sety = y. For trajectories with m = 0, we sety =ỹ + , where ∼ E, and E is an estimate of the distribution of the residuals among trajectories with M = 1. We call this procedure residual borrowing. We then construct tolerance intervals using the regression ofy on S 1 and A 1 .
Unlike theỹ, they retain information about the distribution of Y |S 2 , A 2 . Furthermore, since we use all of the trajectories in our original dataset, our empirical distribution of S 2 |S 1 , A 1 is representative of the true generative model. The distribution E could be the empirical distribution of the appropriate residuals, or it could be a smoothed estimate, e.g., a kernel density estimate. In our simulations, we found that a smoothed estimate works better than sampling from the empirical distribution.

Empirical Results
We now present results of six tolerance interval methods, which are listed in Table 1, using a simulation study. Our goals are to: 1. verify that inverse probability weighted methods can succeed where the unweighted methods fail, and test their limits; and, 2. to assess the difference in performance between the inverse probability weighted methods and the residual borrowing methods. Note that we do not include results from the naïve method as it performs very poorly.
The generative model from the study is taken from Schulte et al. [2014], with modifications. We begin by reviewing that model and discussing our modifications to it; we then present and discuss the performance of our methods.
Our parameter ξ φ allows us to control the degree to which state information influences treatment selection under the exploration (data-gathering) DTR. For ξ φ = 1, we have the original exploration used by Schulte et al., and for ξ φ = 0, we have uniform randomization over treatments independent of state and previous treatment. ξ ψ allows us to control the effect of treatment A 2 on Y . For ξ ψ = 1 we have the treatment effect specified by Schulte et al., and for ξ ψ = 0 we have no treatment effect at the second stage. Ydist allows us to control the shape of the error distribution to see its effect on the tolerance interval methods; Schulte et al. used a normal error, but we will explore heavier and lighter-tailed errors while holding variance constant.
This family of generative models allows us to explore what happens to the performance of tolerance interval methods when we have dependence of S 2 on A 2 during the generating process. While most of the SMART studies we are aware of use a simple randomization strategy where the distribution of A 2 does not depend on S 2 (which is the case here when e.g. ξ φ = 0, giving a simple 50:50 randomization strategy), we expect that more studies akin to "adaptive trials" with state-dependent randomization will become attractive in the future.
3 Denoted m by Schulte et al.

Tolerance Intervals
In many studies of DTR methods, the focus is on point and interval estimates of the optimal stage 1 decision parameters [Chakraborty et al., 2010, 2013, Chakraborty and Moodie, 2013, Laber et al., 2014b, Chakraborty et al., 2014. In this work, we will investigate methods for constructing tolerance intervals for Note that our goal is to construct tolerance intervals for Y under the estimated optimal regime rather than under the optimal regime. The reason for this is pragmatic: we assume that it is the estimated optimal regime that would be deployed in future to support decision-making. We begin by estimatingπ * 2 using the working models (13,14). We then compute the pseudooutcomeỹ i for each trajectory, and the match indicator m i = I{π * 2 (s 1i , a 1i , s 2i ) = a 2i }.

Unweighted Methods
To construct the unweighted normal-theory TIs, we regress y on s 1 and a 1 according to working model (15) but using only trajectories with m = 1. We then apply (7) to construct the four tolerance intervals.
To construct the unweighted nonparametric TIs, we divide the trajectories with m = 1 into four mutually exclusive groups according to their (s 1 , a 1 ) values. We then construct the four tolerance intervals by applying the Wilks method (8) to each group.

Weighted Methods
To construct the weights, we first form kernel density estimatesf E (s 2 ; a 1 , a 1 , m=1) for S 2 |S 1 =s 1 , A 1 =a 1 , M =1 andf E (s 2 ; s 1 , a 1 ) for S 2 |S 1 =s 1 , A 1 =a 1 . The weight for a trajectory with index i that has m = 1 is then given by While logistic regression might be viewed as a more obvious choice for this task, we found that its attendant monotonicity assumptions were often violated, and that the pair of kernel density estimates were the simplest way to produce a more flexible model in this low-dimensional setting.
To construct the weighted normal-theory TIs, as above we compute a weighted regression of y on s 1 and a 1 according to working model (15) but using only trajectories with m = 1. We then apply (7) to construct the four tolerance intervals; in this case, we use the sandwich estimate [Huber, 1967, White, 1980 with the weights to computeσ Y |X=x . This makes the method somewhat more robust.
To construct the unweighted nonparametric TIs, we divide the trajectories with m = 1 into four mutually exclusive groups according to their (s 1 , a 1 ) values. We then construct the four tolerance intervals by applying our weighted modification of the Wilks method (8) to each group.

Residual Borrowing
For the residual borrowing methods, within each (s 1 , a 1 ) group, we first form a kernel density estimatê f R (r; s 1 , a 1 ) using the residuals y i −ỹ i among the trajectories with m = 1. We then sety i = y i for each trajectory with m i = 1, and sampley i from the kernel density estimate for trajectories with m i = 0. We then either regressy i using the working models to create the regression tolerance intervals, or we again divide up the data according to s 1 and a 1 to construct non-parametric tolerance intervals.

Results
Using the foregoing generative model, working models, and tolerance interval methods, we ran a suite of simulations to investigate performance. Experiments varied by ξ φ , ξ ψ , σ 2 ε , and Ydist, for a total of 1, 089 different experimental settings. Both ξ φ and ξ ψ were varied from 0 to 1 in 0.1 increments, and σ 2 ε took values in {10, 1, 0.1}. We examined settings with Ydist as normal, uniform, and t with 3 degrees of freedom, each scaled to have the appropriate σ 2 ε . For each setting, we drew 1000 simulated datasets each of size n = 1000, computed tolerance intervals using each of the six methods, and evaluated their content, that is, what proportion of Y was captured by each interval, and their relative width, given by (u t − t )/h * , where h * is the width of the optimal tolerance interval computed using the γ/2 and 1 − γ/2 quantiles of the true distribution. For all experiments, we set 1 − α = 0.95 and γ = 0.9. All kernel density estimates were one-dimensional, and used the default optimal bandwidth. All experimental code was written in R [R Core Team, 2015], and is publicly available. Figures 5, 6, and 7 display the results of all of our experiments as heatmaps using the same approach as Figure 2. Monte Carlo coverages that are not statistically significantly different from 0.95 are coloured pure white, Over-coverage is coloured blue, and under-coverage is coloured orange. The second row of each subplot gives the average width of the tolerance intervals. Figure 5a contains the original model setting proposed by Schulte et al. [2014] in the upper-right corners of its heatmaps. In this setting, the weighted and unweighted normal-theory tolerance intervals undercover slightly, while the weighted and unweighted non-parametric methods overcover, and are much wider. The residual-borrowing methods perform best in this setting, with the normal-theory residual-borrowing intervals achieving near-nominal coverage with modest width. There is relatively little variation in coverage and width across ξ φ and ξ ψ in this setting, we believe because the noise level is quite high relative to the effect of a 2 even when ξ ψ = 1. In Figure 5b, Ydist was chosen to be a t-distribution with 3 degrees of freedom, scaled to have variance σ 2 ε = 10 and shifted by µ Y . In this heavy-tailed setting, it is the non-parametric residual-borrowing method that slightly undercovers, while the other methods overcover somewhat. As in the normal case, the weighted and unweighted nonparametric methods are very wide. Figure 5c uses a scaled and shifted uniform distribution for Ydist, again maintaining σ 2 ε = 10. In this light-tailed setting, in contrast to Figure 5b, it is the normal-theory intervals which tend to be wide, while the non-parametric ones are narrower. The residual-borrowing intervals are wide as well. All intervals achieve nominal or greater coverage in this setting.
We see a striking change as we examine the lower-noise settings in Figure 6, which have σ 2 ε = 1. Here, we start to see dependence of performance on ξ ψ and ξ φ . As in Figure 5a, in Figure 6a we see the normal theory intervals undercovering, although we now see a definite trend that worsens as ξ φ increases, and as  Figure 3: Bias in the estimated value of the optimal policy. This is a surrogate measure of non-regularity; note that maximal bias occurs when ψ, which controls the effect of A 2 , is small. Phi Factor (ξ φ in the text) controls the effect of covariates on the exploration DTR, and Psi Factor (ξ ψ in the text) controls the effect of A 2 on the conditional mean of Y . 14 ξ ψ decreases. We also see this trend among the non-parametric methods, which range from overcovering to undercovering as we move across ξ φ and ξ ψ . Overall, we see the greatest coverage when the effect of A 2 is quite strong (topmost rows), or if the dependence of A 0 2 on S 2 is weak (leftmost rows.) As we discussed earlier, when ξ φ = 0 (leftmost columns) there is no dependence of M on S2, and thus weighting is unnecessary. Furthermore, we not only obtain a uniform probability of M = 1 across S 2 , but also a uniform probability of A 0 2 across S 2 . This uniformity likely leads to improved estimates of Y |S 2 , A 2 , and in turn to better coverage of the tolerance intervals. The decrease in performance for low ξ ψ may be due to non-regularity: when ξ ψ = 0, there is in fact no effect of A 2 on Y . However, assuming continuity of the appropriate distributions, our estimatedψ 2 will be nonzero almost always, and our plug-in estimate of the value ofπ * 2 will be positive almost always. Definingâ * 2i =π * 2 (s 1i , a 1i , s 2i ), the empirical bias in the value ofπ * 2 is iâ * 2i (ψ 20 +ψ 21 a 1i +ψ 22 s 2i )−â * 2i ξ ψ (ψ 0 20 + ψ 0 21 a 1i + ψ 0 22 s 2i ). Figure 3 shows the average empirical bias in our estimate of the average value of usingπ * 2 , as a function of ξ φ and ξ ψ . We can see that the bias is concentrated at the bottom of the plots, near ξ ψ = 0. This is precisely where there is more than one nearly-optimal action and non-regularity is known to be a problem.
We see the problems worsen in Figure 7, where we set σ 2 = 0.1. We hypothesise that this is because proportionately even more of the variability in Y is attributable to variability in S 2 , and accurate estimation of Y |S 2 , A 2 becomes that much more important. All of the matched subset methods have severe undercoverage for large values of φ and low values of ψ. Weighted methods mitigate this. The residual-borrowing methods achieve much better coverage, but at the cost of much wider intervals.

Discussion
Based on our simulation study experiments, we believe that designing the exploration DTR to have uniform randomization over actions is highly beneficial for estimating tolerance intervals. When this is the case, all methods gave reasonable results in almost all scenarios. Some knowledge of the error distribution may help choose a method that will result in reasonable widths. If uniform exploration is not possible, the residualborrowing methods appear to be the most robust to undercoverage, followed by the weighted methods, followed by the unweighted methods. That said, it would be prudent to perform a simulation study under a scenario "close" to the analysis at hand if possible; to facilitate this we have released our R code [R Core Team, 2015] so that researchers and practitioners can explore other scenarios.
6 Example: STAR*D We present an example of the application of the TI methods we have described to real-world clinical trial data. The Sequenced Treatment Alternatives to Relieve Depression (STAR*D) study followed an initial population of 4041 patients as they were treated using different antidepressant medications and cognitive behavioural therapy [Rush et al., 2004]. There were a total of three decision points at which randomisation took place, with different treatment options available at each one. Outcomes were measured using the clinician-rated Quick Inventory of Depressive Symptomatology [Rush et al., 2003]. We will examine two such decision points corresponding to Level 2 and Level 3 of the study, which will correspond to the first and second decision points in our analysis.
We construct tolerance intervals for STAR*D at Level 2 (our decision point 1), having estimated a Q function and estimated optimal policy for Level 3 (our decision point 2.) We use exactly the same Q-learning working model and estimation procedure as Schulte et al. [2014] to developπ * 2 and the pseudooutcomes; we refer the interested reader to their work for more details. In summary, the state variables we use are up-todate QIDS measures of patient symptoms, and the outcomes we use are based on later QIDS measurements that have been negated so that higher values are preferable. At decision point 1, we elect to use a binary state  Figure 4: Tolerance intervals for STAR*D at Level 2. The six TI methods used previously are applied to the data, using the choice to switch or augment treatment as A 1 , and letting S 1 be an indicator variable for previous QIDS slope being greater than the median. In this setting, higher outcomes are preferable, but higher QIDS scores (and slopes) indicate worse symptoms.
variable indicating whether the previous slope in QIDS score for a patient is greater than the median. Higher QIDS scores indicate worse symptom levels, so this state variable effectively identifies patients whose disease status is worsening most quickly. At both decision points, the treatment choice is whether to "augment" the current medication with another, or to "switch" to another medication altogether. We applied the six TI methods described previously to the data, using the choice to switch or augment treatment as A 1 , and letting S 1 be an indicator variable for QIDS slope being greater than the median slope. We see that generally the intervals are quite wide, and that there is severe overlap of TIs for different treatments. This reflects the high variance and low treatment effect we observe in this data. However, the intervals do capture prognostic information: the intervals for S 1 = "Yes" (indicating severely worsening symptoms) are wider, with a decreased lower bound indicating that such patients may have poorer outcomes relative to those with more stable symptoms prior to the decision point. The maximum attainable outcome in this problem is 0, since QIDS cannot go below 0. We note that the parametric TI methods can produce upper bounds greater than 0 and lower bounds that appear to be a bit optimistic. Hence, we suggest that one of the non-parametric methods would be a sensible choice for STAR*D.

Conclusion
We have developed and evaluated tolerance interval methods for dynamic treatment regimes that can provide more detailed prognostic information to patients who will follow an estimated optimal regime. We began by reviewing in detail different interval estimation and prediction methods and then adapting them to the DTR setting. We illustrated some of the challenges associated with tolerance interval estimation stemming from the fact that we do not typically have data that were generated from the estimated optimal regime. We gave an extensive empirical evaluation of the methods and discussed several practical aspects of method choice. We demonstrated the methods using data from a pragmatic clinical trial. We now take the opportunity to discuss future directions of research on tolerance intervals for dynamic treatment regimes.

Future Directions
Our work lays the foundation for extending tolerance interval methods for dynamic treatment regimes in several different directions.
The normal theory TI methods we employed used an estimate of the residual distribution that is pooled over S 1 and A 1 . The non-parametric methods estimated the residual distributions separately for the different discrete S 1 , A 1 . A compromise solution that partially shares residual information across different configurations of (S 1 , A 1 ), perhaps in a data-driven, adaptive fashion, may provide improved performance and wider applicability. (Note that the non-parametric methods we described are not applicable if S 1 is continuous.) We have treated DTRs with two decision points, but in general we would like to have tolerance intervals for multiple decision points. Such methods would potentially have to address uncertainty stemming from "parameter sharing," across time points. It is known [Chakraborty et al., 2016] that the effects of model misspecification and non-regularity can compound in the multiple decision point setting, and the impact of this on tolerance intervals is not yet known.
While we assumed a single outcome measure Y throughout our work, several methods have been described for estimating DTRs in the presence of multiple outcomes [Lizotte et al., 2012, Laber et al., 2014a, Lizotte and Laber, 2015. Joint tolerance intervals/tolerance regions for this setting would be equally important as they are in the standard, single-outcome setting.
We observed some problems associated with biased estimates of the value of the estimated policy, which is caused by non-regularity. The problem of non-regularity in optimal DTR estimation has been addressed in the confidence interval setting using different approaches, including pre-testing [Laber et al., 2014b] and shrinkage [Chakraborty et al., 2010. We have not explicitly incorporated either of these ideas in the methods we presented; doing so may lead to methods that are more robust to small or zero treatment effects at the second stage yet do not pay a high cost in terms of width.
Fernholz and Gillespie [2001] have presented a method to re-calibrate tolerance intervals using the bootstrap. They propose a bootstrap method to estimate the content γ of a given tolerance interval-first they construct a tolerance interval with nominal (or "requested") content γ, but then they use the bootstrap to estimate what the actual content. This could potentially be used to identify when tolerance methods fail on dynamic treatment regimes, or they may be used simply to give more accurate confidence information to the decision maker. For example, we may attempt to construct a tolerance interval for γ = 0.9, but if it turns out that the actual content is 0.85, the interval may still be useful if the decision-maker is made aware of this fact. Future work to adapt the calibration procedure could prove promising.
Finally, a Bayesian approach to the predictive estimation problem may prove fruitful in some settings. Saarela et al. [2015] have laid groundwork for this direction of research.