Question: i need the codes for 4th question and 9th question QUESTIONS 1. Load the data from the '2021-12.csv' file and set the file index to

i need the codes for 4th question and 9th question QUESTIONS 1.i need the codes for 4th question and 9th question

QUESTIONS 1. Load the data from the '2021-12.csv' file and set the file index to an appropriate Pandas date format. All the variables of interest are stored in the columns of the table. 2. Select the data up to and including December 2019 and perform the following analysis on this subset of the data. 3. Load the data description table: ' fred_md_desc. csv' file. The keys in this table should match the columns of (1). 4. In order to fit the model, the data needs to be mathematically transformed in several ways. The transformation required for each series and the corresponding code to compute these are set out below. The appropriate transformation for each variable is supplied in the ' t f code' field in the description table. The table below gives the code required to transform the data for any given Pandas Series stored in the variable 'srs': BEMM458 - TURN OVER 5. Produce a new data frame (with a correct pandas time series index and the original column names) by applying the specified mathematical transformation to each variable in the data. 6. Standardise each transformed variable from (Q5) above by subtracting its own time series mean and then dividing by its own time series standard deviation. Fill any missing values in the standardised data with a zero. Write this table to file ('transformed_data. csv') with a correct Pandas time series index and using the original variable names as column names. 7. Using the standardised data from (Q6) produce a PCA analysis. Call the function (provided for you in the template.py file) pca_function (), passing in your standardised dataset from Q6. 8. Produce a histogram of the distribution of the factor, and a plot of the time series of the factor (both in one figure) and save this to a pdf file ('factor.pdf'). Note that the command plt.tight_layout () can be called after you have drawn your plot and added a title so as to neatly arrange the axis/ titles so that they do not overlap. 9. Produce a new data frame of 1st lags of the data by shifting your transformed (but not standardised) data from (Q5) forward in time by one time period using df. shift (1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!