Sign in to follow this  
Followers 0

Attempting to find a formula for WTI price based on US crude inventories: a model failure!

Recommended Posts


wti price and us crude oil inventories

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 by
Added bullet points

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
Followers 0