SearcharxivSearch

arXiv subjects

Henrik Bengtsson

Publications and source records attributed to Henrik Bengtsson.

9 recordsLinked to original sources

A Unified Approach to Concurrent, Parallel Map-Reduce in R using Futures

The R ecosystem offers a rich variety of map-reduce application programming interfaces (APIs) for iterative computations, yet parallelizing code across these diverse frameworks requires learning multiple, often incompatible, parallel APIs. The futurize package addresses this challenge by providing a single function, futurize(), which transpiles sequential map-reduce expressions into their parallel equivalents in the future ecosystem, which performs all the heavy lifting. By leveraging R's native pipe operator, users can parallelize existing code with minimal refactoring -- often by simply appending `|> futurize()' to an expression. The package supports classical map-reduce functions from base R, purrr, crossmap, foreach, plyr, BiocParallel, e.g., lapply(xs, fcn) |> futurize() and map(xs, fcn) |> futurize(), as well as a growing set of domain-specific packages, e.g., boot, caret, glmnet, lme4, mgcv, and tm. By abstracting away the underlying parallel machinery, and unifying handling of future options, the package enables developers to declare what to parallelize via futurize(), and end-users to choose how via plan(). This article describes the philosophy, design, and implementation of futurize, demonstrates its usage across various map-reduce paradigms, and discusses its role in simplifying parallel computing in R.

cs.DC

The Slepian model based independent interval approximation of persistency and zero-level excursion distributions

In physics and engineering literature, the distribution of the excursion time of a stationary Gaussian process has been approximated through a method based on a stationary switch process with independently distributed switching times. The approach matches the covariance of the clipped Gaussian process with that of the stationary switch process. By expressing the switching time distribution as a function of the covariance, the so-called independent interval approximation (IIA) is obtained for the excursions of Gaussian processes. This approach has successfully approximated the persistency coefficient for many vital processes in physics but left an unanswered question about when such an approach leads to a mathematically meaningful and proper excursion distribution. Here, we propose an alternative approximation: the Slepian-based IIA. This approach matches the expected values of the clipped Slepian process and the corresponding switch process initiated at the origin. It is shown that these two approaches are equivalent, and thus, the original question of the mathematical validity of the IIA method can be rephrased using the Slepian model setup. We show that this approach leads to valid approximations of the excursion distribution for a large subclass of the Gaussian processes with monotonic covariance. Within this class, the approximated excursion time distribution has a stochastic representation that connects directly to the covariance of the underlying Gaussian process. This representation is then used to approximate the persistency coefficient for several important processes to illustrate the Slepian-based IIA approach. Lastly, we argue that the ordinary IIA is ill-suited in certain situations, such as for Gaussian processes with a non-monotonic covariance.

math.PR

Characteristics of asymmetric switch processes with independent switching times

The asymmetric switch process is a binary stochastic process that alternates between the values one and minus one, where the distributions of the time in these states may differ. Two versions of the process are considered: a non-stationary version that starts with a switch at time zero and a stationary one constructed from the non-stationary one. Characteristics of these two processes, such as the expected values and covariance, are investigated. The main results show an equivalence between the monotonicity of the expected value functions and the distribution of the intervals having a stochastic representation in the form of a sum of random variables, where the number of terms follows a geometric distribution. This representation has a natural interpretation as a model in which switching attempts may fail at random. From these results, conditions are derived when these characteristics lead to valid interval distributions, which is vital in applications.

math.PR

Slepian model based independent interval approximation for the level excursion distributions

The independent interval approximation of the excursion time distributions for Gaussian processes has been used in physics and engineering. A new but related approach matches the expected value of the clipped Slepian to the expected value of a non-stationary binary stochastic process. This approach is extended to non-zero crossings and provides a probabilistic foundation for the validity of the approximations for a large class of processes. Both the above and below distributions are approximated. While the Slepian-based method was shown to be equivalent to the classical IIA for the zero-level, this is not the case for non-zero excursions.

math.PR

Intermittent Control for Safe Long-Acting Insulin Intensification for Type 2 Diabetes: In-Silico Experiment

