hemanthaa@mail.com + 64 July 31, 2021 (edited) Buoyed by the impact on the price of crude oil by the fall of US crude inventories this week, I was tempted to attempt to write a simple Machine Learning algorithm in JavaScript to see whether I am lucky enough to find a meaningful formula – while taking into account just one factor in isolation! With just 160 lines of code, I managed to produce my model that turned out to be flawed. I got one thing right, though: the machine learns – hence, Machine Learning; it draws an acceptable line of best fit while taking the new data into account, while minimizing the errors between the real data and expected data; it, however, does not teach me anything useful, as the formula it generates does not appear to be reliable for any future US inventory data. The following contributed to my model failure: I assumed a linear relationship between the WTI price and US inventories. I took just one factor in isolation when the EIA say there are more than 7 factors that determine the price of oil at present. I failed to quantify the market sentiment in modelling the situation. There are algorithms for that too! They just count the frequency of positive – or negative – words in articles, for instance, as one of the measures; if an article is flooded with words such as ‘amazing’, ‘brilliant’, ‘encouraging’ or even ‘insane’, understandably, the algorithm generates a high positive score; otherwise, a low score. If you want to have a go at it – just for fun - with real data, here is the model; please get the real data from the EIA from the link provided. Here is the link for the model: Edited July 31, 2021 by hemanthaa@mail.com Added bullet points Quote Share this post Link to post Share on other sites