Template:Nonlinear regression gompz

Nonlinear Regression
Nonlinear regression is similar to linear regression, except that a curve is fitted to the data set instead of a straight line. Just as in the linear scenario, the sum of the squares of the horizontal and vertical distances between the line and the points are to be minimized. In the case of the nonlinear Gompertz model $$R=a{{b}^}$$, let:


 * $${{Y}_{i}}=f({{T}_{i}},\delta )=a{{b}^}$$
 * where:
 * $${{T}_{i}}=\left[ \begin{matrix}

{{T}_{1}} \\ {{T}_{2}} \\ \vdots  \\ {{T}_{N}} \\ \end{matrix} \right],\quad i=1,2,...,N$$
 * and:
 * $$\delta =\left[ \begin{matrix}

a \\ b \\ c \\ \end{matrix} \right]$$

The Gauss-Newton method can be used to solve for the parameters $$a$$,  $$b$$  and  $$c$$  by performing a Taylor series expansion on  $$f({{T}_{i}},\delta ).$$  Then approximate the nonlinear model with linear terms and employ ordinary least squares to estimate the parameters. This procedure is performed in an iterative manner and it generally leads to a solution of the nonlinear problem. This procedure starts by using initial estimates of the parameters $$a$$,  $$b$$  and  $$c$$ , denoted as  $$g_{1}^{(0)},$$   $$g_{2}^{(0)}$$  and  $$g_{3}^{(0)},$$  where  $$^{(0)}$$  is the iteration number. The Taylor series expansion approximates the mean response, $$f({{T}_{i}},\delta )$$, around the starting values,  $$g_{1}^{(0)},$$   $$g_{2}^{(0)}$$  and  $$g_{3}^{(0)}.$$  For the  $${{i}^{th}}$$  observation:


 * $$f({{T}_{i}},\delta )\simeq f({{T}_{i}},{{g}^{(0)}})+\underset{k=1}{\overset{p}{\mathop \sum }}\,{{\left[ \frac{\partial f({{T}_{i}},\delta )}{\partial {{\delta }_{k}}} \right]}_{\delta ={{g}^{(0)}}}}({{\delta }_{k}}-g_{k}^{(0)})$$
 * where:
 * {{g}^{(0)}}=\left[ \begin{matrix}

g_{1}^{(0)} \\ g_{2}^{(0)} \\ g_{3}^{(0)} \\ \end{matrix} \right]</math
 * Let:


 * $$\begin{align}

& f_{i}^{(0)}= & f({{T}_{i}},{{g}^{(0)}}) \\ & \nu _{k}^{(0)}= & ({{\delta }_{k}}-g_{k}^{(0)}) \\ & D_{ik}^{(0)}= & {{\left[ \frac{\partial f({{T}_{i}},\delta )}{\partial {{\delta }_{k}}} \right]}_{\delta ={{g}^{(0)}}}} \end{align}$$ So Eqn. (nl1) becomes:
 * $${{Y}_{i}}\simeq f_{i}^{(0)}+\underset{k=1}{\overset{p}{\mathop \sum }}\,D_{ik}^{(0)}\nu _{k}^{(0)}$$

or by shifting $$f_{i}^{(0)}$$  to the left of the equation:
 * $$Y_{i}^{(0)}\simeq \underset{k=1}{\overset{p}{\mathop \sum }}\,D_{ik}^{(0)}\nu _{k}^{(0)}$$

In matrix form this is given by:
 * $${{Y}^{(0)}}\simeq {{D}^{(0)}}{{\nu }^{(0)}}$$
 * where:
 * $${{Y}^{(0)}}=\left[ \begin{matrix}

{{Y}_{1}}-f_{1}^{(0)} \\ {{Y}_{2}}-f_{2}^{(0)} \\ \vdots  \\ {{Y}_{N}}-f_{N}^{(0)} \\ \end{matrix} \right]=\left[ \begin{matrix} {{Y}_{1}}-g_{1}^{(0)}g_{2}^{(0)g_{3}^{(0){{T}_{1}}}} \\ {{Y}_{1}}-g_{1}^{(0)}g_{2}^{(0)g_{3}^{(0){{T}_{2}}}} \\ \vdots  \\ {{Y}_{N}}-g_{1}^{(0)}g_{2}^{(0)g_{3}^{(0){{T}_{N}}}} \\ \end{matrix} \right]$$


 * and:


 * $${{\nu }^{(0)}}=\left[ \begin{matrix}

g_{1}^{(0)} \\ g_{2}^{(0)} \\ g_{3}^{(0)} \\ \end{matrix} \right]$$

