<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>People's Emotions Analysis while Watching YouTube Videos</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Volodymyr Motyka</string-name>
          <email>volodymyr.motyka@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yaroslav Stepaniak</string-name>
          <email>yaroslav.stepaniak@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mariia Nasalska</string-name>
          <email>mariia.nasalska@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Victoria Vysotska</string-name>
          <email>victoria.a.vysotska@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Lviv Polytechnic National University</institution>
          ,
          <addr-line>S. Bandera Street, 12, Lviv, 79013</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Osnabrück University</institution>
          ,
          <addr-line>Friedrich-Janssen-Str. 1, Osnabrück, 49076</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>For analysis, a dataset containing information about videos from video hosting YouTube is selected, namely: title, video category, channel (author), number of views, number of likes, number of dislikes, date of video release. The purpose of the study was to analyze the state of people while watching videos on this platform. For this, various methods of visualization and data processing, smoothing methods, correlation and cluster analysis are used.</p>
      </abstract>
      <kwd-group>
        <kwd>1 Cluster analysis</kwd>
        <kwd>correlation</kwd>
        <kwd>smoothing</kwd>
        <kwd>YouTube</kwd>
        <kwd>like</kwd>
        <kwd>dislike</kwd>
        <kwd>emotion</kwd>
        <kwd>sentiment analysis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Related works</title>
      <p>
        Let's pay attention to the exact numbers and look at the statistics of the most popular social networks
