{"id":249316,"date":"2026-07-07T12:12:30","date_gmt":"2026-07-07T16:12:30","guid":{"rendered":"https:\/\/ibkrcampus.com\/campus\/?p=249316"},"modified":"2026-07-07T12:14:38","modified_gmt":"2026-07-07T16:14:38","slug":"differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/","title":{"rendered":"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>The article &#8220;Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies&#8221; was originally posted on <a href=\"https:\/\/datageeek.com\/2026\/05\/05\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/\">DataGeeek<\/a> blog.<\/em><\/p>\n\n\n\n<h2 id=\"h-introduction\" class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Differential Machine Learning (DML), as introduced in the recent&nbsp;<strong><em><a href=\"https:\/\/arxiv.org\/html\/2603.07600v1\" target=\"_blank\" rel=\"noreferrer noopener\">arXiv paper (Differential Machine Learning for 0DTE Options with Stochastic Volatility and Jumps)<\/a><\/em><\/strong>, extends supervised learning by incorporating not only function values but also their derivatives. In financial contexts, this often means sensitivities such as Greeks. However, when direct derivatives are unavailable, we can approximate market dynamics using&nbsp;<strong>volatility indicators<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use&nbsp;<strong>RSI, MACD, and Bollinger Bands<\/strong>&nbsp;as proxies for volatility. These indicators capture momentum, trend strength, and price dispersion, providing a practical way to embed uncertainty into the learning process. To implement this, we design a&nbsp;<strong>twin-network architecture<\/strong>&nbsp;in Keras: one network learns price dynamics from time-based features, while the other learns volatility signals. Finally, we combine them via a stacking ensemble to achieve robust forecasts with confidence intervals.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Volatility Variables Instead of Derivatives?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>RSI (Relative Strength Index)<\/strong>: Measures momentum and overbought\/oversold conditions.<\/li>\n\n\n\n<li><strong>MACD (Moving Average Convergence Divergence)<\/strong>: Captures trend direction and strength.<\/li>\n\n\n\n<li><strong>Bollinger Bands (upper\/lower bands, %B)<\/strong>: Quantifies price dispersion and volatility.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These indicators act as empirical substitutes for theoretical derivatives. While DML in its pure form requires sensitivities, in practice, these volatility proxies provide similar information about how prices respond to market forces.<\/p>\n\n\n\n<h2 id=\"h-why-twin-networks\" class=\"wp-block-heading\">Why Twin Networks?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The idea is to separate the learning tasks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The&nbsp;<strong>primary network<\/strong>&nbsp;models the continuous component of the price process.<\/li>\n\n\n\n<li>The&nbsp;<strong>auxiliary network<\/strong>&nbsp;models the volatility\/jump component. Together, they mimic the decomposition found in stochastic models such as Bates or Heston, but implemented within a flexible neural framework.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-ensemble-via-stacking\" class=\"wp-block-heading\">Ensemble via Stacking<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once both networks are trained, their predictions are combined using a&nbsp;<strong>linear regression meta-model<\/strong>. This stacking ensemble learns the optimal weighting between the primary and auxiliary outputs. The result is a forecast that integrates both trend and volatility signals, significantly improving accuracy compared to either network alone.<\/p>\n\n\n\n<h2 id=\"h-evaluation\" class=\"wp-block-heading\">Evaluation<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1012\" height=\"353\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-1.png\" alt=\"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\" class=\"wp-image-249327 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-1.png 1012w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-1-700x244.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-1-300x105.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-1-768x268.png 768w\" data-sizes=\"(max-width: 1012px) 100vw, 1012px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1012px; aspect-ratio: 1012\/353;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Source: DataGeeek<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Metrics: RMSE and MAPE, computed with the&nbsp;<code><strong><em><a href=\"https:\/\/yardstick.tidymodels.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">yardstick<\/a><\/em><\/strong><\/code>&nbsp;package.<\/li>\n\n\n\n<li>Results:\n<ul class=\"wp-block-list\">\n<li>Individual networks \u2192 RMSE ~76,000, MAPE ~99%.<\/li>\n\n\n\n<li>Stacking ensemble \u2192 RMSE ~3,030, MAPE ~3.65.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This demonstrates the power of combining price and volatility signals in a unified framework.<\/p>\n\n\n\n<h2 id=\"h-confidence-intervals\" class=\"wp-block-heading\">Confidence Intervals<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To quantify uncertainty, we compute&nbsp;<strong>residual-based confidence intervals<\/strong>&nbsp;around the point forecasts:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"679\" height=\"66\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-residual-based-confidence-intervals.png\" alt=\"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\" class=\"wp-image-249330 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-residual-based-confidence-intervals.png 679w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-residual-based-confidence-intervals-300x29.png 300w\" data-sizes=\"(max-width: 679px) 100vw, 679px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 679px; aspect-ratio: 679\/66;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><math display=\"block\"><mrow><msub><mover accent=\"true\"><\/mover><\/msub><\/mrow><\/math><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This approach uses the standard deviation of training residuals to generate 95% confidence bands. It provides interpretable uncertainty estimates without requiring explicit probabilistic modeling.<\/p>\n\n\n\n<h2 id=\"h-visualization\" class=\"wp-block-heading\">Visualization<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The forecasts are visualized with&nbsp;<code>ggplot2<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Grey ribbon<\/strong>&nbsp;\u2192 confidence intervals.<\/li>\n\n\n\n<li><strong>Red line<\/strong>&nbsp;\u2192 stacking ensemble forecast.<\/li>\n\n\n\n<li><strong>Black line<\/strong>&nbsp;\u2192 actual BTC prices.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"766\" height=\"271\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-2.jpg\" alt=\"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\" class=\"wp-image-249334 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-2.jpg 766w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-2-700x248.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-2-300x106.jpg 300w\" data-sizes=\"(max-width: 766px) 100vw, 766px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 766px; aspect-ratio: 766\/271;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Source: DataGeeek<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This design clearly communicates both the central forecast and the uncertainty range. The chart you will include at the end of the blog shows exactly this: a red forecast line, black actuals, and a grey confidence band, illustrating how the ensemble integrates volatility information into predictive intervals.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"768\" height=\"446\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-3.jpg\" alt=\"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\" class=\"wp-image-249338 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-3.jpg 768w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-3-700x407.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-3-300x174.jpg 300w\" data-sizes=\"(max-width: 768px) 100vw, 768px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 768px; aspect-ratio: 768\/446;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Source: Yahoo Finance<\/p>\n\n\n\n<h2 id=\"h-keras3-in-r-flexible-deep-learning-for-financial-forecasting\" class=\"wp-block-heading\">Keras3 in R: Flexible Deep Learning for Financial Forecasting<\/h2>\n\n\n\n<h2 id=\"h-what-is-keras3\" class=\"wp-block-heading\">What is Keras3?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em><a href=\"https:\/\/keras3.posit.co\/\" target=\"_blank\" rel=\"noreferrer noopener\">Keras3<\/a><\/em><\/strong>&nbsp;is the modern R interface to the Keras deep learning library, built on top of TensorFlow. It allows R users to define, train, and evaluate neural networks with concise syntax while leveraging TensorFlow\u2019s computational power. Unlike earlier versions, Keras3 is fully aligned with TensorFlow 2.x, ensuring long-term support and compatibility.<\/p>\n\n\n\n<h2 id=\"h-how-we-used-keras3\" class=\"wp-block-heading\">How We Used Keras3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In our workflow, Keras3 was the backbone for implementing the&nbsp;<strong>twin-network architecture<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"768\" height=\"472\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-4.jpg\" alt=\"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\" class=\"wp-image-249345 lazyload\" style=\"--smush-placeholder-width: 768px; aspect-ratio: 768\/472;width:768px;height:auto\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-4.jpg 768w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-4-700x430.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2026\/07\/DataGeeek-Differential-Machine-Learning-4-300x184.jpg 300w\" data-sizes=\"(max-width: 768px) 100vw, 768px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Source: DataGeeek<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why ReLU?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ReLU (Rectified Linear Unit)<\/strong>&nbsp;is the activation function used in hidden layers.<\/li>\n\n\n\n<li>Formula:&nbsp;<math><mrow><mtext>ReLU<\/mtext><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>max<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>0<\/mn><mo separator=\"true\">,<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><\/math>.<\/li>\n\n\n\n<li>Benefits:\n<ul class=\"wp-block-list\">\n<li>Introduces non-linearity, enabling the network to learn complex relationships.<\/li>\n\n\n\n<li>Efficient and helps avoid vanishing gradients.<\/li>\n\n\n\n<li>Well-suited for financial data where signals can be sparse and directional.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-why-adam\" class=\"wp-block-heading\">Why Adam?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Adam (Adaptive Moment Estimation)<\/strong>&nbsp;is the optimizer chosen.<\/li>\n\n\n\n<li>Combines&nbsp;<strong>momentum<\/strong>&nbsp;(using past gradients to accelerate learning) and&nbsp;<strong>adaptive learning rates<\/strong>&nbsp;(adjusting step sizes per parameter).<\/li>\n\n\n\n<li>Benefits:\n<ul class=\"wp-block-list\">\n<li>Robust for noisy, non-stationary data like cryptocurrency prices.<\/li>\n\n\n\n<li>Requires minimal tuning, making it ideal for plug-and-play workflows.<\/li>\n\n\n\n<li>Widely adopted in both academic and applied machine learning.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-contribution-to-the-r-ecosystem\" class=\"wp-block-heading\">Contribution to the R Ecosystem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Keras3 bridges the gap between R\u2019s&nbsp;<strong>tidyverse\/tidymodels ecosystem<\/strong>&nbsp;and modern deep learning:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Integrates seamlessly with data preprocessing pipelines (<code>recipes<\/code>,&nbsp;<code>timetk<\/code>).<\/li>\n\n\n\n<li>Allows financial analysts and data scientists to stay within R while accessing TensorFlow\u2019s deep learning capabilities.<\/li>\n\n\n\n<li>Encourages reproducibility: models can be defined, trained, and evaluated entirely in R, without switching to Python.<\/li>\n\n\n\n<li>Expands R\u2019s role beyond traditional statistical modeling into&nbsp;<strong>state-of-the-art AI applications<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-why-it-matters-for-dml\" class=\"wp-block-heading\">Why It Matters for DML<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By using Keras3:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We could&nbsp;<strong>separate learning tasks<\/strong>&nbsp;into a primary network (trend\/seasonality) and an auxiliary network (volatility\/momentum).<\/li>\n\n\n\n<li>Both networks were trained with ReLU activations and Adam optimization, ensuring stability and efficiency.<\/li>\n\n\n\n<li>Their outputs were combined in a stacking ensemble, yielding forecasts that integrate both price dynamics and volatility signals.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This demonstrates how Keras3 empowers R users to implement advanced architectures like twin networks, making Differential Machine Learning concepts practical in financial forecasting.<\/p>\n\n\n\n<h2 id=\"h-conclusion\" class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This case study demonstrates how Differential Machine Learning concepts can be adapted for financial forecasting in R:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Volatility indicators serve as practical substitutes for derivatives.<\/li>\n\n\n\n<li>Twin-network architecture in Keras captures both trend and volatility.<\/li>\n\n\n\n<li>Stacking ensembles significantly improves predictive performance.<\/li>\n\n\n\n<li>Residual-based confidence intervals provide interpretable uncertainty estimates.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By combining academic ideas with reproducible R workflows, we can build robust forecasting pipelines that bridge theory and practice.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.<\/p>\n","protected":false},"author":1729,"featured_media":81246,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[339,343,338,341,342],"tags":[21866,632,21860,4676,21863,2105,21857,20779,2533,21861,187,985,21867,21865,445,21862,21574,1045,21625,21858,20185,21859,21864],"contributors-categories":[21034],"class_list":["post-249316","post","type-post","status-publish","format-standard","has-post-thumbnail","category-data-science","category-programing-languages","category-ibkr-quant-news","category-quant-development","category-r-development","tag-adam-adaptive-moment-estimation","tag-ai","tag-bitcoin-forecasting","tag-bollinger-bands","tag-confidence-intervals","tag-deep-learning","tag-differential-machine-learning","tag-financial-forecasting","tag-ggplot2","tag-keras3","tag-macd","tag-r-programming","tag-recipes-package","tag-relu-rectified-linear-unit","tag-rsi","tag-stacking-ensemble","tag-tidymodels","tag-tidyverse","tag-timetk-package","tag-twin-networks","tag-volatility-indicators","tag-volatility-proxies","tag-yardstick-package","contributors-categories-datageeek"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v28.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies<\/title>\n<meta name=\"description\" content=\"In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/249316\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\" \/>\n<meta property=\"og:description\" content=\"In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-07T16:12:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-07T16:14:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Selcuk Disci\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Selcuk Disci\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Selcuk Disci\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/7dbe9bd8161c35e2855152a7a652dbb7\"\n\t            },\n\t            \"headline\": \"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies\",\n\t            \"datePublished\": \"2026-07-07T16:12:30+00:00\",\n\t            \"dateModified\": \"2026-07-07T16:14:38+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/\"\n\t            },\n\t            \"wordCount\": 923,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/connect-code-abstract.jpg\",\n\t            \"keywords\": [\n\t                \"Adam (Adaptive Moment Estimation)\",\n\t                \"AI\",\n\t                \"Bitcoin forecasting\",\n\t                \"Bollinger Bands\",\n\t                \"confidence intervals\",\n\t                \"Deep Learning\",\n\t                \"Differential Machine Learning\",\n\t                \"Financial Forecasting\",\n\t                \"ggplot2\",\n\t                \"Keras3\",\n\t                \"MACD\",\n\t                \"R Programming\",\n\t                \"recipes package\",\n\t                \"ReLU (Rectified Linear Unit)\",\n\t                \"rsi\",\n\t                \"stacking ensemble\",\n\t                \"tidymodels\",\n\t                \"tidyverse\",\n\t                \"timetk package\",\n\t                \"twin networks\",\n\t                \"Volatility Indicators\",\n\t                \"volatility proxies\",\n\t                \"yardstick package\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/\",\n\t            \"name\": \"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/connect-code-abstract.jpg\",\n\t            \"datePublished\": \"2026-07-07T16:12:30+00:00\",\n\t            \"dateModified\": \"2026-07-07T16:14:38+00:00\",\n\t            \"description\": \"In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/connect-code-abstract.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/connect-code-abstract.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/7dbe9bd8161c35e2855152a7a652dbb7\",\n\t            \"name\": \"Selcuk Disci\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/selcukdisci\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies","description":"In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/249316\/","og_locale":"en_US","og_type":"article","og_title":"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies","og_description":"In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/","og_site_name":"IBKR Campus US","article_published_time":"2026-07-07T16:12:30+00:00","article_modified_time":"2026-07-07T16:14:38+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg","type":"image\/jpeg"}],"author":"Selcuk Disci","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Selcuk Disci","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/#article","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/"},"author":{"name":"Selcuk Disci","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/7dbe9bd8161c35e2855152a7a652dbb7"},"headline":"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies","datePublished":"2026-07-07T16:12:30+00:00","dateModified":"2026-07-07T16:14:38+00:00","mainEntityOfPage":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/"},"wordCount":923,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg","keywords":["Adam (Adaptive Moment Estimation)","AI","Bitcoin forecasting","Bollinger Bands","confidence intervals","Deep Learning","Differential Machine Learning","Financial Forecasting","ggplot2","Keras3","MACD","R Programming","recipes package","ReLU (Rectified Linear Unit)","rsi","stacking ensemble","tidymodels","tidyverse","timetk package","twin networks","Volatility Indicators","volatility proxies","yardstick package"],"articleSection":["Data Science","Programming Languages","Quant","Quant Development","R Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/","url":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/","name":"Differential Machine Learning with Twin Networks in R: Forecasting Bitcoin with Volatility Proxies | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/#primaryimage"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg","datePublished":"2026-07-07T16:12:30+00:00","dateModified":"2026-07-07T16:14:38+00:00","description":"In this project, we adapt DML to Bitcoin price forecasting. Instead of derivatives, we use RSI, MACD, and Bollinger Bands as proxies for volatility.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/differential-machine-learning-with-twin-networks-in-r-forecasting-bitcoin-with-volatility-proxies\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg","width":1000,"height":563,"caption":"Quant"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/7dbe9bd8161c35e2855152a7a652dbb7","name":"Selcuk Disci","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/selcukdisci\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/connect-code-abstract.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/249316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/1729"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=249316"}],"version-history":[{"count":33,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/249316\/revisions"}],"predecessor-version":[{"id":249401,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/249316\/revisions\/249401"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/81246"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=249316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=249316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=249316"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=249316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}