The least squares method with Despacito

stats con chris
2022-03-27
0

...

II. Methodology: The equation of a line

We define the linear equations of Despacito ($d$) and See You Again ($s$) as,

$$ \begin{align} y_{d} &= m_d x + b_d, \tag 9 \\ z_{s} &= m_s x + b_s. \tag{10} \end{align} $$

Considering the analytical expressions previously obtained we have,

$$\begin{align} m_d &= \frac{n \sum_i^n y_i x_i – \sum_i^n y_i \sum_i^n x_i}{n\sum_i^n x_i^2 – (\sum_i^n x_i)^2}, \tag{11} \\ b_{d} &=\frac{\sum_i^n y_i\sum_i^n x_i^2 – \sum_i^n y_i x_i \sum_i^n x_i }{n\sum_i^n x_i^2 – (\sum_i^n x_i)^2}. \tag{12} \end{align}$$

and

$$\begin{align} m_s &= \frac{n \sum_i^n z_i x_i – \sum_i^n z_i \sum_i^n x_i}{n\sum_i^n x_i^2 – (\sum_i^n x_i)^2}, \tag{13}\\ b_{s} &=\frac{\sum_i^n z_i\sum_i^n x_i^2 – \sum_i^n z_i x_i \sum_i^n x_i }{n\sum_i^n x_i^2 – (\sum_i^n x_i)^2}. \tag{14} \end{align}$$

To determine the numerical values of m and b we make use of the data given in Table I, refer to page 2. In this way we generate the following tables:

Table II: Despacito data.
Day ($x$) Despacito ($y$) $\lower 0.8em {y_ix_i}$ $x_i^2$
4 2310 9240 16
5 2328 11640 25
6 2348 14088 36
7 2369 16583 49
8 2393 19144 64
9 2415 21735 81
$\sum_i^6 x_i = 39$ $\sum_i^6 y_i =14163$ $\sum_i^6 y_i x_i =92430$ $\sum_i^6 x_i^2 = 271$
Table III: See You Again data.
Day ($x$) See You Again ($z$) $\lower 0.8em {z_ix_i}$ $x_i^2$
4 2872.8 11491.2 16
5 2875.9 14379.5 25
6 2879.0 17274.0 36
7 2882.2 20175.4 49
8 2885.7 23085.6 64
9 2889.0 26001.0 81
$\sum_i^6 x_i = 39$ $\sum_i^6 z_i =17284.6$ $\sum_i^6 z_i x_i =112406.7$ $\sum_i^6 x_i^2 = 271$

For Despacito, we replace the data given in Table II in Eqs. (11) and (12). For See You Again, we replace the data given in Table III in Eqs. (13) and (14). Then,

$$\begin{align} m_d &= \frac{6 \times 92430 – 14163\times 39}{6\times 271 – (39)^2} = 21.2, \tag{15} \\ b_{d} &=\frac{14163 \times 271 – 92430\times 39 }{6\times 271 – (39)^2} = 2222.9. \tag{16} \end{align}$$

and

$$\begin{align} m_s &= \frac{6 \times 112406.7 – 17284.6\times 39}{6\times 271 – (39)^2} = 3.2, \tag{17} \\ b_{s} &=\frac{17284.6 \times 271 – 112406.7\times 39 }{6\times 271 – (39)^2} = 2859.7. \tag{18} \end{align} $$

Finally, the linear equations are given by,

$$\begin{align} y_d &= 21.2 x + 2222.9, \tag{19} \\ z_s &= 3.2 x + 2859.7. \tag{20} \end{align}$$

The point where these lines intersect defines the moment when Despacito surpasses See You Again and becomes the most viewed video on YouTube. The resolution of this problem is described on the next page.

Views: 1 Github

stats con chris

A writer who learned to add

A writer who learned to add

Notifications

Receive the new articles in your email

2022 © nepy

One single breath

Configure

Choose your own style

Color

Choose the perfect color mode for you


Navigation Position

Select a suitable navigation system


Vertical Navbar Style

Switch between styles for your vertical navbar

Customize