Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For the preprocessed dataset, complete the following tasks. Slice the dataset into as many complete weeks (Monday-Sunday) as possible. Consider the Moving Average and apply
For the preprocessed dataset, complete the following tasks. Slice the dataset into as many complete weeks (Monday-Sunday) as possible. Consider the Moving Average and apply this method on Global_intensity only to reduce the relative effect of single point anomalies (which are oftentimes just noise). To do this, compute the moving average for each complete week in the dataset using a fixed size moving time window of 7-10 consecutive observations. The outcome will be a 'smoothened' version of the input week, referred to as smoothened week #n (for n = 1, 2, ...). Now, create a new time series by computing the average value of all observations over each of the n smoothened weeks, referred to as the average smoothened week; that is, the value for time t of the new time series is obtained as the average value at time t calculated over all n smoothened weeks. The average smoothened week is used here as an approximation of what a 'normal week' looks like for the time period of the dataset. Identify the most and the least anomalous weeks among the n weeks (hint: compare each smoothened week to the average smoothened week and quantify the deviation in terms of a meaningful numerical score allowing you to rank all n weeks according to how closely they resemble the average week. Provide a brief rational for choosing your scoring. Represent all anomaly scores in a table and plot the smoothened versions of the most and the least anomalous weeks against the average smoothened week. 2017-2024 Uwe Glsser. All Rights Reserved. 1 CYBERSECURITY CMPT 318 SPRING 2024 20 February 2024 There are a number of packages and functions you can use in order to calculate the moving average over a given univariate time series. Below are a few suggestions. Use simple moving average, SMA(), in the TTR package. https://cran.r-project.org/web/packages/TTR/TTR.pdf#page40 Use rolling mean, rollmean(), in the zoo package. https://cran.r-project.org/web/packages/zoo/zoo.pdf#page49 Use moving average, MA(), in the forecast package. https://cran.r-project.org/web/packages/forecast/forecast.pdf#page8
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