for July 2021. The data are taken from the resource [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and shown in Fig. 1. The number of users is
given in millions. As can be seen from the statistics, YouTube is the second most popular platform in
the world after the social network Facebook. In addition, YouTube is the second most popular search
engine after Google. More than two billion of its users, equivalent to nearly one-third of all Internet
users, log in every month. However, that is not all. YouTube viewers watch more than a billion hours
of video on its platform every day and are responsible for generating billions upon billions of views [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <sec id="sec-2-1">
        <title>Let's look at how many more users have become in recent years:</title>
        <p>
          One of the reasons for the jump in popularity was changing the interface and adding new functions
and opportunities for users, for example, users could rate not only videos, but also entire playlists, and
when choosing a video, they were immediately shown the number of video views and its duration. All
this affects the emotional state of users. The reason for the jump in popularity in 2020 was the pandemic
of the coronavirus disease, as an extremely large number of people around the world began to work,
study at home. This increased the amount of free time people have and they started using social
platforms like YouTube more [
          <xref ref-type="bibr" rid="ref3 ref4 ref5">3-5</xref>
          ]. It is impossible not to note the number of video views on YouTube.
As can be seen from Figure 2, views more than once exceed the population of countries, so there is
certain content that people are ready to view more than once and more than twice.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Methods and materials</title>
      <p>
        We will use the methods of visual presentation of data, smoothing, correlation method to perform
the tasks. Methods of visual presentation of data - methods of presenting data in the form of graphs,
charts and/or other subtypes of them (histograms, pie charts, etc.), time series, etc. Depending on the
specific task, a specific method of data presentation will be used. We will implement these methods
using Microsoft Power BI and/or R tools. Smoothing methods are used to reduce the influence of the
random component (random fluctuations) in time series. They make it possible to obtain more "pure"
values, which consist only of deterministic components. Some of the methods are aimed at highlighting
some components, for example, a trend [
        <xref ref-type="bibr" rid="ref6 ref7 ref8">6-8</xref>
        ]. We will implement these methods using Microsoft Excel,
R and/or Microsoft Power BI. Correlation method (Correlation - analysis) - a method of studying the
interdependence of characteristics in the general population, which are random variables with a normal
distribution [
        <xref ref-type="bibr" rid="ref10 ref11 ref12 ref13 ref9">9-13</xref>
        ] for different NLP-talks based on emotions recognizing and analysis [
        <xref ref-type="bibr" rid="ref14 ref15 ref16 ref17 ref18 ref19 ref20 ref21 ref22 ref23">14-23</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Experiments</title>
      <p>The source of the selected dataset:
https://www.kaggle.com/ahmedmohamedmahrous/youtubetextsentiment?select=USvideos.csv. Let's open the dataset using R Studio:
selecting the views data column, which characterizes the number of views of the corresponding video,
using R:

</p>
      <sec id="sec-4-1">
        <title>Sample size – the number of units in the sample: sample_size&lt;-nrow(videos)</title>
        <p>Sample mean. We find using the built-in mean() method:</p>
        <p>avg&lt;-mean(videos$views, na.rm = FALSE)
 The median of the sample is the number that "divides" "in half" the ordered set of all the values
of the sample, that is, the average value of the changing characteristic, which is contained in the
middle of the series, placed in the order of increasing or decreasing of the characteristic. For this,
we will use the median() method: median_views&lt;-median(videos$views, na.rm = FALSE)
 Mode - the value that occurs most often in the sample. Since there is no built-in method for
finding it in R, we will define our modes function:
modes &lt;-function(v) {## modes function
uniqv &lt;- unique(v)
uniqv[which.max(tabulate(match(v, uniqv)))]
}
mode_views&lt;-modes(videos$views)
 Sample size – the difference between the maximum and minimum value of the sample. To find
the maximum and minimum, use the built-in methods max() and min():</p>
        <p>range_views&lt;-max(videos$views)-min(videos$views)
 Standard deviation - the amount of spread relative to the arithmetic mean. To find, we will use
the built-in method sd(): standart_deviation&lt;-sd(videos$views)
 Coefficient of variation – an indicator that determines the percentage ratio of the average
deviation to the average value:</p>
        <p>variation_coef&lt;-sd(videos$views)*100/mean(videos$views, na.rm = FALSE)
 Asymmetry reflects the skewness of the distribution relative to the mode. Let's use the built-in
h&lt;-3.5*sd(videos$category_id)*(nrow(videos))^(-1/3) #Interval width</p>
      </sec>
      <sec id="sec-4-2">
        <title>Construction of a histogram:</title>
        <p>hist(videos$category_id, breaks = k, xlab = "Category", main = "Histogram of categories",
xlim = c(0,8*10^5))</p>
      </sec>
      <sec id="sec-4-3">
        <title>Construction of cumulata:</title>
        <p>plot(ecdf(videos$category_id), main="Cumulate", xlab="Category", ylab = "Frequency")</p>
      </sec>
      <sec id="sec-4-4">
        <title>Let's present the dataset in the form of a table:</title>
      </sec>
      <sec id="sec-4-5">
        <title>Number of likes and dislikes depending on video categories:</title>
      </sec>
      <sec id="sec-4-6">
        <title>Let's find the statistical parameters for the views attribute (Table 1).</title>
      </sec>
      <sec id="sec-4-7">
        <title>After executing the code, we have histograms and corresponding cumulates:</title>
        <p>Smoothing methods are used to reduce the influence of the random component (random fluctuations)
in time series. They make it possible to obtain more "pure" values, which consist only of deterministic
components. Some of the methods are aimed at highlighting some components, for example, a trend.</p>
        <p>Smoothing methods can be conventionally divided into two classes based on different approaches:
analytical and algorithmic. The simplest method of forecasting is considered to be an approach that
determines the forecast estimate from the actually achieved level using the average level, average
growth, average growth rate. Extrapolation based on the average level of the series.</p>
        <p>The resulting confidence interval takes into account the uncertainty hidden in the estimate of the
average value. However, the assumption remains that the predicted indicator is equal to the sample
mean, that is, this approach does not take into account the fact that individual values of the indicator
have fluctuated around the average in the past, and this will happen in the future.</p>
        <p>Analytical smoothing methods include regression analysis together with the method of least squares
and its modifications. To identify the main trend by analytical method means to give the studied process
the same development throughout the entire observation period. Therefore, for four of these methods,
it is important to choose the optimal function of the deterministic trend (growth curve), which smoothes
a number of observations.</p>
        <p>Forecasting methods based on regression methods are used for short- and medium-term forecasting.
They do not allow for adaptation: with the receipt of new data, the forecast construction procedure must
be repeated from the beginning. The optimal length of the lead-up period is determined separately for
each economic process, taking into account its statistical instability.</p>
      </sec>
      <sec id="sec-4-8">
        <title>The most widely used are the methods of smoothing time series using moving averages.</title>
        <p>For moving average smoothing, we will use Kendel's formulas to calculate the lost levels at the
beginning and end of the smoothed series. Let's prepare the data for using smoothing methods:
dates&lt;-seq(as.Date("2021-09-13"), as.Date("2021-10-22"), by="days")
str1&lt;-c("13/09/2021","14/09/2021","15/09/2021","16/09/2021","17/09/2021","18/09/2021",
"19/09/2021","20/09/2021","21/09/2021","22/09/2021","23/09/2021","24/09/2021",
"25/09/2021","26/09/2021","27/09/2021","28/09/2021","29/09/2021","30/09/2021",
"01/10/2021","02/10/2021","03/10/2021","04/10/2021","05/10/2021","06/10/2021",
"07/10/2021","08/10/2021","09/10/2021","10/10/2021","11/10/2021","12/10/2021",
"13/10/2021","14/10/2021","15/10/2021","16/10/2021","17/10/2021","18/10/2021",
"19/10/2021","20/10/2021","21/10/2021","22/10/2021")
sums&lt;-1:40
k&lt;-1
sum&lt;-0
for(i in 1:7998)
{
if(videos$date[i]==str1[k]){
videos$date[i]&lt;-str1[k]
sum&lt;-sum+videos$views[i]
}else if(videos$date[i]==str1[k+1]){
sums[k]&lt;-sum
sum&lt;-0
k&lt;-k+1
}</p>
        <p>
          The method of smoothing according to Kendel's formulas:
ma$ma1[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(5*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]-sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ])/6
ma$ma1[40]&lt;-(-sums[38]+2*sums[39]+5*sums[40])/6
ma$ma2[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(3*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]-sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ])/5
ma$ma2[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(4*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ])/10
ma$ma2[39]&lt;-(4*sums[40]+3*sums[39]+2*sums[38]+sums[37])/10
ma$ma2[40]&lt;-(-sums[36]+sums[38]+2*sums[39]+3*sums[40])/5
ma$ma3[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(13*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ])/28
ma$ma3[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(5*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+0*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ])/14
ma$ma3[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(7*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ])/28
ma$ma3[38]&lt;-(7*sums[34]+6*sums[35]+5*sums[36]+4*sums[37]+3*sums[38]+2*sums[39]+sums[40])/28
ma$ma3[39]&lt;-(5*sums[40]+4*sums[39]+3*sums[38]+2*sums[37]+1*sums[36]+0*sums[35]+1*sums[34])/14
ma$ma3[40]&lt;-(13*sums[40]+10*sums[39]+7*sums[38]+4*sums[37]+sums[36]-2*sums[35]-5*sums[34])/28
ma$ma4[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(17*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/45
ma$ma4[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(56*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+47*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+38*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-16*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/180
ma$ma4[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(22*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/90
ma$ma4[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(32*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/180
ma$ma4[37]&lt;-(32*sums[40]+29*sums[39]+26*sums[38]+23*sums[37]+20*sums[36]+17*sums[35]+14*sums[34]+11*sums[33]+8*sums[32])/180
ma$ma4[38]&lt;-(22*sums[40]+19*sums[39]+16*sums[38]+13*sums[37]+10*sums[36]+7*sums[35]+4*sums[34]+sums[33]-2*sums[32])/90
ma$ma4[39]&lt;-(56*sums[40]+47*sums[39]+38*sums[38]+29*sums[37]+20*sums[36]+11*sums[35]+2*sums[34]-7*sums[33]-16*sums[32])/180
ma$ma4[40]&lt;-(17*sums[40]+14*sums[39]+11*sums[38]+8*sums[37]+5*sums[36]+2*sums[35]-1*sums[34]-4*sums[33]-7*sums[32])/45
ma$ma5[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(7*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+0*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-3*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/22
ma$ma5[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(15*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-3*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/55
ma$ma5[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(25*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+22*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/110
ma$ma5[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(10*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+0*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/55
ma$ma5[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;-(15*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+12*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/110
ma$ma5[36]&lt;-(15*sums[40]+14*sums[39]+13*sums[38]+12*sums[37]+11*sums[37]+10*sums[36]+9*sums[35]+8*sums[34]+7*sums[33]+6*sums[32]+5*sums[31])/110
ma$ma5[37]&lt;-(10*sums[40]+9*sums[39]+8*sums[38]+7*sums[37]+6*sums[37]+5*sums[36]+4*sums[35]+3*sums[34]+2*sums[33]+1*sums[32]+0*sums[31])/55
ma$ma5[38]&lt;-(25*sums[40]+22*sums[39]+19*sums[38]+16*sums[37]+13*sums[37]+10*sums[36]+7*sums[35]+4*sums[34]+sums[33]-2*sums[32]-5*sums[31])/110
ma$ma5[39]&lt;-(15*sums[40]+13*sums[39]+11*sums[38]+9*sums[37]+7*sums[37]+5*sums[36]+3*sums[35]+1*sums[34]-1*sums[33]-3*sums[32]-5*sums[31])/55
ma$ma5[40]&lt;-(7*sums[40]+6*sums[39]+5*sums[38]+4*sums[37]+3*sums[37]+2*sums[36]+1*sums[35]+0*sums[34]-1*sums[33]-2*sums[32]-3*sums[31])/22
ma$ma6[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(25*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+22*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-8*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-11*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/91
ma$ma6[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(44*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+39*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+34*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+24*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-6*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-11*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-15*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/182
ma$ma6[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(19*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+15*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-3*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/91
ma$ma6[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(32*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/182
ma$ma6[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;-(13*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+12*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref12">1 2</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/91
ma$ma6[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;-(20*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+18*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+15*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+12*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/182
ma$ma6[40]&lt;-(25*sums[40]+22*sums[39]+19*sums[38]+16*sums[37]+13*sums[36]+10*sums[35]+7*sums[34]+4*sums[33]+1*sums[32]-2*sums[31]-5*sums[30]-8*sums[29]11*sums[28])/91
ma$ma6[39]&lt;-(44*sums[40]+39*sums[39]+34*sums[38]+29*sums[37]+24*sums[36]+19*sums[35]+14*sums[34]+9*sums[33]+4*sums[32]-1*sums[31]-6*sums[30]-11*sums[29]15*sums[28])/182
ma$ma6[38]&lt;-(19*sums[40]+17*sums[39]+15*sums[38]+13*sums[37]+11*sums[36]+9*sums[35]+7*sums[34]+5*sums[33]+3*sums[32]+1*sums[31]-1*sums[30]-3*sums[29]-5*sums[28])/91
ma$ma6[37]&lt;-(32*sums[40]+29*sums[39]+26*sums[38]+23*sums[37]+20*sums[36]+17*sums[35]+14*sums[34]+11*sums[33]+8*sums[32]+5*sums[31]+2*sums[30]-1*sums[29]4*sums[28])/182
ma$ma6[36]&lt;-(13*sums[40]+12*sums[39]+11*sums[38]+10*sums[37]+9*sums[36]+8*sums[35]+7*sums[34]+6*sums[33]+5*sums[32]+4*sums[31]+3*sums[30]+2*sums[29]+1*sums[28])/91
ma$ma6[35]&lt;(20*sums[40]+19*sums[39]+18*sums[38]+17*sums[37]+16*sums[36]+15*sums[35]+14*sums[34]+13*sums[33]+12*sums[32]+11*sums[31]+10*sums[30]+9*sums[29]+8*sums[28])/182
ma$ma7[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(29*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]10*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-13*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/120
ma$ma7[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(91*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+82*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+73*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+64*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+55*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+46*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+37*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+28*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-8*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-17*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]26*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-35*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/420
ma$ma7[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(161*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+146*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+131*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+116*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+101*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+86*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+71*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+56*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+41*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-19*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]34*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-49*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/840
ma$ma7[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(35*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+32*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]4*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/210
ma$ma7[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;(119*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+110*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+101*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+92*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+83*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+74*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+65*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+56*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+47*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+38*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]7*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/840
ma$ma7[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;(49*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+46*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+43*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+40*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+37*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+34*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+31*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+28*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+25*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+22*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+1 6*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]+7*su
ms[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/420
ma$ma7[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]&lt;(77*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+74*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+71*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+68*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+65*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+62*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+59*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+56*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+53*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+52*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+49*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+46*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+43*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]+40*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]+37*s
ums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/840
ma$ma7[40]&lt;-(29*sums[40]+26*sums[39]+23*sums[38]+20*sums[37]+17*sums[36]+14*sums[35]+11*sums[34]+8*sums[33]+5*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]10*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-13*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/120
ma$ma7[39]&lt;-(91*sums[40]+82*sums[39]+73*sums[38]+64*sums[37]+55*sums[36]+46*sums[35]+37*sums[34]+28*sums[33]+19*sums[32]+10*sums[31]+1*sums[30]-8*sums[29]17*sums[28]-26*sums[27]-35*sums[26])/420
ma$ma7[38]&lt;-(161*sums[40]+146*sums[39]+131*sums[38]+116*sums[37]+101*sums[36]+86*sums[35]+71*sums[34]+56*sums[33]+41*sums[32]+26*sums[31]+11*sums[30]-4*sums[29]19*sums[28]-34*sums[27]-49*sums[26])/840
ma$ma7[37]&lt;-(35*sums[40]+32*sums[39]+29*sums[38]+26*sums[37]+23*sums[36]+20*sums[35]+17*sums[34]+14*sums[33]+11*sums[32]+8*sums[31]+5*sums[30]+2*sums[29]1*sums[28]-4*sums[27]-7*sums[26])/210
ma$ma7[36]&lt;(119*sums[40]+110*sums[39]+101*sums[38]+92*sums[37]+83*sums[36]+74*sums[35]+65*sums[34]+56*sums[33]+47*sums[32]+38*sums[31]+29*sums[30]+20*sums[29]+11*sums[28]+2*su
ms[27]-7*sums[26])/840
ma$ma7[35]&lt;(49*sums[40]+46*sums[39]+43*sums[38]+40*sums[37]+37*sums[36]+34*sums[35]+33*sums[34]+30*sums[33]+27*sums[32]+24*sums[31]+21*sums[30]+18*sums[29]+15*sums[28]+12*sums
[27]+9*sums[26])/420
ma$ma7[34]&lt;(77*sums[40]+74*sums[39]+71*sums[38]+68*sums[37]+65*sums[36]+61*sums[35]+58*sums[34]+55*sums[33]+52*sums[32]+49*sums[31]+46*s ums[30]+43*sums[29]+40*sums[28]+37*sums
[27]+34*sums[26])/840
        </p>
      </sec>
      <sec id="sec-4-9">
        <title>Data visualization:</title>
        <p>ma %&gt;%
gather(metric, sums, ma1:ma7) %&gt;%
ggplot(aes(dates,sums, color = metric)) +
geom_line(size=1)</p>
        <p>Visualization of the moving average at k=5:
ggplot(viewh,mapping= aes(x=dates)) + geom_line(mapping= aes(y=likes, col="Real"),lwd=1.5) +
geom_line(mapping= aes(y=ma$ma2, col="ma2"),lwd=1.5)+scale_color_manual(values=
c("Real"="blue","ma2"="red"))+ theme(legend.title = element_blank()) + labs(x="",y="Likes")</p>
      </sec>
      <sec id="sec-4-10">
        <title>Finding turning points:</title>
        <p>tp1 &lt;- turnpoints(ma$ma1)
summary(tp1)
tp2 &lt;- turnpoints(ma$ma2)</p>
      </sec>
      <sec id="sec-4-11">
        <title>Visualization of turning points: We are looking for the correlation coefficients of the smoothed values with the original ones, taking into account the fact that with each smoothing we subtract rows :</title>
        <p>cor(viewh$views,ma$ma7)</p>
        <p>Similarly, we do research for likes and dislikes. To implement Pollard's formula, we will use the
built-in method wma():
wma &lt;- viewh %&gt;%
select(dates, views) %&gt;%
mutate(wma1 = WMA(views, n = 3, wts = 1:3), wma2 = WMA(views, n = 5, wts = 1:5),
wma3 = WMA(views, n = 7, wts = 1:7), wma4 = WMA(views, n = 9, wts = 1:9),
wma5 = WMA(views, n = 11, wts = 1:11), wma6 = WMA(views, n = 13, wts = 1:13),
wma7 = WMA(views, n = 15, wts = 1:15))</p>
        <p>
          Using Kendel's formulas:
sums&lt;-views
wma$wma1[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(5*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]-sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ])/6
wma$wma1[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(-sums[38]+2*sums[39]+5*sums[40])/6
wma$wma2[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(3*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]-sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ])/5
wma$wma2[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(4*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ])/10
wma$wma2[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(4*sums[40]+3*sums[39]+2*sums[38]+sums[37])/10
wma$wma2[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(-sums[36]+sums[38]+2*sums[39]+3*sums[40])/5
wma$wma3[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(13*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ])/28
wma$wma3[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(5*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+0*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ])/14
wma$wma3[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(7*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ])/28
wma$wma3[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(7*sums[34]+6*sums[35]+5*sums[36]+4*sums[37]+3*sums[38]+2*sums[39]+sums[40])/28
wma$wma3[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;-(5*sums[40]+4*sums[39]+3*sums[38]+2*sums[37]+1*sums[36]+0*sums[35]+1*sums[34])/14
wma$wma3[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;-(13*sums[40]+10*sums[39]+7*sums[38]+4*sums[37]+sums[36]-2*sums[35]-5*sums[34])/28
wma$wma4[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(17*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/45
wma$wma4[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(56*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+47*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+38*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-16*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/180
wma$wma4[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(22*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/90
wma$wma4[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(32*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ])/180
wma$wma4[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;-(32*sums[40]+29*sums[39]+26*sums[38]+23*sums[37]+20*sums[36]+17*sums[35]+14*sums[34]+11*sums[33]+8*sums[32])/180
wma$wma4[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;-(22*sums[40]+19*sums[39]+16*sums[38]+13*sums[37]+10*sums[36]+7*sums[35]+4*sums[34]+sums[33]-2*sums[32])/90
wma$wma4[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]&lt;-(56*sums[40]+47*sums[39]+38*sums[38]+29*sums[37]+20*sums[36]+11*sums[35]+2*sums[34]-7*sums[33]-16*sums[32])/180
wma$wma4[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]&lt;-(17*sums[40]+14*sums[39]+11*sums[38]+8*sums[37]+5*sums[36]+2*sums[35]-1*sums[34]-4*sums[33]-7*sums[32])/45
wma$wma5[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(7*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+0*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-3*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/22
wma$wma5[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(15*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-3*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/55
wma$wma5[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(25*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+22*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/110
wma$wma5[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(10*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+0*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/55
wma$wma5[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;-(15*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+12*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ])/110
wma$wma5[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;-(15*sums[40]+14*sums[39]+13*sums[38]+12*sums[37]+11*sums[37]+10*sums[36]+9*sums[35]+8*sums[34]+7*sums[33]+6*sums[32]+5*sums[3 1])/110
wma$wma5[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]&lt;-(10*sums[40]+9*sums[39]+8*sums[38]+7*sums[37]+6*sums[37]+5*sums[36]+4*sums[35]+3*sums[34]+2*sums[33]+1*sums[32]+0*sums[31])/5 5
wma$wma5[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]&lt;-(25*sums[40]+22*sums[39]+19*sums[38]+16*sums[37]+13*sums[37]+10*sums[36]+7*sums[35]+4*sums[34]+sums[33]-2*sums[32]-5*sums[31])/110
wma$wma5[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]&lt;-(15*sums[40]+13*sums[39]+11*sums[38]+9*sums[37]+7*sums[37]+5*sums[36]+3*sums[35]+1*sums[34]-1*sums[33]-3*sums[32]-5*sums[31])/55
wma$wma5[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]&lt;-(7*sums[40]+6*sums[39]+5*sums[38]+4*sums[37]+3*sums[37]+2*sums[36]+1*sums[35]+0*sums[34]-1*sums[33]-2*sums[32]-3*sums[31])/22
wma$wma6[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(25*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+22*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-8*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-11*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/91
wma$wma6[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(44*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+39*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+34*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+24*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-6*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-11*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-15*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/182
wma$wma6[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(19*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+15*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-3*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-5*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/91
wma$wma6[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(32*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/182
wma$wma6[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;-(13*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+12*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+9*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+7*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+6*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+4*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+3*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref12">1 2</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/91
wma$wma6[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;-(20*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+18*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+16*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+15*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+12*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+9 *sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ])/182
wma$wma6[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]&lt;-(25*sums[40]+22*sums[39]+19*sums[38]+16*sums[37]+13*sums[36]+10*sums[35]+7*sums[34]+4*sums[33]+1*sums[32]-2*sums[31]-5*sums[30]-8*sums[29]11*sums[28])/91
wma$wma6[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]&lt;-(44*sums[40]+39*sums[39]+34*sums[38]+29*sums[37]+24*sums[36]+19*sums[35]+14*sums[34]+9*sums[33]+4*sums[32]-1*sums[31]-6*sums[30]-11*sums[29]15*sums[28])/182
wma$wma6[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]&lt;-(19*sums[40]+17*sums[39]+15*sums[38]+13*sums[37]+11*sums[36]+9*sums[35]+7*sums[34]+5*sums[33]+3*sums[32]+1*sums[31]-1*sums[30]-3*sums[29]5*sums[28])/91
wma$wma6[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]&lt;-(32*sums[40]+29*sums[39]+26*sums[38]+23*sums[37]+20*sums[36]+17*sums[35]+14*sums[34]+11*sums[33]+8*sums[32]+5*sums[31]+2*sums[30]-1*sums[29]4*sums[28])/182
wma$wma6[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]&lt;(13*sums[40]+12*sums[39]+11*sums[38]+10*sums[37]+9*sums[36]+8*sums[35]+7*sums[34]+6*sums[33]+5*sums[32]+4*sums[31]+3*sums[30] +2*sums[29]+1*sums[28])/91
wma$wma6[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]&lt;(20*sums[40]+19*sums[39]+18*sums[38]+17*sums[37]+16*sums[36]+15*sums[35]+14*sums[34]+13*sums[33]+12*sums[32]+11*sums[31]+10*sums[ 30]+9*sums[29]+8*sums[28])/182
wma$wma7[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(29*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]10*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-13*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/120
wma$wma7[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]&lt;-(91*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+82*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+73*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+64*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+55*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+46*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+37*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+28*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+1*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-8*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-17*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]26*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-35*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/420
wma$wma7[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]&lt;-(161*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+146*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+131*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+116*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+101*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+86*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+71*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+56*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+41*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]19*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]-34*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-49*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/840
wma$wma7[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]&lt;-(35*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+32*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+26*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+23*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+17*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+14*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+8*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+5*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]4*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/210
wma$wma7[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]&lt;(119*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+110*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+101*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+92*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+83*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+74*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+65*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+56*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+47*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+38*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+29*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+20*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+11*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]7*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/840
wma$wma7[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]&lt;(49*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+46*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+43*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+40*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+37*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+34*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+31*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+28*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+25*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+22*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+19*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+1 6*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+13*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]+10*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]+7*su
ms[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/420
wma$wma7[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]&lt;(77*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+74*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+71*sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]+68*sums[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]+65*sums[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]+62*sums[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]+59*sums[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]+56*sums[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]+53*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]+52*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]+49*sums[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]+46*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]+43*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]+40*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]+37*s
ums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/840
wma$wma7[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]&lt;-(29*sums[40]+26*sums[39]+23*sums[38]+20*sums[37]+17*sums[36]+14*sums[35]+11*sums[34]+8*sums[33]+5*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]-1*sums[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]-4*sums[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]-7*sums[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]10*sums[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]-13*sums[
          <xref ref-type="bibr" rid="ref15">15</xref>
          ])/120
wma$wma7[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]&lt;-(91*sums[40]+82*sums[39]+73*sums[38]+64*sums[37]+55*sums[36]+46*sums[35]+37*sums[34]+28*sums[33]+19*sums[32]+10*sums[31]+1*sums[30]-8*sums[29]17*sums[28]-26*sums[27]-35*sums[26])/420
wma$wma7[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]&lt;-(161*sums[40]+146*sums[39]+131*sums[38]+116*sums[37]+101*sums[36]+86*sums[35]+71*sums[34]+56*sums[33]+41*sums[32]+26*sums[31]+11*sums[30]-4*sums[29]19*sums[28]-34*sums[27]-49*sums[26])/840
wma$wma7[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]&lt;-(35*sums[40]+32*sums[39]+29*sums[38]+26*sums[37]+23*sums[36]+20*sums[35]+17*sums[34]+14*sums[33]+11*sums[32]+8*sums[31]+5*sums[30]+2*sums[29]1*sums[28]-4*sums[27]-7*sums[26])/210
wma$wma7[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]&lt;(119*sums[40]+110*sums[39]+101*sums[38]+92*sums[37]+83*sums[36]+74*sums[35]+65*sums[34]+56*sums[33]+47*sums[32]+38*sums[31]+29*sums[30]+20*sums[29]+11*sums[28]+2*su
ms[27]-7*sums[26])/840
wma$wma7[
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]&lt;(49*sums[40]+46*sums[39]+43*sums[38]+40*sums[37]+37*sums[36]+34*sums[35]+33*sums[34]+30*sums[33]+27*sums[32]+24*sums[31]+21*sums[30]+18*sums[29]+15*sums[28]+12*sums
[27]+9*sums[26])/420
wma$wma7[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]&lt;(77*sums[40]+74*sums[39]+71*sums[38]+68*sums[37]+65*sums[36]+61*sums[35]+58*sums[34]+55*sums[33]+52*sums[32]+49*sums[31]+46*sums[30]+43*sums[29]+40*sums[28]+37*sums
[27]+34*sums[26])/840
        </p>
      </sec>
      <sec id="sec-4-12">
        <title>Visualization of all graphs:</title>
        <p>wma %&gt;%
gather(metric, views, views:wma7) %&gt;%
ggplot(aes(dates, views, color = metric)) + geom_line(size=1)</p>
      </sec>
      <sec id="sec-4-13">
        <title>Graph visualization of real data and weighted data:</title>
        <p>ggplot(viewh,mapping= aes(x=dates)) + geom_line(mapping= aes(y=views, col="Real"),lwd=1.5) +
geom_line(mapping= aes(y=wma$wma2, col="ma2"),lwd=1.5)+
scale_color_manual(values= c("Real"="blue","ma2"="red"))+ theme(legend.title = element_blank()) +
labs(x="",y="Likes")</p>
        <p>Turning points:
tp1 &lt;- turnpoints(wma$wma1)
summary(tp1)
tp2 &lt;- turnpoints(wma$wma2)
summary(tp2)
tp3 &lt;- turnpoints(wma$wma3)
summary(tp3)
tp4 &lt;- turnpoints(wma$wma4)
summary(tp4)
tp5 &lt;- turnpoints(wma$wma5)
summary(tp5)
tp6 &lt;- turnpoints(wma$wma6)
summary(tp6)
tp7 &lt;- turnpoints(wma$wma7)
summary(tp7)</p>
      </sec>
      <sec id="sec-4-14">
        <title>Visualization of turning points:</title>
        <p>plot(wma$wma1, type = "l")
lines(tp1)</p>
        <p>Correlation coefficients of weighted smoothed data with the original:
cor(wma$views,wma$wma1)
cor(wma$views,wma$wma2)
cor(wma$views,wma$wma3)
cor(wma$views,wma$wma4)
cor(wma$views,wma$wma5)
cor(wma$views,wma$wma6)
cor(wma$views,wma$wma7)</p>
        <p>
          Exponential smoothing:
alpha&lt;-0.1
sums&lt;-views
exp_smooth&lt;-1:40
exp_smooth[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]
for(i in 2:40){
        </p>
        <p>exp_smooth[i]&lt;-sums[i]*alpha +(1-alpha)*exp_smooth[i-1]
}
viewh&lt;-data.frame(dates,sums,exp_smooth) #save date into structure</p>
      </sec>
      <sec id="sec-4-15">
        <title>Visualization:</title>
        <p>ggplot(viewh,mapping= aes(x=dates)) + geom_line(mapping= aes(y=sums, col="Real"),lwd=1.5) +
geom_line(mapping= aes(y=exp_smooth, col="es"),lwd=1.5)+
scale_color_manual(values= c("Real"="blue","es"="red"))+ labs(x="",y="Views",title ="alpha = 0.3")+
theme(legend.title = element_blank(),plot.title = element_text(hjust = 0.5))</p>
      </sec>
      <sec id="sec-4-16">
        <title>Turning points:</title>
        <p>tp_es&lt;-turnpoints(exp_smooth)
summary(tp_es)</p>
      </sec>
      <sec id="sec-4-17">
        <title>Visualization of turning points:</title>
        <p>plot(views, type = "l")
lines(tp_es)</p>
      </sec>
      <sec id="sec-4-18">
        <title>Correlation coefficient of smoothed and real values: cor(views,exp_smooth)</title>
      </sec>
      <sec id="sec-4-19">
        <title>Median filtering</title>
        <p>
          med_fil&lt;-1:40
med_fil[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]&lt;-(5*sums[
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]+2*sums[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]-sums[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ])/6
med_fil[40]&lt;-(-sums[38]+2*sums[39]+5*sums[40])/6
for(i in 2:39){med_fil[i]&lt;-max(min(sums[i-1],sums[i]),min(sums[i],sums[i+1]),min(sums[i-1],sums[i+1]))}
viewh&lt;-data.frame(dates,views,med_fil)
        </p>
      </sec>
      <sec id="sec-4-20">
        <title>Visualization:</title>
        <p>ggplot(viewh,mapping= aes(x=dates)) + geom_line(mapping= aes(y=views, col="Real"),lwd=1.5) +
geom_line(mapping= aes(y=med_fil, col="Median"),lwd=1.5)+
scale_color_manual(values= c("Real"="blue","Median"="red"))+
labs(x="",y="Views",title ="Median filter")+
theme(legend.title = element_blank(),plot.title = element_text(hjust = 0.5))</p>
      </sec>
      <sec id="sec-4-21">
        <title>Turning points:</title>
        <p>tp_mf&lt;-turnpoints(med_fil)
summary(tp_mf)
plot(views, type = "l")
lines(tp_mf)</p>
      </sec>
      <sec id="sec-4-22">
        <title>Visualization of turning points:</title>
      </sec>
      <sec id="sec-4-23">
        <title>Correlation coefficient: cor(views,med_fil)</title>
        <p>In general, correlation can be described as any statistical relationship of data. Correlation allows us
to see the trends of changes in the average values of the functions depending on the parameter changes.
Correlation can be positive or negative. Negative correlation is a correlation in which an increase in one
variable is associated with a decrease in another, and the correlation coefficient is negative. Positive
correlation is a correlation in which an increase in one variable is associated with an increase in another,
and the correlation coefficient is positive.</p>
      </sec>
      <sec id="sec-4-24">
        <title>Construction of the correlation field (plot)</title>
        <p>plot(dt$likes, dt$dislikes, main="Correlation field",xlab="Likes", ylab="Dislikes")
Correlation coefficient: cor(dt$views, dt$dislikes)</p>
      </sec>
      <sec id="sec-4-25">
        <title>Correlation relation:</title>
        <p>ggscatter(dt, x = 'likes', y = 'dislikes', add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson", xlab = "Likes", ylab = "Dislikes")</p>
      </sec>
      <sec id="sec-4-26">
        <title>Construction of graphs of autocorrelation functions:</title>
        <p>data &lt;- cbind(dt$likes, dt$dislikes)
colnames(data) &lt;- c("Likes", "Dislikes")
autocorelation &lt;- acf(data, lag.max = 1,type = c("correlation"), plot = TRUE,
xlab="Likes", ylab="Dislikes")</p>
      </sec>
      <sec id="sec-4-27">
        <title>Separation of data into 3 parts:</title>
        <p>part1 &lt;- dt$likes[1:2666]
part2 &lt;- dt$likes[2667:5332]
part3 &lt;- dt$likes[5333:7998]</p>
      </sec>
      <sec id="sec-4-28">
        <title>A correlation matrix was constructed for the parts (rcorr):</title>
      </sec>
      <sec id="sec-4-29">
        <title>Finding multiple correlation coefficients:</title>
        <p>mydata.rcorr = rcorr(as.matrix(cbind(part1, part2, part3)))
numericData &lt;- cbind(dt$id, dt$views, dt$likes, dt$dislikes, dt$category_id, dt$comment_total)
chart.Correlation(numericData, histogram=TRUE, pch=19)</p>
        <p>Cluster analysis itself is not a separate algorithm, but a general task that needs to be solved.
Therefore, this general task consists in grouping objects in such a way that the grouped objects are more
similar to each other compared to other grouped objects, and the given groups are called clusters, and
to conduct an analysis of these clusters through experiments. This analysis can be carried out with the
help of different algorithms, although the concept of a "cluster" and how to find it can differ greatly
between these algorithms, it is the understanding of the cluster model of this or that algorithm that is
the key stage to a successful research analysis. Construction of a graphical representation of clustering:</p>
      </sec>
      <sec id="sec-4-30">
        <title>K-means clustering and clustering matrix:</title>
        <p>set.seed(55)
cluster &lt;- kmeans(cbind(dt$channel_title, dt$dislikes), 4, nstart = 20)
cluster
table(cluster$cluster, dt$category_id)</p>
      </sec>
      <sec id="sec-4-31">
        <title>Construction of a dendrogram:</title>
        <p>rdata &lt;- cbind(dt$category_id)
rdata &lt;- na.omit(rdata)
data.hclust = hclust(dist(rdata), method = "single")
plot(data.hclust, labels = FALSE, hang = -1)</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Results</title>
      <sec id="sec-5-1">
        <title>Display likes and dislikes on a graph over time:</title>
        <p>From the graph, you can already see a slight dependence between the number of likes and dislikes.
Using Kendel's formulas, we obtained initial and final values that were lost in the calculation of
averages, depending on the average by which we calculate the data. It can be noted that ma4, ma5, ma6,
ma7 are not very suitable for identifying trends, since we do not have a large date interval, only 40 days.</p>
      </sec>
      <sec id="sec-5-2">
        <title>For more accurate detection of trends, it is advisable to take ma1, ma2 or ma3.</title>
        <p>This graph clearly shows when we have a trend change. The correlation coefficients are quite large
and positive, which is logical, since they directly depend on the data.</p>
        <p>It can be noted that ma4, ma5, ma6, ma7 are not very suitable for identifying trends, since we do not
have a large date interval, only 40 days. For more accurate detection of trends, it is advisable to take
ma1, ma2 or ma3.</p>
        <p>It can be noted that ma4, ma5, ma6, ma7 are not very suitable for identifying trends, since we do not
have a large date interval, only 40 days. For more accurate detection of trends, it is advisable to take
ma1, ma2 or ma3.</p>
        <p>The number of turning points allows better analysis of trends. As we can see, the trends of the views
attribute are best viewed. This is due to the peculiarity of the data. Correlation coefficients are close to
1 and decrease as the step increases, as less and less data will affect the average. As in the case of a
simple moving average, for our data it is better not to use averages with a step greater than 7 to get more
accurate information. We can notice a noticeable difference between the graphs of the simple moving
average and the weighted moving average. This is due to the fact that the weighted moving average
reacts to changes more quickly than the simple moving average. This may allow us to predict, although
the results will be quite imprecise, as smoothing methods are not designed to predict.</p>
        <p>Compared to a simple moving average chart, we can say that the weighted moving average is more
suitable for spotting trends in a time series.</p>
        <p>As the step increases, the correlation coefficient decreases, since the values have less influence on
the average. Exponential smoothing directly depends on the latest data, i.e. how the weighted average
will react quickly to changes.</p>
        <p>Median smoothing completely removes single extreme or anomalous values of levels that are
separated from each other by at least half of the smoothing interval; preserves sharp changes in the trend
(moving average and exponential smoothing smooth them); effectively removes single levels with very
large or very small values that are random in nature and stand out sharply from other levels.</p>
        <p>As can be seen from fig. 31-33, median filtering eliminated random levels that are random in nature.</p>
      </sec>
      <sec id="sec-5-3">
        <title>As a result, we have a more stable schedule.</title>
        <p>Note that the correlation is high, because the median filtering does not calculate, does not generalize,
but shows the median on a certain interval. That is why median filtering is very effective when studying
time series.</p>
        <p>This value shows us a rather obvious influence of the number of views on the number of dislikes of
videos on the YouTube platform.</p>
        <p>Thanks to this correlation graph, we can observe that with a rapid increase in the number of likes,
the number of dislikes also increases, albeit slightly.</p>
        <p>From this visualization, it is possible to conclude that our board is stationary, and since the data on
any interval are not equal to zero, their regularity follows. We can conclude that the attribute by which
the matrix is built is quite homogeneous, which is logical, because this attribute is likes.</p>
        <p>From this visualization, we can see that there are quite strong relationships between attributes, but
there are also negative correlation coefficient results.</p>
        <p>Again, as it was proven before, as the number of likes increases, the number of views increases.
Although the clusters on the visualization are quite difficult to distinguish, it is possible to generally
identify two clusters, namely, light blue spots - the relationship of a high number of views and likes,
dark blue spots - a small number of these attributes.</p>
      </sec>
      <sec id="sec-5-4">
        <title>According to this matrix, it is difficult to determine which cluster is built and according to which parameter, that is, there are no clear boundaries.</title>
        <p>The dendrogram was constructed without labels, in order to facilitate the understanding of the
number of levels of clustering between categories of video content on the YouTube platform,
sacrificing, unfortunately, the hierarchical relationship between objects.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Discussion</title>
      <p>For a better analysis of the categories, let's find out the names of the categories that correspond to
the identifiers: 1 - movies and cartoons, 10 - music, 15 - pets and animals, 17 - sports, 19 - travel, 20
games, 22 - people and blogs, 23 - humor, 24 - entertainment, 25 - news and politics, 26 - style, 27
education, 28 - science and technology, 29 - non-profit and activism.</p>
      <p>It can be seen from the histogram that the most popular categories are categories with identifiers 24,
10, 22, 28, that is, people are most interested in watching thoughtful videos or other people.</p>
      <p>This graph clearly shows when we have a change in the viewing trend. A simple moving average
got rid of the noise, but you have to take into account that the platform must be in trend.</p>
      <p>A simple moving average is suitable for identifying trends in the past, which will help us predict the
future with less error. However, for such a large and popular platform as YouTube, it is necessary to
analyze the latest events. For this, they need methods that quickly respond to the latest data. When
working on such methods, we used the weighted moving average smoothing method and exponential
smoothing.</p>
      <p>Another method is median smoothing with the size of the smoothing interval w = 3.</p>
      <p>We can note that the general trends in the above graphs (Figs. 42-44) are practically identical, which
makes both methods suitable for working with the selected dataset.</p>
      <p>Thanks to the correlation relationship, we can observe that with a rapid increase in the number of
likes, the number of dislikes also increases, albeit slightly. Analyzing other graphs, we can conclude
that when the number of views increases, the number of likes increases, and therefore the number of
dislikes increases.</p>
      <p>Thanks to this correlation graph, we can observe that with a rapid increase in the number of likes,
the number of dislikes also increases, albeit slightly.</p>
      <p>Again, as it was proven before, as the number of likes increases, the number of views increases.
Although the clusters on the visualization are quite difficult to distinguish, it is possible to generally
identify two clusters, namely, light blue spots - the relationship of a high number of views and likes,
dark blue spots - a small number of these attributes.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusions</title>
      <p>A simple moving average is suitable for identifying trends in the past, which will help us predict the
future with less error. However, for such a large and popular platform as YouTube, it is necessary to
analyse the latest events. To do this, they need methods that quickly respond to the latest data. During
the calculation and graphic work on such methods, we studied the weighted moving average smoothing
method and exponential smoothing. Analysing this dataset, we learned that people like to watch videos
from the categories "Music", "Entertainment" or "People and blogs" the most. These categories account
for the largest number of likes and views. At the same time, the most dislikes fell on the "People and
blogs" category. This can be explained by the fact that people often differ in their opinions and they
simply do not agree with what was said in the video. It is also worth noting that the relationship between
the number of likes, dislikes and the number of views was investigated. There is a direct relationship
between them, so when one of these attributes increases, the others will also increase. It turned out to
be an interesting fact that topics related to science and technology have recently become more and more
popular. However, the difference between likes and dislikes is significantly in favour of likes, which
means that people are mostly happy when they consume YouTube content.
8. References</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>[1] Most popular social networks worldwide as of 2023, ranked by number of monthly active users</article-title>
          : https://www.statista.com/statistics/272014/global-social
          <article-title>-networks-ranked-by-number-of-users/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Mohsin</surname>
          </string-name>
          . 10
          <string-name>
            <given-names>YouTube</given-names>
            <surname>Stats Every Marketer Should Know</surname>
          </string-name>
          In 2022 [Infographic]. URL: https://www.oberlo.com/blog/youtube-statistics
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>Dean</surname>
          </string-name>
          . How Many People Use YouTube in
          <year>2023</year>
          ? [
          <article-title>New Data]</article-title>
          . URL: https://backlinko.com/youtube-users#youtube-statistics
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R. F.</given-names>
            <surname>Alhujaili</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. M.</given-names>
            <surname>Yafooz</surname>
          </string-name>
          , ().
          <article-title>Sentiment analysis for youtube videos with user comments</article-title>
          .
          <source>In 2021 International Conference on Artificial Intelligence and Smart Systems</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>814</fpage>
          -
          <lpage>820</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <article-title>[5] How YouTube changed the world</article-title>
          . URL: https://s.telegraph.co.uk/graphics/projects/youtube/
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S.</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Yadava</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. P.</given-names>
            <surname>Roy</surname>
          </string-name>
          ,
          <article-title>Fusion of EEG response and sentiment analysis of products review to predict customer satisfaction</article-title>
          .
          <source>Information Fusion</source>
          ,
          <volume>52</volume>
          (
          <year>2019</year>
          )
          <fpage>41</fpage>
          -
          <lpage>52</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>V.V.</given-names>
            <surname>Hnatushenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. I.</given-names>
            <surname>Kogut</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. V.</given-names>
            <surname>Uvarov</surname>
          </string-name>
          , On Optimal 2-
          <string-name>
            <given-names>D</given-names>
            <surname>Domain Segmentation</surname>
          </string-name>
          <article-title>Problem via Piecewise Smooth Approximation of Selective Target Mappings</article-title>
          .
          <source>Journal of Optimization, Differential Equations and Their Applications</source>
          <volume>27</volume>
          (
          <issue>2</issue>
          ) (
          <year>2019</year>
          ).
          <fpage>60</fpage>
          -
          <lpage>95</lpage>
          . DOI:
          <volume>10</volume>
          .15421/141908.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Hnatushenko</surname>
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kogut</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Uvarov</surname>
            <given-names>M</given-names>
          </string-name>
          .
          <article-title>On Satellite Image Segmentation via Piecewise Constant Approximation of Selective Smoothed Target Mapping</article-title>
          , Applied Mathematic
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>L. P.</given-names>
            <surname>Morency</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Mihalcea</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Doshi</surname>
          </string-name>
          ,
          <article-title>Towards multimodal sentiment analysis: Harvesting opinions from the web</article-title>
          .
          <source>In Proceedings of the 13th international conference on multimodal interfaces</source>
          ,
          <year>2011</year>
          , pp.
          <fpage>169</fpage>
          -
          <lpage>176</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>V.</given-names>
            <surname>Vysotska</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Markiv</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Teslia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Romanova</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Pihulechko</surname>
          </string-name>
          ,
          <source>Correlation Analysis of Text Author Identification Results Based on N-Grams Frequency Distribution in Ukrainian Scientific and Technical Articles, CEUR Workshop Proceedings</source>
          , Vol-
          <volume>3171</volume>
          (
          <year>2022</year>
          )
          <fpage>277</fpage>
          -
          <lpage>314</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>N.</given-names>
            <surname>Romanyshyn</surname>
          </string-name>
          ,
          <article-title>Algorithm for Disclosing Artistic Concepts in the Correlation of Explicitness and Implicitness of Their Textual Manifestation</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          <volume>2870</volume>
          (
          <year>2021</year>
          )
          <fpage>719</fpage>
          -
          <lpage>730</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yusyn</surname>
          </string-name>
          , T. Zabolotnia,
          <article-title>Methods of Acceleration of Term Correlation Matrix Calculation in the Island Text Clustering Method</article-title>
          ,
          <source>CEUR workshop proceedings</source>
          , Vol-
          <volume>2604</volume>
          (
          <year>2020</year>
          )
          <fpage>140</fpage>
          -
          <lpage>150</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>B.</given-names>
            <surname>Rusyn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Ostap</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Ostap</surname>
          </string-name>
          ,
          <article-title>A correlation method for fingerprint image recognition using spectral features</article-title>
          ,
          <source>in: Proceedings of the International Conference on Modern Problems of Radio Engineering</source>
          , Telecommunications and Computer Science, TCSET,
          <year>2002</year>
          , pp.
          <fpage>219</fpage>
          -
          <lpage>220</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>S.</given-names>
            <surname>Voloshyn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Markiv</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Vysotska</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Dyyak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Chyrun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Panasyuk</surname>
          </string-name>
          ,
          <article-title>Emotion Recognition System Project of English Newspapers to Regional E-Business Adaptation</article-title>
          ,
          <source>in: IEEE 17th International Conference on Computer Sciences and Information Technologies (CSIT)</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>392</fpage>
          -
          <lpage>397</lpage>
          , doi: 10.1109/CSIT56902.
          <year>2022</year>
          .
          <volume>10000527</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>N.</given-names>
            <surname>Kholodna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Vysotska</surname>
          </string-name>
          ,
          <string-name>
            <surname>S. Albota,</surname>
          </string-name>
          <article-title>A Machine Learning Model for Automatic Emotion Detection from Speech</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          , Vol-
          <volume>2917</volume>
          (
          <year>2021</year>
          )
          <fpage>699</fpage>
          -
          <lpage>713</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>M.</given-names>
            <surname>Hryntus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dilai</surname>
          </string-name>
          ,
          <article-title>Translating emotion metaphors from English into Ukrainian: based on the parallel corpus of fiction</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          , Vol-
          <volume>3171</volume>
          (
          <year>2022</year>
          )
          <fpage>737</fpage>
          -
          <lpage>750</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>O.</given-names>
            <surname>Bisikalo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Kovenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Bogach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Chorna</surname>
          </string-name>
          ,
          <article-title>Explaining Emotional Attitude Through the Task of Image-captioning</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          , Vol-
          <volume>3171</volume>
          (
          <year>2022</year>
          )
          <fpage>1056</fpage>
          -
          <lpage>1065</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>K.</given-names>
            <surname>Smelyakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Bohomolov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kizitskyi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Chupryna</surname>
          </string-name>
          ,
          <article-title>Identification of Modern Facial Emotion Recognition Models</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          , Vol-
          <volume>3171</volume>
          (
          <year>2022</year>
          )
          <fpage>1267</fpage>
          -
          <lpage>1281</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>D.</given-names>
            <surname>Nazarenko</surname>
          </string-name>
          , I. Afanasieva,
          <string-name>
            <given-names>N.</given-names>
            <surname>Golian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Golian</surname>
          </string-name>
          ,
          <article-title>Investigation of the Deep Learning Approaches to Classify Emotions in Texts</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          , Vol-
          <volume>2870</volume>
          (
          <year>2021</year>
          )
          <fpage>206</fpage>
          -
          <lpage>224</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>I.</given-names>
            <surname>Bekhta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Hrytsiv</surname>
          </string-name>
          ,
          <source>Computational Linguistics Tools in Mapping Emotional Dislocation of Translated Fiction, CEUR Workshop Proceedings</source>
          , Vol-
          <volume>2870</volume>
          (
          <year>2021</year>
          )
          <fpage>685</fpage>
          -
          <lpage>699</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>I.</given-names>
            <surname>Spivak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Krepych</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Fedorov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Spivak</surname>
          </string-name>
          ,
          <article-title>Approach to Recognizing of Visualized Human Emotions for Marketing Decision Making Systems</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          , Vol-
          <volume>2870</volume>
          (
          <year>2021</year>
          )
          <fpage>1292</fpage>
          -
          <lpage>1301</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>P.C.</given-names>
            <surname>Thoumelin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Grabar</surname>
          </string-name>
          ,
          <article-title>Subjectivity in the medical discourse: On uncertainty and emotional markers</article-title>
          , Revue des Nouvelles Technologies de l'Information, E.
          <volume>26</volume>
          (
          <year>2014</year>
          )
          <fpage>455</fpage>
          -
          <lpage>466</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>N.</given-names>
            <surname>Grabar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.O.</given-names>
            <surname>Dumonet</surname>
          </string-name>
          ,
          <article-title>Automatic computing of global emotional polarity in French health forum messages</article-title>
          ,
          <source>Lecture Notes in Computer Science</source>
          <volume>9105</volume>
          (
          <year>2015</year>
          )
          <fpage>243</fpage>
          -
          <lpage>248</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>