Template:Least squares (linear regression)

Least Squares (Linear Regression)
The parameters can also be estimated using a mathematical approach. To do this, apply least squares analysis on Eqn. (eq73):


 * $$\ln ({{\hat{m}}_{c}})=\ln (b)+\alpha \ln (T)$$

And for simplicity in the calculations, let:


 * $$\begin{align}

& \ln ({{m}_{ci}})= & {{Y}_{i}} \\ & \ln (b)= & a \\ & \alpha = & c \\ & \ln ({{T}_{i}})= & {{X}_{i}} \end{align}$$

Therefore, Eqn. (mc) becomes:


 * $${{Y}_{i}}=\widehat{a}+\widehat{c}{{X}_{i}}$$

Assume that a set of data pairs $$({{X}_{1}},{{Y}_{1}})$$,  $$({{X}_{2}},{{Y}_{2}})$$ ,...,  $$({{X}_{N}},{{Y}_{N}})$$  were obtained and plotted. Then according to the Least Squares Principle, which minimizes the vertical distance between the data points and the straight line fitted to the data, the best fitting straight line to this data set is the straight line $$Y=\widehat{a}+\widehat{c}X$$  such that:


 * $$\underset{i=1}{\overset{N}{\mathop \sum }}\,{{(\widehat{a}+\widehat{c}{{X}_{i}}-{{Y}_{i}})}^{2}}=\underset{(a,c)}{\mathop{min}}\,\underset{i=1}{\overset{N}{\mathop \sum }}\,{{(a+c{{X}_{i}}-{{Y}_{i}})}^{2}}$$

And where $$\widehat{a}$$  and  $$\widehat{c}$$  are the least squares estimates of  $$a$$  and  $$c$$. To obtain $$\widehat{a}$$  and  $$\widehat{c}$$, let:


 * $$F=\underset{i=1}{\overset{N}{\mathop \sum }}\,{{(a+c{{X}_{i}}-{{Y}_{i}})}^{2}}$$

Differentiating $$F$$  with respect to  $$a$$  and  $$c$$  yields:


 * $$\frac{\partial F}{\partial a}=2\underset{i=1}{\overset{N}{\mathop \sum }}\,(a+c{{X}_{i}}-{{Y}_{i}})$$


 * and:


 * $$\frac{\partial F}{\partial c}=2\underset{i=1}{\overset{N}{\mathop \sum }}\,(a+c{{X}_{i}}-{{Y}_{i}}){{X}_{i}}$$

Set Eqns. (ls2) and (ls3) equal to zero:


 * $$\underset{i=1}{\overset{N}{\mathop \sum }}\,(a+c{{X}_{i}}-{{Y}_{i}})=\underset{i=1}{\overset{N}{\mathop \sum }}\,(\widehat-{{Y}_{i}})=-\underset{i=1}{\overset{N}{\mathop \sum }}\,({{Y}_{i}}-\widehat)=0$$


 * and:


 * $$\underset{i=1}{\overset{N}{\mathop \sum }}\,(a+c{{X}_{i}}-{{Y}_{i}}){{X}_{i}}=\underset{i=1}{\overset{N}{\mathop \sum }}\,(\widehat-{{Y}_{i}}){{X}_{i}}=-\underset{i=1}{\overset{N}{\mathop \sum }}\,({{Y}_{i}}-\widehat){{X}_{i}}=0$$

Solve the equations simultaneously:
 * and:


 * $$\widehat{c}=\frac{\underset{i=1}{\overset{N}{\mathop{\sum }}}\,{{X}_{i}}{{Y}_{i}}-\tfrac{\left( \underset{i=1}{\overset{N}{\mathop{\sum }}}\,{{X}_{i}}\underset{i=1}{\overset{N}{\mathop{\sum }}}\,{{Y}_{i}} \right)}{N}}{\underset{i=1}{\overset{N}{\mathop{\sum }}}\,X_{i}^{2}-\tfrac{N}}$$

Now substituting back $$\ln ({{m}_{ci}})={{Y}_{i}},$$   $$\ln (b)=a,$$   $$\alpha =c$$  and  $$\ln ({{T}_{i}})={{X}_{i}},$$  we have:


 * $$\widehat{b}={{e}^{\tfrac{1}{n}\left[ \underset{i=1}{\overset{n}{\mathop{\sum }}}\,\ln ({{m}_{ci}})-\alpha \underset{i=1}{\overset{n}{\mathop{\sum }}}\,\ln ({{T}_{i}}) \right]}}$$


 * where:


 * $$\widehat{\alpha }=\frac{\underset{i=1}{\overset{n}{\mathop{\sum }}}\,\ln ({{T}_{i}})\ln ({{m}_{ci}})-\tfrac{\underset{i=1}{\overset{n}{\mathop{\sum }}}\,\ln ({{T}_{i}})\underset{i=1}{\overset{n}{\mathop{\sum }}}\,\ln ({{m}_{ci}})}{n}}{\underset{i=1}{\overset{n}{\mathop{\sum }}}\,{{\left[ \ln ({{T}_{i}}) \right]}^{2}}-\tfrac{n}}$$