Around a third of type 2 diabetes patients (T2D) are escalated to basal insulin injections. Basal insulin dose is titrated to achieve a tight glycemic target without undue hypoglycemic risk. In the standard of care (SoC), titration is based on intermittent fasting blood glucose (FBG) measurements. Lack of adherence and the day-to-day variabilities in FBG measurements are limiting factors to the existing insulin titration procedure. We propose an adaptive receding horizon control strategy where a glucose-insulin fasting model is identified and used to predict the optimal basal insulin dose. This algorithm is evaluated in \textit{in-silico} experiments using the new UVA virtual lab (UVlab) and a set of T2D avatars matched to clinical data (NCT01336023). Compared to SoC, we show that this control strategy can achieve the same glucose targets faster (as soon as week 8) and safer (increased hypoglycemia protection and robustness to missing FBG measurements). Specifically, when insulin is titrated daily, a time-in-range (TIR, 70--180 mg/dL) of 71.4$\pm$20.0\% can be achieved at week eight and maintained at week 52 (72.6$\pm$19.6%) without an increased hypoglycemia risk as measured by time under 70 mg/dL (TBR, week 8: 1.3$\pm$1.9% and week 52: 1.2$\pm$1.9%), when compared to the SoC (TIR at week 8: 59.3$\pm$28.0% and week:52 72.1$\pm$22.3%, TBR at week 8: 0.5$\pm$1.3% and week 52: 2.8$\pm$3.4%). Such an approach can potentially reduce treatment inertia and prescription complexity, resulting in improved glycemic outcomes for T2D using basal insulin injections.

eess.SY

Estimating a Personalized Basal Insulin Dose from Short-Term Closed-Loop Data in Type 2 Diabetes

In type 2 diabetes (T2D) treatment, finding a safe and effective basal insulin dose is a challenge. The dose-response is highly individual and to ensure safety, people with T2D titrate by slowly increasing the daily insulin dose to meet treatment targets. This titration can take months. To ease and accelerate the process, we use short-term artificial pancreas (AP) treatment tailored for initial titration and apply it as a diagnostic tool. Specifically, we present a method to automatically estimate a personalized daily dose of basal insulin from closed-loop data collected with an AP. Based on AP-data from a stochastic simulation model, we employ the continuous-discrete extended Kalman filter and a maximum likelihood approach to estimate parameters in a simple dose-response model for 100 virtual people. With the identified model, we compute a daily dose of basal insulin to meet treatment targets for each individual. We test the personalized dose and evaluate the treatment outcomes against clinical reference values. In the tested simulation setup, the proposed method is feasible. However, more extensive tests will reveal whether it can be deemed safe for clinical implementation.

eess.SY

Characteristics of the switch process and geometric divisibility

The switch process alternates independently between 1 and -1, with the first switch to 1 occurring at the origin. The expected value function of this process is defined uniquely by the distribution of switching times. The relation between the two is implicitly described through the Laplace transform, which is difficult to use for determining if a given function is the expected value function of some switch process. We derive an explicit relation under the assumption of monotonicity of the expected value function. It is shown that geometric divisible switching time distributions correspond to a non-negative decreasing expected value function. Moreover, an explicit relation between the switching time distribution and the autocovariance function of the switch process stationary counterpart is obtained, which allows parallel results for the stationary switch process and its covariance function. These results are applicable to approximation methods in statistical physics, and an example is presented.

math.PR

A Unifying Framework for Parallel and Distributed Processing in R using Futures

A future is a programming construct designed for concurrent and asynchronous evaluation of code, making it particularly useful for parallel processing. The future package implements the Future API for programming with futures in R. This minimal API provides sufficient constructs for implementing parallel versions of well-established, high-level map-reduce APIs. The future ecosystem supports exception handling, output and condition relaying, parallel random number generation, and automatic identification of globals lowering the threshold to parallelize code. The Future API bridges parallel frontends with parallel backends following the philosophy that end-users are the ones who choose the parallel backend while the developer focuses on what to parallelize. A variety of backends exist and third-party contributions meeting the specifications, which ensure that the same code works on all backends, are automatically supported. The future framework solves several problems not addressed by other parallel frameworks in R.

cs.DC

Short Term Blood Glucose Prediction based on Continuous Glucose Monitoring Data

Continuous Glucose Monitoring (CGM) has enabled important opportunities for diabetes management. This study explores the use of CGM data as input for digital decision support tools. We investigate how Recurrent Neural Networks (RNNs) can be used for Short Term Blood Glucose (STBG) prediction and compare the RNNs to conventional time-series forecasting using Autoregressive Integrated Moving Average (ARIMA). A prediction horizon up to 90 min into the future is considered. In this context, we evaluate both population-based and patient-specific RNNs and contrast them to patient-specific ARIMA models and a simple baseline predicting future observations as the last observed. We find that the population-based RNN model is the best performing model across the considered prediction horizons without the need of patient-specific data. This demonstrates the potential of RNNs for STBG prediction in diabetes patients towards detecting/mitigating severe events in the STBG, in particular hypoglycemic events. However, further studies are needed in regards to the robustness and practical use of the investigated STBG prediction models.

eess.SP