## Moving Median Absolute Deviation

The function which is used for calculating moving median absolute deviation is not available in matlab built-in functions. so this function may be useful for those which do not have matlab 2016 or later version. this simple function does the calculation for centered moving median absolute deviation. It do not skip the nan values. it…

## R Shiny Application for trading strategies

This project was done using R programming languages and shiny server. A historical price and indicators plot based on stock symbols. The app take the price from specific date that is set by the user to end user specified date. The app will do back testing 3 trading strategies and show the earning based on…

## Maximum Likelihood Estimation

In this post, i want to estimate the maximum likelihood by numerical solution using matlab / octave. numerical solution used is based on Newton’s method and central difference for evaluation of the derivative values of the loglikelihood. here i will attach the matlab code which uses simple functions.

## Aligned Rank Transform with Matlab

This function is written to do aligned rank transform using matlab for a data with heavy tail, this function could be used for getting the aligned rank transformed data and implementing Analysis of variance and mixed effect models This is an approach used when the data has non-normal distribution

## Reliability analysis using Cronbach’s alpha

I’ve written a Matlab function, which calculates the Cronbach’s alpha between some items and do the if item is deleted process. this function will automatically delete the item which increase the Cronbach’s alpha maximally. before entering in if item is deleted process it checks the initial Cronbach’s alpha. if the Cronbach’s alpha value was greater…

## Monte Carlo simulation of Value at risk

I’ve written a code in Visual basic (excel macro), to do Monte Carlo repetitions to find the value at risk. for this reason, I’ve used Cornish-fisher expansion. The formula for Value at risk, uses volatility, skewness and excess kurtosis and the number of trading periods in the recommended holding period to find the value at…

## Random walk movement

In this project, I wrote a matlab code to keep a marker which moves randomly toward a square area, inside the boundary. so the marker moves with a specific speed in a random direction. when the marker reaches to the boundary of the square area, it will first bounce back and then will keep moving…

## Exponential smoothing

Exponential smoothing method for finding the trend and seasonality of the data and doing forecast. simple exponential smoothing is for the data which doesn’t have seasonality. for data which has seasonality exponential smoothing has three formula as we could see in the figure below: at is level, bt is the trend and Ft is seasonality.…

## Two way analysis of variance tutorial

In the video below you can see a tutorial for doing two way analysis of variance on balanced data using matlab. the data are stored in a text file in tab delimited order.

## Panel data analysis

A company decided to do to statistical analysis to find a model for the revenue gained by their employees. in the passed years and find a model to do forecast for the next year.