Question
Data analytics is an interesting and growing area in Computer Science. In addition, Finance is an industry that employs Computer Science and Computer Information Technology
Data analytics is an interesting and growing area in Computer Science. In addition, Finance is an industry that employs Computer Science and Computer Information Technology majors. Thus, the design and implementation of statistical and simulation techniques is relevant. For this assignment you will calculate and simulate the returns of a stock market based on the weekly percent return information of how the SP500 performed from 1/1/1950 to 12/31/2018 (3601 weeks). That data is in the text file SP500-1950-2018-weekly.txt posted with this assignment specification. The data used to create the weekly percent return was retrieved from Yahoo finances historical data for the SP500. https://finance.yahoo.com/quote/%5EGSPC/history?p=%5EGSPC Over those 3601 weeks the SP500 average (mean) weekly return was 0.16% (0.0016), the median (midpoint) was 0.29% (0.0029), and its standard deviation was 2% (0.0206). The average yearly return was 8.3% (0.0832 = 52 * 0.0016). If one had invested $100 on 1/1/1950 it would have been worth $ 15,033.86 on 12/31/2018. These values are from a spreadsheet. There are 2 phases to this assignment. Phase 1. In the first phase of this assignment, you are going to calculate the return of investing $100 over this period using weekly return data in a file. You must design and implement two classes in Phase 1 named: SimulateMarket and Sample. The design goal is to have Sample represent any sample, or collection, of observations and to be independent of the SimulateMarket application. You will use the Sample class in other programming assignments for this course. SimulateMarket is the application class (file SimulateMarket.java). SimulateMarket has a main method. SimulateMarket.class is the program that you will run. SimulateMarket must use the following symbolic constants (instance constants). constants name value type FILE_NAME SP500-1950-2018-weekly.txt private final String WEEKS 3601 private final int INVEST 100.0 private final double SimulateMarkets main method is shown below. There are no run time arguments to process, so main calls SimulateMarkets constructor. public static void main(String[] arg) { new SimulateMarket(); } SimulateMarkets constructor is the manager of the application. It should create a Sample instance named model, it should report the statistics of model, and it should call a method named historicalSP500(). Sample model can be created with the following statement. model = new Sample("SP500", makeDistribution(FILE_NAME)); 2 Sample model should be an instance variable of SimulateMarket. It will be also be used by other simulation methods in phase 2. The method makeDistribution reads the data from the file (SP500-1950-2018-weekly.txt) and stores it in a local ArrayList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started