Probability Formula

Probability → Basics → Vocabulary → Probability Formula The probability of an event can be calculated by the proportion (or probability) formula or For example, in the basic probability vocabulary page, the question was, Example A coin is tossed two times. What is the probability that both times the head was occurred? Answer Here, the […]

Basic Probability Vocabulary

Probability → Basics → Vocabulary Before rolling a die, the outcome is unknown. This is an example of a random experiment. In particular, a random experiment is a process by which we observe something uncertain. After the experiment, the outcome of the random experiment is known. An outcome is a result of a random experiment. […]

Asian Option Pricing using Monte Carlo Simulation Method in Matlab

Matlab → Simulations → Monte Carlo →  Antithetic Technique → Asian Option The following Matlab codes calculate Asian Option Prices using Monte Carlo Simulation Method in Matlab. In the first code we used the for loop to calculate the arithmetic Asian call option price. Later, we used the powerful cumprod command to simplify the Matlab codes. In the end, the […]

Antithetic Variable Technique in Matlab

Matlab → Simulations → Monte Carlo → Antithetic Variable Technique In antithetic variable technique for variance reduction, the stock price path is constructed in the usual manner with positive and payoff is calculated. Then another path with negative , that is , is constructed, and payoff is calculated again. Finally, average of these two payoffs is calculated, that […]

Monte Carlo simulation for option pricing in Matlab

Matlab → Simulations → Brownian Motion → Stock Price → Monte Carlo for Option Pricing In Monte Carlo simulation for option pricing, the equation used to simulate stock price is Where is the initial stock price, is interest rate ( is used to indicate risk-free interest rate), is volatility, is time, and is the random samples from standard normal […]

Simulation of Stock Price in Matlab

Matlab → Simulation → Brownian Motion → Stock Price The stock price  following geometric Brownian motion is given by This is geometric Brownian motion stochastic differential equation, and the discrete-time version of the equation is So, the change in stock price from time 0 to is given by Stock price simulation in Matlab t=1; n=500; dt=t/n; x=0:dt:t; dz=sqrt(dt)*randn(1,n); […]

Simulating Brownian Motion in Matlab

Matlab → Simulation → Brownian Motion The change in a variable following a Brownian motion during a small period of time is given by where has a standardized normal distribution with mean 0 and variance 1. And, the change in the value of from time 0 to is the sum of the changes in in time intervals […]

Simulations in Matlab

Matlab → Basics → Scripts, Functions → Programming → Graphs → Simulations The behavior of many real-life system or phenomenon, whether biological, economic, physical, or even sociological, are often described in mathematical terms. The mathematical description of a system of phenomenon is called a mathematical model. And, simulation is a computer program which attempts to represent the real world based […]

Plotting Different types of graphs in Matlab

Matlab → Graphs → Multiple Graphs → Different Types So far, all the plots presented here are line graphs. In Matlab, many other type of graphs are easily plotted. For example, consider sale of an item in different years. Vertical bar graph >> year=[2011:2018]; >> sale=[40 60 95 80 50 50 70 90]; >> bar(year,sale) Horizontal bar graph […]

Plotting a Function in Matlab

Matlab → Graphs → Plotting a Function Two vectors x and y are needed to plot a two dimensional graph of a function y=f(x) where x is domain of the function while y is the range of the function. The graph is plotted using the plot(x,y) command. Examples 1. Plot a graph for the function y=sin(x) from […]