Exercises
http://finance.yahoo.com), download the last five years of price data for a few companies, such as IBM, WMT, and C (City Group). Test whether their daily returns follow a normal distribution.
Write a Python program to use the
scipy.permutation()
function to select 12 monthly returns randomly from the past five-year data without replacement. To test the program, you can use Citigroup and the time period from January 2, 2012 to December 31, 2016 from Yahoo! Finance.Write a Python program to run bootstrapping with n given returns. For each time, we select m returns where m>n.
To convert random numbers from a uniform distribution to a normal distribution, we have the following formula:
Based on the formula, generate 5,000 normally distributed random numbers; estimate their mean, standard deviation, and test it.
Assume that the current stock price is $10.25, the mean value in the past five years is $9.35, and the standard deviation is 4.24. Write a Python program to generate 1,000 future...