The least squares method with Despacito

stats con chris
2022-03-27
0

...

II. Methodology: The least squares method

The differential equations given in the previous page are solved as follows. For $m_d$ we have,

$$\begin{align} 0 &=\frac{\partial \xi}{\partial m_{d}}, \\ 0 &= \frac{\partial}{\partial m_{d}} \left( \sum_i^n (m_{d} x_i + b_{d} - y_i)^2 \right), \\ 0 &=\sum_i^n 2 (m_{d} x_i + b_{d} - y_i) \times x_i, \\ 0 &= m_d\sum_i^n x_i^2 + b_d\sum_i^n x_i - \sum_i^n y_i x_i. \tag{4} \end{align} $$

Similarly for $b_d$ we have,

$$\begin{align} 0&=\frac{\partial \xi}{\partial b_{d}}, \\ 0 &= \frac{\partial}{\partial b_{d}} \left( \sum_i^n (m_{d} x_i + b_{d} – y_i)^2 \right), \\ 0&=\sum_i^n 2 (m_{d} x_i + b_{d} – y_i), \\ 0&= m_d \sum_i^n x_i + b_{d} n – \sum_i^n y_i, \\ b_{d} &=\frac{ \sum_i^n y_i – m_d \sum_i^n x_i}{n}, \\ b_{d} \sum_i^n x_i &=\frac{ \sum_i^n y_i \sum_i^n x_i – m_d (\sum_i^n x_i)^2}{n}. \tag{5} \end{align} $$

Replacing Eq. (5) in Eq. (4) we get,

$$\begin{align} 0&= m_d\sum_i^n x_i^2 + b_d\sum_i^n x_i – \sum_i^n y_i x_i, \\ 0&= m_d\sum_i^n x_i^2 + \frac{ \sum_i^n y_i \sum_i^n x_i – m_d (\sum_i^n x_i)^2}{n} – \sum_i^n y_i x_i, \\ 0 &= m_d n\sum_i^n x_i^2 + \sum_i^n y_i \sum_i^n x_i – m_d (\sum_i^n x_i)^2 – n \sum_i^n y_i x_i, \\ 0 &= m_d [n\sum_i^n x_i^2 – (\sum_i^n x_i)^2] + \sum_i^n y_i \sum_i^n x_i – n \sum_i^n y_i x_i, \\ 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 6 \end{align} $$

Eq. (6) gives us the value of $m_d$. To obtain $b_d$, we replace Eq. (6) in Eq. (5),

$$\begin{align} b_{d} &=\frac{ \sum_i^n y_i – m_d \sum_i^n x_i}{n}, \\ b_{d} n &=\sum_i^n y_i – \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} \sum_i^n x_i, \\ b_{d} n &=\sum_i^n y_i – \frac{n \sum_i^n y_i x_i \sum_i^n x_i – \sum_i^n y_i (\sum_i^n x_i)^2}{n\sum_i^n x_i^2 – (\sum_i^n x_i)^2},\\ b_{d} n &=\frac{\sum_i^n y_i (n\sum_i^n x_i^2 – (\sum_i^n x_i)^2) – (n \sum_i^n y_i x_i \sum_i^n x_i – \sum_i^n y_i (\sum_i^n x_i)^2)}{n\sum_i^n x_i^2 – (\sum_i^n x_i)^2},\\ b_{d} n &=\frac{n\sum_i^n y_i\sum_i^n x_i^2 – n \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},\\ 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 7 \end{align}$$

Consequently, the equation of the line reads,

$$\begin{align} y_{d} &= m_d x + b_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} x + \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 8 \end{align}$$

In our case, to obtain the numerical values of $m_d$ and $b_d$, we make use of the data given in Table I, refer to page 2. The resolution of Eq. (8) 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