# Value at Risk, with Python

## 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. 

# 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…

# Deep Q-Network, with PyTorch

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

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. 

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…

# Sudoku Solver: Linear Programming Approach Using PuLP

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

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:

# Sudoku Solver: A Brute Force Approach Using Python

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

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:

# Q-Learning and SARSA, with Python

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

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…

# Machine Translation

## 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.

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. …

# Fundamentals of Reinforcement Learning: Monte Carlo Algorithm

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

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.

# ANOVA Test, with Python

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

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…`

# Two-Sample Hypothesis Tests, with Python

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

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 (α)

# Chi-Square Test, with Python

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