Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls help me question 1 The econs data set contains monthly economic data collected from July 1967*April 2015. The data tracks personal consumption expenditure, savings,

image text in transcribed

pls help me

question 1

image text in transcribedimage text in transcribed
The econs data set contains monthly economic data collected from July 1967*April 2015. The data tracks personal consumption expenditure, savings, total population etc. and can be used as to understand the relationship between the US economy and how people participate in it. Variable Description date Date pce personal consumption expenditures, in billions of dollars pop total population, in thousands psavert personal savings rate unempmed median duration of unemployment, in weeks unemploy number of unemployed in thousands For this exercise, focus on the personal savings rate (psavert) variable in the econs data set and use it to do the following: a. Read the required data into R and convert the data to a time series. . Your time series data should be named psavert. b. Plot the psavert series and discuss the main features of the data. c. Compute and plot the 1, 3, and 10 year moving average for psavert and discuss the plots. d. What Box-Cox transformation would you select for the psavert series. Demonstrate and discuss the options you considered and how your reached a decision. ***Note: Three (3) seperate functions are required. Please use the function body and names for the input and returned variable(s) provided after each question. Please test all functions using the psavert series and provide the relevant codes demonstrating your tests. Function 1: Write your own function to implement simple exponential smoothing. The function should take arguments y (the time series), alpha (the smoothing parameter a) and so (the level at time 0). Your function should be called ts_ses() and it should return the forecast of the next observation in the series in a list. ts_ses - function(y, alpha, so) { # Your work here. # yjmt = forecast of the nest observation in the series return(list(y_hat = )) } Function 2: Modify Function 1 to return the sum of squared errors rather than the forecast of the next observation. Then use the optim function to nd the optimal values of a and so. You can nd help about the optim function in R by typing help (optim) or '?optim. Your function should be called ts_ses_sse() and it should return the required calculation(s) as demonstrated below. ts_ses_sse = functionCpar-s = C(alpha, 50), y) { # Your work here. # SSE = sum of squared errors return(list(SSE = )) } # Your optimization call for finding the optimal values of $\\alpha$ and $s_0$ using # optimO should be as follows: # To execute, please set alpha = 0, and s_0 = the first observation value # of the 'psaoert' series opt1m_pa;rams

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mathematical Analysis For Quantitative Finance

Authors: Daniele Ritelli, Giulia Spaletta

1st Edition

1351245104, 9781351245104

More Books

Students also viewed these Mathematics questions

Question

What is a key consideration when closing a virtual project team

Answered: 1 week ago

Question

3. Tactical/strategic information.

Answered: 1 week ago

Question

3. To retrieve information from memory.

Answered: 1 week ago

Question

2. Value-oriented information and

Answered: 1 week ago