Note that Eqn. (matr) is in the form of the general linear regression model of Eqn. (linear). According to Eqn. (lincoeff), the estimate of the parameters $${{\nu }^{(0)}}$$  is given by:
 * $${{\widehat{\nu }}^{(0)}}={{\left( {{D}^}{{D}^{(0)}} \right)}^{-1}}{{D}^}{{Y}^{(0)}}$$

The revised estimated regression coefficients in matrix form are:
 * $${{g}^{(1)}}={{g}^{(0)}}+{{\widehat{\nu }}^{(0)}}$$

The least squares criterion measure, $$Q,$$  should be checked to examine whether the revised regression coefficients will lead to a reasonable result. According to the Least Squares Principle, the solution to the values of the parameters are those values that minimize $$Q$$. With the starting coefficients, $${{g}^{(0)}}$$,  $$Q$$  is:
 * $${{Q}^{(0)}}=\underset{i=1}{\overset{N}{\mathop \sum }}\,{{\left[ {{Y}_{i}}-f\left( {{T}_{i}},{{g}^{(0)}} \right) \right]}^{2}}$$

And with the coefficients at the end of the first iteration, $${{g}^{(1)}}$$,  $$Q$$  is:
 * $${{Q}^{(1)}}=\underset{i=1}{\overset{N}{\mathop \sum }}\,{{\left[ {{Y}_{i}}-f\left( {{T}_{i}},{{g}^{(1)}} \right) \right]}^{2}}$$

For the Gauss-Newton method to work properly and to satisfy the Least Squares Principle, the relationship $${{Q}^{(k+1)}}<{{Q}^{(k)}}$$  has to hold for all  $$k$$, meaning that  $${{g}^{(k+1)}}$$  gives a better estimate than  $${{g}^{(k)}}$$. The problem is not yet completely solved. Now $${{g}^{(1)}}$$  are the starting values, producing a new set of values  $${{g}^{(2)}}$$. The process is continued until the following relationship has been satisfied:
 * $${{Q}^{(s-1)}}-{{Q}^{(s)}}\simeq 0$$

When using the Gauss-Newton method or some other estimation procedure, it is advisable to try several sets of starting values to make sure that the solution gives relatively consistent results.

Choice of Initial Values
The choice of the starting values is not an easy task. A poor choice may result in a lengthy computation with many iterations. It may also lead to divergence, or to a convergence due to a local minimum. Therefore, good initial values will result in fast computations with few iterations and if multiple minima exist, it will lead to a solution that is a minimum.

Various methods were developed for obtaining valid initial values for the regression parameters. The following procedure is described by Virene [1] in estimating the Gompertz parameters. This procedure is rather simple. It will be used to get the starting values for the Gauss-Newton method, or for any other method that requires initial values. Some analysts are using this method to calculate the parameters if the data set is divisible into three groups of equal size. However, if the data set is not equally divisible, it can still provide good initial estimates.

Consider the case where $$m$$  observations are available in the form shown next. Each reliability value, $${{R}_{i}}$$, is measured at the specified times,  $${{T}_{i}}$$.
 * $$\begin{matrix}

{{T}_{i}} & {{R}_{i}} \\ {{T}_{0}} & {{R}_{0}} \\ {{T}_{1}} & {{R}_{1}} \\ {{T}_{2}} & {{R}_{2}} \\ \vdots & \vdots   \\ {{T}_{m-1}} & {{R}_{m-1}} \\ \end{matrix}$$


 * where:
 * •	 $$m=3n,$$  $$n$$  is equal to the number of items in each equally sized group
 * •	 $${{T}_{i}}-{{T}_{i-1}}=const$$
 * •	 $$i=0,1,...,m-1$$

The Gompertz reliability equation is given by:
 * $$R=a{{b}^}$$
 * and:
 * $$\ln (R)=\ln (a)+{{c}^{T}}\ln (b)$$


 * Define:
 * $$S_1=\sum_{i=0}^{n-1} ln(R_i)= n ln(a)+ln(b)\sum_{i=0}^{n-1} c^{T_i}$$
 * $$S_2=\sum_{i=n}^{2n-1} ln(R_i)= n ln(a)+ln(b)\sum_{i=n}^{2n-1} c^{T_i}$$
 * $$S_3=\sum_{i=2n}^{m-1} ln(R_i)= n ln(a)+ln(b)\sum_{i=2n}^{m-1} c^{T_i}$$


 * Then:
 * $$\frac{S_3-S_2}{S_2-S_1}=\frac{\sum_{i=2n}{m-1} c^{T_i}-\sum_{i=n}^{2n-1} c^T_i}{\sum_{i=0}^{n-1} c^{T_i}}$$
 * $$\frac{S_3-S_2}{S_2-S_1}=c^T_{2n}\frac{\sum_{i=0}{n-1} c^{T_i}-c^{T_n}\sum_{i=0}^{n-1} c^T_i}{c^{T_n}\sum_{i=0}^{n-1} c^{T_i}}$$
 * $$\frac{S_3 - S_2}{S_2-S_1}=\frac{c^{T_2n}-c^{T_n}}{c^{T_n}-1}=c^{T_{a_n}}=c^{n\cdot I+T_0}$$

