Skip to main content

Mean and Standard Deviation of Time Series Data Simulator

Mathematically, a distribution has a mean of x and a standard deviation of y, the addion of 2 independent and identically random variable from that distribution will form a distribution with a mean of 2x and standard deviation of squart root of 2 times y.

I built a simulator to test if the result meets the above theory. The data I use is SPY etf mean daily return and daily return standard deviaton, which is 0.046% and 1.179% respectively and I wnat to find its annual mean return and standard deviaion.

In theory, they should be

  • SPY mean annual return is 0.046% * 252 = 11.592%
  • SPY annual return standard deviation is 1.179% * sqrt(252) = 18.716%

How it works

I will use SPY's daily return mean and standard deviation to create a series of daily value and record annual value every 252 days. Then calculate the mean and standard deviaiton for the annual data.
  • Simulated SPY mean annual return is %
  • Simulated SPY annual return standard deviation is %

Comments

Popular posts from this blog