Assignments
AI-Assisted Financial Analysis
Rice University

Assigment 1

You plan to put $8,000 in your retirement account next year. You expect this amount to grow by 3% per year for 30 years. You then hope to withdraw $100,000 per year for 30 years. You currently have no savings. You hope to make 8% on your investments and will make depsoits and withdrawals at the end of each year.

  1. Ask Julius to create a table containing the balance at the beginning of each year, the gain on the investment account each year, the deposit or withdrawal each year, and the ending balance each year. Ask Julius to save the table as an excel file.

  2. Ask Julius to plot the account balance by year and save it as a jpeg.

  3. Now tell Julius to simulate 1,000 possible lifetimes by drawing the return each year and in each simulation from a normal distribution with a mean of 8% and a standard deviation of 15%. What is the mean ending balance and what is the median ending balance?

  4. Ask Julius to create a histogram of the simulated ending account balances and to save it as a jpeg.

  5. Create a report describing the exercise and including the table and figures and information learned. You can ask Julius to write the report, but you are responsible for checking it.

Due by midnight, Sunday, March 17. Submit a docx or pdf file to canvas.

Assigment 2

Estimate the WMT cost of equity capital using the following data sources: adjusted closing prices from Yahoo, MKT-RF and RF from the monthly and annual Fama-French factors files from Ken French’s data library, and the 1-month T-bill rate from FRED. Get the 1-month T-bill rate on March 1, 2024. Use the last 120 months for which all variables are present to compute the beta (remember to subtract RF from the WMT return before running the regression). In general, follow our March 19 conversations. Write a brief report of your results. Include a scatter plot with excess WMT returns (return minus risk-free rate) on the y axis and MKT-RF on the x axis. Include the regression line in the scatter plot.

Due by midnight, Sunday, March 24. Submit a docx or pdf file to Canvas.

Assigment 3
  • Ask Julius to explain XGBoost, GridSearchCV, and R-squareds.

  • Ask Julius to use xgboost to predict MEDV using the other features in the Boston house price data (ask Julius to get the data from sklearn). Use GridSearchCV to choose the max depth and the learning rate. Get the R-squareds on the training data and on the test data.

  • Save the conversation as a notebook. Edit the text cells (in Google Colab or however you prefer) to include the explanations and a summary of the results, but remove the chat identifiers.

  • Save the notebook as a pdf and submit to Canvas.

Due by midnight, Monday, April 8.

Assigment 4

Train at least two different models (random forest, xgboost, neural network, ridge regression, …) to predict the sale price in house_prices.xlsx.  Use at least 3 variables as predictors (features), including at least one categorical variable.  For each model, create a pipeline including the model that applies one hot encoder to the categorical variables and standard scaler to the numeric variables.  Apply GridSearchCV to the pipeline to find at least one hyperparameter for each model and get the average validation score for the best hyperparameters.  Select a model and hyperparameter based on the best average validation score.  Find the R-squared on the test data.  Retrain the model on the entire dataset and save the fitted model.  Save your chat as a notebook.  Convert the notebook to pdf and submit to Canvas.

Due by midnight, Sunday, April 14.