Question: Please solve it by using R studio 1. The file vandata-edit.csv contains daily temperature and precipitation data measured in Vancouver Harbour from January 3, 2013

Please solve it by using R studio
1. The file vandata-edit.csv contains daily temperature and precipitation data measured in Vancouver Harbour from January 3, 2013 until January 3, 2021. Temperature is measured in degrees Celsius and precipitation is measured in millimetres. Linear imputation was used to fill in missing data so that all days have data and leap days (February 29) have been removed. (Source: https://climatedata.ca/download/). (a) Read in the data and create a time-series object for the mean daily temperature. Plot the series against time (label your graph) and comment on any features of the data that you observe. In particular, address the following points: Is the series stationary? Does the series have a trend? Is there a seasonal variation, and if so would an additive or multiplicative model be suitable? Justify your answers. (b) Create training and test datasets. The training dataset should include all observations from January 3, 2013 until December January 2, 2020. The test dataset should include all observations from January 3, 2020 to January 3, 2021. You can use the command window() on a ts object to split the data. If necessary, apply a suitable transformation to the data so that an additive model is appropriate. Using an additive model, decompose the series into trend, seasonal, and error components. Use both the moving average smoothing (R function decompose()) and the loess method (R function st1()). Plot both decompositions. (c) Fit a simple linear model to the trend component of the moving average decomposition (you can use R function 1m()). Does the linear model provide evidence of a trend at the 95% confidence level? Without doing any further analysis, would you use this trend component to make predictions? Justify your answer using the linear model results and/or the trend component plot. 1 (d) Predict the mean daily temperatures for the test dataset using the moving average de composition. Compare your predictions under the following assumptions: There is a linear trend; There is no trend. Compare your predictions with the test dataset graphically and using the mean squared prediction error (MSPE), defined as the average of the squared distances between the predictions and test data. Could you use these findings to say whether temperatures are rising in Vancouver? Explain why or why not. 1. The file vandata-edit.csv contains daily temperature and precipitation data measured in Vancouver Harbour from January 3, 2013 until January 3, 2021. Temperature is measured in degrees Celsius and precipitation is measured in millimetres. Linear imputation was used to fill in missing data so that all days have data and leap days (February 29) have been removed. (Source: https://climatedata.ca/download/). (a) Read in the data and create a time-series object for the mean daily temperature. Plot the series against time (label your graph) and comment on any features of the data that you observe. In particular, address the following points: Is the series stationary? Does the series have a trend? Is there a seasonal variation, and if so would an additive or multiplicative model be suitable? Justify your answers. (b) Create training and test datasets. The training dataset should include all observations from January 3, 2013 until December January 2, 2020. The test dataset should include all observations from January 3, 2020 to January 3, 2021. You can use the command window() on a ts object to split the data. If necessary, apply a suitable transformation to the data so that an additive model is appropriate. Using an additive model, decompose the series into trend, seasonal, and error components. Use both the moving average smoothing (R function decompose()) and the loess method (R function st1()). Plot both decompositions. (c) Fit a simple linear model to the trend component of the moving average decomposition (you can use R function 1m()). Does the linear model provide evidence of a trend at the 95% confidence level? Without doing any further analysis, would you use this trend component to make predictions? Justify your answer using the linear model results and/or the trend component plot. 1 (d) Predict the mean daily temperatures for the test dataset using the moving average de composition. Compare your predictions under the following assumptions: There is a linear trend; There is no trend. Compare your predictions with the test dataset graphically and using the mean squared prediction error (MSPE), defined as the average of the squared distances between the predictions and test data. Could you use these findings to say whether temperatures are rising in Vancouver? Explain why or why notStep by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
