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

Which is better? BND or AGG?

The US 10-year treasury yield has reached at 2007-2008 years level, which is about 16 years ago. From a technical point of view, it is a buy. Then there are 2 bond ETFs that I am interested in. There are BND and AGG. They are very similar in nature. US 10 year Treasury Bond, chart, prices - FT.com Expense Ratio BND: 0.03% AGG: 0.03% The same. Turnover Rate BND: 40.00% AGG: 104.0% BNG seems better. Historical Performance Comparison Investment duration: 5 years with no tax on dividends BND wins a little with winning rate of 57.5%, but AGG wins 0.012% in return. Investment duration: 5 years with 30% tax on dividends AGG wins a little with winning rate of 65% and a 0.079% difference on average. Investment duration: 10 years with no tax on dividends AGG wins a little with winning rate of 67% and a 0.024% difference on average. Investment duration: 10 years with 30%  tax on dividends AGG wins a little with winning rate of 99% and a 0.095% difference on average. C...