The Complete Beginner’s Guide to perform VaR from historical data (with code!)

Value at Risk (VaR) provides a single number that summarizes the total financial risk in a portfolio or an asset. It was pioneered by J.P. Morgan in 1990 and has become widely used by fund managers, corporate management as well as financial institutions. This metric was also chosen by the regulators to set capital requirements for market risk, credit risk and operational risk. In summary, VaR is for managing, as well as measuring risk. [1]

Photo by Maarten van den Heuvel on Unsplash

Definition

VaR is defined as the worst loss expected from holding a portfolio or an asset over a given period of time with a confidence level…


Explaining the fundamentals of model-free RL algorithms: Deep Q-Network Model (with code!)

Photo by Mathias P.R. Reding on Unsplash

In Q-Learning, we represent the Q-value as a table. However, in many real-world problems, there are enormous state and/or action spaces and tabular representation is insufficient. For instance, Computer Go has 10¹⁷⁰ states and games like Mario Bro has continuous state space. When it is impossible to store all possible combinations of state and action pair values in the 2-D array or Q table, we need to use Deep Q-Network (DQN) instead of Q-Learning algorithm. [1]

DQN is also a model-free RL algorithm where the modern deep learning technique is used. DQN algorithms use Q-learning to learn the best action…


A complete guide to solve Sudoku puzzle with Linear Programming (with code!)

Photo by Alexander Shatov on Unsplash.

Sudoku is a popular Japanese puzzle game that is based on the logical placement of numbers. It doesn’t require any special mathematics skills or calculations. Let’s look at an example below from Wikipedia:


A complete guide to solving a Sudoku puzzle with a recursive method

Colorful letter blocks
Colorful letter blocks
Photo by Andrey Metelev on Unsplash.

Sudoku is a popular Japanese puzzle game that is based on the logical placement of numbers. It doesn’t require any special mathematics skills or calculations. Let’s look at an example below from Wikipedia:


Explaining the fundamentals of model-free RL algorithms: Q-Learning and SARSA (with code!)

Photo by Fabio Ballasina on Unsplash

Reinforcement Learning (RL) is one of the learning paradigms in machine learning that learns an optimal policy mapping states to actions by interacting with an environment to achieve the goal. In this article, I will introduce the two most commonly used RL algorithm: Q-Learning and SARSA.

Similar to the Monte Carlo Algorithm (MC), Q-Learning and SARSA algorithms are also model-free RL algorithms that do not use the transition probability distribution associated with Markov Decision Process (MDP). Instead, they learn the optimal policy from experience. The main difference between MC and Q-Learning or SARSA algorithm is that MC needs to sample…


A literature review on Statistical Machine Translation — SMT and Neural Machine Translation — NMT: Encoder-Decoder structure with and without attention mechanism and state-of-the-art Transformer architecture.

Photo by Johny Goerend on Unsplash

Machine Translation plays a vital role in today’s digitized and globalized world. It benefits society by processing and translating one natural language into some other natural language. With advances in technology, there is an enormous amount of information being exchanged between different regions with different languages. This boosts the demand for Machine Translation to grow exponentially over the last few decades. Owing to that, Machine Translation has become an active research area over the past couple of years. It can be divided into three distinct approaches: rule-based approaches, statistical approaches, and neural approaches. …


Part 3: Explaining the fundamental of model-free RL algorithm: Monte Carlo Algorithm

Photo by Lucas Benjamin on Unsplash

Recall the Agent-Environment Interface introduced in Part 1, the observation is the perception of the environment for the agent, the action will change the environment’s state, the reward is a scalar value that indicates how well the agent is doing at step t and the agent’s objective is to maximize the cumulative reward.


The Complete Beginner’s Guide to perform ANOVA Test (with code!)

Photo by Jonatan Pie on Unsplash

In previous articles, I have discussed how to perform one-sample hypothesis tests and two-sample hypothesis test. So, what if we would like to compare several population means? In this article, I will introduce an analysis of variance (ANOVA) which involves comparing multiple unknown μ’s.

One-Way ANOVA

It is a test where a particular factor has more than 2 groups or levels of interest. For example, let μ be the true mean annual salary of graduates
Single-factor of interest = Study subjects
Assume we have 6 categories of study subjects, Factor levels = athematics and Statistics, Economics and Finance, Environmental Sciences, Political Science, Social…


The Complete Beginner’s Guide to perform Two-Sample Hypothesis Tests (with code!)

Photo by Rohit Tandon on Unsplash

A Hypothesis Test is a statistical test that is used to test the assumption or hypothesis made and draw a conclusion about the entire population. In the previous article, I have introduced how to do one-sample hypothesis tests under different situations. In this article, I will share how hypothesis tests can extend to comparing samples from 2 populations instead of one.

The FIVE steps process of hypothesis testing is the same as one-sample hypothesis tests except for the calculation of test statistics, in summary:

  1. Define the Null Hypothesis (H₀)
  2. Define the Alternative Hypothesis (H₁)
  3. Set the Level of Significance (α)


The Complete Beginner’s Guide to perform Chi-Square Test (with code!)

In Photo by Kalen Emsley on Unsplash

In this article, I will introduce the fundamental of the chi-square test (χ2), a statistical method to make the inference about the distribution of a variable or to decide whether there is a relationship exists between two variables of a population. The inference relies on the χ2 distribution curve, dependent upon the number of degrees of freedom d.f.

Chao De-Yu

Data Analyst | MSc. Artificial Intelligence | LinkedIn — https://www.linkedin.com/in/thet-thet-yee-deyu/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store