Example 2 Using the data from Table 4.2, estimate the parameters of the MTBF model using least squares. Solution From Table 4.2:


 * $$\begin{align}

& \underset{i=1}{\overset{n}{\mathop \sum }}\,\ln ({{T}_{i}})= & 25.693 \\ & \underset{i=1}{\overset{n}{\mathop \sum }}\,\ln ({{T}_{i}})\ln ({{m}_{ci}})= & 130.66 \\ & \underset{i=1}{\overset{n}{\mathop \sum }}\,\ln ({{m}_{ci}})= & 20.116 \\ & \underset{i=1}{\overset{n}{\mathop \sum }}\,{{\left[ \ln ({{T}_{i}}) \right]}^{2}}= & 168.99 \end{align}$$

From Eqn. (Dalpha):
 * $$\begin{align}

& \widehat{\alpha }= & \frac{130.66-\tfrac{25.693\cdot 20.116}{4}}{168.99-\tfrac{4}} \\ & = & 0.3671 \end{align}$$

Also from Eqn. (Dbi):
 * $$\begin{align}

& \widehat{b}= & {{e}^{\tfrac{1}{4}(20.116-0.3671\cdot 25.693)}} \\ & = & 14.456 \end{align}$$

Therefore, Eqn. (duane6) becomes:


 * $${{\hat{m}}_{c}}=14.456\cdot {{T}^{0.3671}}$$

The equation for the instantaneous MTBF growth curve using Eqn. (eq76) is:


 * $${{\hat{m}}_{i}}=\frac{1}{1-0.3671}(14.456){{T}^{0.3671}}$$

Example 3 For the data given in columns 1 and 2 of Table 4.3, estimate the Duane parameters using least squares. Solution To estimate the parameters using least squares, the values in columns 3, 4, 5, 6 and 7 are calculated. The cumulative MTBF, $${{m}_{c}}$$, is calculated by dividing the failure time by the failure number. From Eqn. (Dalpha), $$\widehat{\alpha }$$  is:


 * $$\begin{align}

& \widehat{\alpha }= & \frac{974.242-\tfrac{173.013\cdot 121.406}{23}}{1400.908-\tfrac{23}} \\ & = & 0.6133 \end{align}$$

The estimator of $$b$$  can be estimated from Eqn. (Dbi):


 * $$\begin{align}

& \widehat{b}= & {{e}^{\tfrac{1}{23}(121.406-0.6133\cdot 173.013)}} \\ & = & 1.9453 \end{align}$$

Therefore, Eqn. (duane6) becomes:


 * $${{\hat{m}}_{c}}=1.9453\cdot {{T}^{0.613}}$$

Using Eqn. (eq76), the equation for the instantaneous MTBF growth curve is:


 * $${{\hat{m}}_{i}}=\frac{1}{1-0.613}(1.945){{T}^{0.613}}$$

Example 4

For the data given in the Table 4.4, estimate the Duane parameters using least squares.

Solution

The solution to this example follows the same procedure as the previous example. Therefore, from Table 4.4:


 * $$\begin{align}

& \underset{i=1}{\overset{29}{\mathop \sum }}\,\ln ({{T}_{i}})= & 154.151 \\ & \underset{i=1}{\overset{29}{\mathop \sum }}\,\ln {{({{T}_{i}})}^{2}}= & 902.592 \\ & \underset{i=1}{\overset{29}{\mathop \sum }}\,\ln ({{m}_{c}})= & 82.884 \\ & \underset{i=1}{\overset{29}{\mathop \sum }}\,\ln ({{T}_{i}})\cdot \ln ({{m}_{c}})= & 483.154 \end{align}$$

For least squares, Eqn. (Dalpha) is used to estimate $$\alpha $$ :


 * $$\begin{align}

& \widehat{\alpha }= & \frac{483.154-\tfrac{154.151\cdot 82.884}{29}}{902.592-\tfrac{29}} \\ & = & 0.5115 \end{align}$$

The estimator of $$b$$  can be estimated from Eqn. (Dbi):


 * $$\begin{align}

& \widehat{b}= & {{e}^{\tfrac{1}{29}(82.884-0.5115\cdot 154.151)}} \\ & = & 1.1495 \end{align}$$

Therefore, from Eqn. (duane6):


 * $${{\hat{m}}_{c}}=1.1495\cdot {{T}^{0.5115}}$$

Using Eqn. (eq76), the equation for the instantaneous MTBF growth curve is:


 * $${{\hat{m}}_{i}}=\frac{1}{1-0.5115}(1.1495){{T}^{0.5115}}$$