{"id":95046,"date":"2021-07-15T11:26:03","date_gmt":"2021-07-15T15:26:03","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=95046"},"modified":"2023-02-28T10:11:22","modified_gmt":"2023-02-28T15:11:22","slug":"time-series-classification-synthetic-vs-real-financial-time-series-part-x","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/","title":{"rendered":"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X"},"content":{"rendered":"\n<p><em>Learn which R packages and data sets you need<\/em>&nbsp;<em>by reviewing<\/em>&nbsp;<em><a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series\/\">Part I<\/a>,&nbsp;<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-ii\/\">Part II<\/a>&nbsp;,<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-iii\/\">Part III<\/a><\/em>,<em>&nbsp;<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-iv\/\">Part IV,<\/a>&nbsp;<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-v\/\">Part V<\/a>&nbsp;,&nbsp;<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-vi\/\">Part VI<\/a>,&nbsp;<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-vii\/\">Part VII<\/a><\/em>,<em>&nbsp;<a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-viii\/\">Part VIII<\/a>&nbsp;and <a href=\"\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-ix\/\">Part IX<\/a> of this series.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-plug-the-optimal-parameters-into-the-model\">Plug the optimal parameters into the model.<\/h2>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">#################################################################################\n################# XGBoost Optimal Parameters from Cross Validation ##############<br><br>\n\n# This is the final training model where I use the most optimal parameters found over the grid space and plug them in here.<br><br>\n\nwatchlist &lt;- list(&#8220;train&#8221; = dtrain)<br><br>\n\nparams &lt;- list(&#8220;eta&#8221; = 0.1, &#8220;max_depth&#8221; = 5, &#8220;colsample_bytree&#8221; = 1, &#8220;min_child_weight&#8221; = 1, &#8220;subsample&#8221;= 1,\n               <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;objective&#8221;=&#8221;binary:logistic&#8221;, &#8220;gamma&#8221; = 1, &#8220;lambda&#8221; = 1, &#8220;alpha&#8221; = 0, &#8220;max_delta_step&#8221; = 0,\n               <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;colsample_bylevel&#8221; = 1, &#8220;eval_metric&#8221;= &#8220;auc&#8221;,\n               <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;set.seed&#8221; = 176)<br><br>\n\nnround &lt;- 95<\/p>\n\n\n\n<p>Now that I have the optimal parameters from the cross validation grid search I can train the final XGBoost model on the whole&nbsp;<code>train_val.csv<\/code>&nbsp;data set. (Whereas before the optimal parameters were obtained from different&nbsp;<em>folds<\/em>&nbsp;in the model. More info on k-fold cross validation&nbsp;<a href=\"https:\/\/machinelearningmastery.com\/k-fold-cross-validation\/\">here<\/a>)<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\n# Train the XGBoost model<br><br>\n\nxgb.model &lt;- xgb.train(params, dtrain, nround, watchlist)\n<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\n## [1]  train-auc:0.700790 <br>\n## [2]  train-auc:0.720114 <br>\n## [3]  train-auc:0.735281 <br>\n## [4]  train-auc:0.741159 <br>\n## [5]  train-auc:0.748016 <br>\n## [6]  train-auc:0.752070 <br>\n## [7]  train-auc:0.754637 <br>\n## [8]  train-auc:0.759151 <br>\n## [9]  train-auc:0.762538 <br>\n## [10] train-auc:0.769652 <br>\n## [11] train-auc:0.776582 <br>\n## [12] train-auc:0.780015 <br>\n## [13] train-auc:0.782065 <br>\n## [14] train-auc:0.782815 <br>\n## [15] train-auc:0.788966 <br>\n## [16] train-auc:0.791026 <br>\n## [17] train-auc:0.793545 <br>\n## [18] train-auc:0.797363 <br>\n## [19] train-auc:0.799069 <br>\n## [20] train-auc:0.802015 <br>\n## [21] train-auc:0.802583 <br>\n## [22] train-auc:0.806938 <br>\n## [23] train-auc:0.808239 <br>\n## [24] train-auc:0.811255 <br>\n## [25] train-auc:0.813142 <br>\n## [26] train-auc:0.816767 <br>\n## [27] train-auc:0.817697 <br>\n## [28] train-auc:0.820239 <br>\n## [29] train-auc:0.821589 <br>\n## [30] train-auc:0.823343 <br>\n## [31] train-auc:0.823939 <br>\n## [32] train-auc:0.825701 <br>\n## [33] train-auc:0.827316 <br>\n## [34] train-auc:0.829365 <br>\n## [35] train-auc:0.832646 <br>\n## [36] train-auc:0.833297 <br>\n## [37] train-auc:0.837006 <br>\n## [38] train-auc:0.838857 <br>\n## [39] train-auc:0.839923 <br>\n## [40] train-auc:0.842968 <br>\n## [41] train-auc:0.844877 <br>\n## [42] train-auc:0.845940 <br>\n## [43] train-auc:0.846583 <br>\n## [44] train-auc:0.847330 <br>\n## [45] train-auc:0.848292 <br>\n## [46] train-auc:0.850215 <br>\n## [47] train-auc:0.851641 <br>\n## [48] train-auc:0.852670 <br>\n## [49] train-auc:0.854706 <br>\n## [50] train-auc:0.855752 <br>\n## [51] train-auc:0.856772 <br>\n## [52] train-auc:0.857806 <br>\n## [53] train-auc:0.860245 <br>\n## [54] train-auc:0.861337 <br>\n## [55] train-auc:0.864178 <br>\n## [56] train-auc:0.865290 <br>\n## [57] train-auc:0.865808 <br>\n## [58] train-auc:0.866386 <br>\n## [59] train-auc:0.867751 <br>\n## [60] train-auc:0.870032 <br>\n## [61] train-auc:0.870500 <br>\n## [62] train-auc:0.872442 <br>\n## [63] train-auc:0.873391 <br>\n## [64] train-auc:0.875188 <br>\n## [65] train-auc:0.877767 <br>\n## [66] train-auc:0.879196 <br>\n## [67] train-auc:0.880079 <br>\n## [68] train-auc:0.879969 <br>\n## [69] train-auc:0.880638 <br>\n## [70] train-auc:0.881389 <br>\n## [71] train-auc:0.882066 <br>\n## [72] train-auc:0.882515 <br>\n## [73] train-auc:0.883854 <br>\n## [74] train-auc:0.884654 <br>\n## [75] train-auc:0.885104 <br>\n## [76] train-auc:0.885922 <br>\n## [77] train-auc:0.887100 <br>\n## [78] train-auc:0.888646 <br>\n## [79] train-auc:0.889833 <br>\n## [80] train-auc:0.890387 <br>\n## [81] train-auc:0.891815 <br>\n## [82] train-auc:0.892281 <br>\n## [83] train-auc:0.894417 <br>\n## [84] train-auc:0.895006 <br>\n## [85] train-auc:0.897079 <br>\n## [86] train-auc:0.899254 <br>\n## [87] train-auc:0.901114 <br>\n## [88] train-auc:0.902460 <br>\n## [89] train-auc:0.902939 <br>\n## [90] train-auc:0.903763 <br>\n## [91] train-auc:0.903792 <br>\n## [92] train-auc:0.904433 <br>\n## [93] train-auc:0.904986 <br>\n## [94] train-auc:0.907339 <br>\n## [95] train-auc:0.907761\n<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\n# Note: Plot AUC on for the in-sample train \/ validation scores &#8211;  this was a note for me at the time of writing this R file &#8211; I never did get around to plotting the AUC for the in-sample train \/ validation scores&#8230;\n<\/p>\n\n\n\n<p>What is nice about tree based models is that we can obtain&nbsp;<em>importance<\/em>&nbsp;scores from the model and find which variables contributed most to the&nbsp;<em>gain<\/em>&nbsp;in the model. The original paper explains more about the&nbsp;<em>gain<\/em>&nbsp;in&nbsp;<em>Algorithm 1<\/em>&nbsp;and&nbsp;<em>Algorithm 3<\/em>&nbsp;<a href=\"https:\/\/arxiv.org\/pdf\/1603.02754.pdf\">here<\/a>.<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\n# We can obtain &#8220;feature&#8221; importance results from the model.<br>\nxgb.imp <- xgb.importance(model = xgb.model)<br>\nxgb.plot.importance(xgb.imp, top_n = 10)\n<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1100\" height=\"786\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2021\/07\/matthew-smit-r-7-15-1100x786.png\" alt=\"Time Series Classification Synthetic vs Real Financial Time Series\" class=\"wp-image-95065 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/07\/matthew-smit-r-7-15-1100x786.png 1100w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/07\/matthew-smit-r-7-15-700x500.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/07\/matthew-smit-r-7-15-300x214.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/07\/matthew-smit-r-7-15-768x549.png 768w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/07\/matthew-smit-r-7-15.png 1344w\" data-sizes=\"(max-width: 1100px) 100vw, 1100px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1100px; aspect-ratio: 1100\/786;\" \/><\/figure>\n\n\n\n<p>That is, the XGBoost model found that the&nbsp;<code>spike<\/code>&nbsp;was the most important variable. The&nbsp;<code>spike<\/code>&nbsp;comes from the&nbsp;<code>stl_features<\/code>&nbsp;function of the&nbsp;<code>tsfeatures<\/code>&nbsp;package in&nbsp;<code>R<\/code>. It computes various measures of trend and seasonality based on Seasonal and Trend Decomposition (STL) and measures the&nbsp;<code>spikiness<\/code>&nbsp;of a time series based on the variance of the leave-one-out variances of component&nbsp;<code>e_t<\/code>.<\/p>\n\n\n\n<p>The second variable is interesting also and comes from the&nbsp;<code>compengine feature set<\/code>&nbsp;from the&nbsp;<a href=\"https:\/\/www.comp-engine.org\/\">CompEngine<\/a>&nbsp;database. It groups variables as&nbsp;<em>autocorrelation<\/em>,&nbsp;<em>prediction<\/em>,&nbsp;<em>stationarity<\/em>,&nbsp;<em>distribution<\/em>&nbsp;and&nbsp;<em>scaling<\/em>.<\/p>\n\n\n\n<p>The&nbsp;<code>ARCH.LM<\/code>&nbsp;comes from the&nbsp;<code>arch_stat<\/code>&nbsp;function of the&nbsp;<code>tsfeatures<\/code>&nbsp;package and is based on the Lagrange Multiplier for Autoregressive Conditional Heteroscedasticity (ARCH)&nbsp;<a href=\"https:\/\/www.jstor.org\/stable\/1912773?origin=crossref&amp;seq=1#page_scan_tab_contents\">Engle 1982<\/a>.<\/p>\n\n\n\n<p>These are just a few of the variables the XGBoost model found to be the most&nbsp;<em>important<\/em>. A full overview and more information of the variables used in the model can be found&nbsp;<a href=\"https:\/\/cran.r-project.org\/web\/packages\/tsfeatures\/vignettes\/tsfeatures.html\">here<\/a>.<\/p>\n\n\n\n<p><em>Visit&nbsp;Matthew Smith \u2013 R Blog&nbsp;to download the complete R code and see additional details featured in this tutorial:&nbsp;<a href=\"https:\/\/lf0.com\/post\/synth-real-time-series\/financial-time-series\/\">https:\/\/lf0.com\/post\/synth-real-time-series\/financial-time-series\/<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.<\/p>\n","protected":false},"author":372,"featured_media":44425,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,338,341,351,344,342],"tags":[6989,806,6613,6988,6614,852,7811,6612,1045,5519,2536],"contributors-categories":[13694],"class_list":{"0":"post-95046","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-ibkr-quant-news","10":"category-quant-development","11":"category-quant-europe","12":"category-quant-regions","13":"category-r-development","14":"tag-asset-pricing","15":"tag-data-science","16":"tag-financial-data","17":"tag-financial-markets","18":"tag-jupyter-notebook","19":"tag-machine-learning","20":"tag-r-rstats","21":"tag-synthetic-time-series","22":"tag-tidyverse","23":"tag-time-series","24":"tag-visualization","25":"contributors-categories-matthew-smith-r-blog"},"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 v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X<\/title>\n<meta name=\"description\" content=\"Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.\" \/>\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\/95046\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-15T15:26:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-28T15:11:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matthew Smith\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Smith\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 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:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Matthew Smith\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/34d673c6a3e7243a03707c66ba7a46f6\"\n\t            },\n\t            \"headline\": \"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X\",\n\t            \"datePublished\": \"2021-07-15T15:26:03+00:00\",\n\t            \"dateModified\": \"2023-02-28T15:11:22+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/\"\n\t            },\n\t            \"wordCount\": 467,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/05\\\/quant-space.jpg\",\n\t            \"keywords\": [\n\t                \"Asset Pricing\",\n\t                \"Data Science\",\n\t                \"financial data\",\n\t                \"Financial Markets\",\n\t                \"Jupyter Notebook\",\n\t                \"Machine Learning\",\n\t                \"R rstats\",\n\t                \"synthetic time series\",\n\t                \"tidyverse\",\n\t                \"Time Series\",\n\t                \"Visualization\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"Quant Europe\",\n\t                \"Quant Regions\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/\",\n\t            \"name\": \"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/05\\\/quant-space.jpg\",\n\t            \"datePublished\": \"2021-07-15T15:26:03+00:00\",\n\t            \"dateModified\": \"2023-02-28T15:11:22+00:00\",\n\t            \"description\": \"Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/05\\\/quant-space.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/05\\\/quant-space.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\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\\\/34d673c6a3e7243a03707c66ba7a46f6\",\n\t            \"name\": \"Matthew Smith\",\n\t            \"sameAs\": [\n\t                \"https:\\\/\\\/lf0.com\\\/\"\n\t            ],\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/matthewsmith\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X","description":"Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.","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\/95046\/","og_locale":"en_US","og_type":"article","og_title":"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X | IBKR Quant Blog","og_description":"Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/","og_site_name":"IBKR Campus US","article_published_time":"2021-07-15T15:26:03+00:00","article_modified_time":"2023-02-28T15:11:22+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg","type":"image\/jpeg"}],"author":"Matthew Smith","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Matthew Smith","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/"},"author":{"name":"Matthew Smith","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/34d673c6a3e7243a03707c66ba7a46f6"},"headline":"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X","datePublished":"2021-07-15T15:26:03+00:00","dateModified":"2023-02-28T15:11:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/"},"wordCount":467,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg","keywords":["Asset Pricing","Data Science","financial data","Financial Markets","Jupyter Notebook","Machine Learning","R rstats","synthetic time series","tidyverse","Time Series","Visualization"],"articleSection":["Data Science","Programming Languages","Quant","Quant Development","Quant Europe","Quant Regions","R Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/","name":"Time Series Classification Synthetic vs Real Financial Time Series \u2013 Part X | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg","datePublished":"2021-07-15T15:26:03+00:00","dateModified":"2023-02-28T15:11:22+00:00","description":"Matthew Smith demonstrates the stl_features function of the tsfeatures package in R.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/time-series-classification-synthetic-vs-real-financial-time-series-part-x\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg","width":900,"height":550,"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\/34d673c6a3e7243a03707c66ba7a46f6","name":"Matthew Smith","sameAs":["https:\/\/lf0.com\/"],"url":"https:\/\/www.interactivebrokers.com\/campus\/author\/matthewsmith\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/05\/quant-space.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/95046","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\/372"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=95046"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/95046\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/44425"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=95046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=95046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=95046"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=95046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}