Without loss of generality, take $${{T}_}=0$$ ; then:
 * $$\frac{{{S}_{3}}-{{S}_{2}}}{{{S}_{2}}-{{S}_{1}}}={{c}^{n\cdot I}}$$

Solving for $$c$$  yields: Considering Eqns. (gomp3a) and (gomp3b), then:
 * $$\begin{align}

& {{S}_{1}}-n\cdot \ln (a)= & \ln (b)\underset{i=0}{\overset{n-1}{\mathop \sum }}\,{{c}^} \\ & {{S}_{2}}-n\cdot \ln (a)= & \ln (b)\underset{i=n}{\overset{2n-1}{\mathop \sum }}\,{{c}^} \end{align}$$
 * or:


 * $$\frac{{{S}_{1}}-n\cdot \ln (a)}{{{S}_{2}}-n\cdot \ln (a)}=\frac{1}$$

Reordering the equation yields:
 * $$\begin{align}

& \ln (a)= & \frac{1}{n}\left( {{S}_{1}}+\frac{{{S}_{2}}-{{S}_{1}}}{1-{{c}^{n\cdot I}}} \right) \\ & a= & {{e}^{\left[ \tfrac{1}{n}\left( {{S}_{1}}+\tfrac{{{S}_{2}}-{{S}_{1}}}{1-{{c}^{n\cdot I}}} \right) \right]}} \end{align}$$ If the reliability values are in percent then $$a$$  needs to be divided by  $$100$$  to return the estimate in decimal format. Consider Eqns. (gomp3a) and (gomp3b) again, where: Reordering Eqn. (gomp6) yields:
 * $$\begin{align}

& \ln (b)= & \frac{({{S}_{2}}-{{S}_{1}})({{c}^{I}}-1)} \\ & b= & {{e}^{\left[ \tfrac{\left( {{S}_{2}}-{{S}_{1}} \right)\left( {{c}^{I}}-1 \right)} \right]}} \end{align}$$ For the special case where $$I=1$$, from Eqns. (gomp4), (gomp5) and (gomp7), the parameters are:
 * $$\begin{align}

& c= & {{\left( \frac{{{S}_{3}}-{{S}_{2}}}{{{S}_{2}}-{{S}_{1}}} \right)}^{\tfrac{1}{n}}} \\ & a= & {{e}^{\left[ \tfrac{1}{n}\left( {{S}_{1}}+\tfrac{{{S}_{2}}-{{S}_{1}}}{1-{{c}^{n}}} \right) \right]}} \\ & b= & {{e}^{\left[ \tfrac{({{S}_{2}}-{{S}_{1}})(c-1)} \right]}} \end{align}$$

To estimate the values of the parameters $$a,b$$  and  $$c$$, do the following:
 * 1)	Arrange the currently available data in terms of $$T$$  and  $$R$$  as in Table 7.1. The  $$T$$  values should be chosen at equal intervals and increasing in value by 1, such as one month, one hour, etc.
 * 2)	Calculate the natural log $$R$$.
 * 3)	Divide the column of values for log $$R$$  into three groups of equal size, each containing  $$n$$  items. There should always be three groups. Each group should always have the same number,  $$n$$, of items, measurements or values.
 * 4)	Add the values of the natural log $$R$$  in each group, obtaining the sums identified as  $${{S}_{1}}$$,  $${{S}_{2}}$$  and  $${{S}_{3}}$$ , starting with the lowest values of the natural log  $$R$$.
 * 5)	Calculate $$c$$  from Eqn. (eq9):
 * $$c={{\left( \frac{{{S}_{3}}-{{S}_{2}}}{{{S}_{2}}-{{S}_{1}}} \right)}^{\tfrac{1}{n}}}$$
 * 6)	Calculate $$a$$  from Eqn. (eq10):
 * $$a={{e}^{\left[ \tfrac{1}{n}\left( {{S}_{1}}+\tfrac{{{S}_{2}}-{{S}_{1}}}{1-{{c}^{n}}} \right) \right]}}$$
 * 7)	Calculate $$b$$  from Eqn. (eq11):
 * b={{e}^{\left[ \tfrac{({{S}_{2}}-{{S}_{1}})(c-1)} \right]}}</m
 * 8)	Write the Gompertz reliability growth equation.
 * 9)	Substitute the value of $$T$$, the time at which the reliability goal is to be achieved, to see if the reliability is indeed to be attained or exceeded by  $$T$$.