Finding initial values with the help of least square method

240 Views Asked by At

$D: \begin{bmatrix}1&4.19\\2&3.40\\3&2.80\\4&2.30\\5&1.99\\6&1.70\\7&1.51\\8&1.34\\9&1.21\\10&1.09\end{bmatrix}$

In this table of data the first column is representing time (in minutes), and the second column is the mass of some element.

  • The element consists of two types of isotopes that decay rapidly.

  • The first isotope has a half-life of 3 minutes, and the second of 8 minutes.

How can I figure out the initial mass of the two isotopes using least square method on this table of data?

I will use Wolfram Mathematica for the calculations

4

There are 4 best solutions below

0
On BEST ANSWER

It should be valuable to specify the criterion of fitting. The result depends on it.

For example, one can compare different results on the two sheets of numerical computation : one for the smallest mean square absolute deviation, the other for the smallest mean square relative deviation.

enter image description here

enter image description here

0
On

The equation is

$$M(t)=Ae^{-\frac{\ln{2}}{3}t}+Be^{-\frac{\ln{2}}{8}t}$$

The least square method needs to minimize the following:

$$\sum (Ae^{-\frac{\ln{2}}{3}t_i}+Be^{-\frac{\ln{2}}{8}t_i}-M_i)^2$$

So we find the derivative of this function with respect to $A$ and $B$ and set them to $0$:

$$2 \sum (Ae^{-\frac{\ln{2}}{3}t_i}+Be^{-\frac{\ln{2}}{8}t_i}-M_i)e^{-\frac{\ln{2}}{3}t_i}=0\\ 2 \sum (Ae^{-\frac{\ln{2}}{3}t_i}+Be^{-\frac{\ln{2}}{8}t_i}-M_i)e^{-\frac{\ln{2}}{8}t_i}=0$$

This gives us a $2\times 2$ system of linear equations with variables $A$ and $B$. Solve them by Cramer's rule:

$$A=\frac{\sum M_i e^{-\frac{\ln{2}}{3}t_i}\sum(e^{-\frac{\ln{2}}{8}t_i})^2-\sum M_i e^{-\frac{\ln{2}}{8}t_i}\sum e^{-\frac{\ln{2}}{3}t_i-\frac{\ln{2}}{8}t_i}}{\sum(e^{-\frac{\ln{2}}{3}t_i})^2\sum(e^{-\frac{\ln{2}}{8}t_i})^2-(\sum e^{-\frac{\ln{2}}{3}t_i-\frac{\ln{2}}{8}t_i})^2}$$

$$B=\frac{\sum M_i e^{-\frac{\ln{2}}{8}t_i}\sum(e^{-\frac{\ln{2}}{3}t_i})^2-\sum M_i e^{-\frac{\ln{2}}{3}t_i}\sum e^{-\frac{\ln{2}}{3}t_i-\frac{\ln{2}}{8}t_i}}{\sum(e^{-\frac{\ln{2}}{3}t_i})^2\sum(e^{-\frac{\ln{2}}{8}t_i})^2-(\sum e^{-\frac{\ln{2}}{3}t_i-\frac{\ln{2}}{8}t_i})^2}$$

0
On

This second post is NOT an answer to the question raised by B. Lee . That is why I will make it very distinct from my first post which is the answer itself.

Now, we will suppose that the half-life of the isotopes are not given in the wording of the problem. In this case, we have to fit a function on the form : $$m=a\: e^{-p\: t}+b\: e^{-q\: t}$$ where the parameters $a\: , \: b\: , \: p\: , \: q\:$ must be computed from the experimental data.

It is a non-linear regression problem which can be solved thanks to some specialized softwares. They use iterative methods of numerical calculus and they require initial estimates to start the process.

A much simpler method which is direct (not itterative) and which doesn't require initial estimate is given in the paper : https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales

The numerical method, which is shown in full details page 72, directly leads to the next result :

enter image description here

It is surprizing that the fitting is excellent, much better than the previous result with the half-life values provided in the initial wording.

0
On

As long as the decays are fixed, you can simplify the problem defining $$u_i=e^{-\frac{\ln{2}}{3}t_i}$$ $$v_i=e^{-\frac{\ln{2}}{8}t_i}$$ and then the data are just represented by $$M=A u + B v$$ which reduces the problem to a multilinear least square fit with no intercept. This is basically the same as KittyL's answer. The fitting procedure does not require estimates of any parameter since the model is strictly linear with respect to its parameters $A$ and $B$.

The problem should be quite different if the decays have to be tuned. In this case, nonlinear regression should be used but you could use the first results as starting values. So, the first fit leads to $$M=3.36869~ e^{-0.231049 t}+1.53112\ e^{-0.0866434 t}$$ which is identical to what JJacquelin gave in the first part of his answer.

Using these results as initial estimates for the fit of model $$M=A e^{at}+B e^{b t}$$ a full nonlinear regression will lead to $$M=3.83024 e^{-0.305706 x}+1.43649 e^{-0.0447771 x}$$ which is very close to what JJacquelin gave in the second part of his answer.

For the first model, the adjusted $R^2=0.998654$ corresponds to a residual sum of squares equal to $0.0601$. For the second model, the adjusted $R^2=0.999955$ corresponds to a residual sum of squares equal to $0.0015$ which is incredibly better as already pointed out by JJacquelin. But, as you can see, this really significantly changed the half-lifes.