---
# System prepended metadata

title: Weighting Components of Flavnoles of Tea
tags: [Chemometric authentication of Taiwanese oolong tea flavor]

---

[TOC]
# Weighting Components of Flavanoles of Tea

## 1. General Model for Taiwanese oolong tea flavor
1. $X_i$ is the ***true*** flavanoles of Tea
2. $W_i$ is the flavanoles assay measure from ***UV*** device
3. $M_i$ is the flavanoles assay measure from ***ECD*** device
4. $R_i$ is the flavanoles assay measure from ***MS*** device

**Assumptions:**
* $W=X+\epsilon$ where $E(\epsilon|X=x)=0$ and $Var(W|X=x)=\sigma_x^2+\sigma^2_\epsilon$
* $M=X+\xi$ where $E(\xi|X=x)=0$ and $Var(M|X=x)=\sigma_x^2+\sigma^2_\xi$
* $R=X+\eta$ where $E(\eta|X=x)=0$ and $Var(R|X=x)=\sigma_x^2+\sigma^2_\eta$
* $\epsilon$, $\xi$ and $\eta$ are independent.

## 2. Method of Moment 
**The MM of $\mu_X$, $\sigma^2_X$,  $\sigma^2_\epsilon$, $\sigma^2_\xi$, $\sigma^2_\eta$** 

$E(\frac{W+M+R}{3}|X=x)=\mu_x$

* $E(WM|X=x)=\sigma^2_x+\mu^2_x$
$E(WM|X=x)=E[(X+\epsilon)(X+\xi)|X=x]=E(X^2+X\epsilon+X\xi+\epsilon\xi|X=x)=\sigma^2_x+\mu^2_x$
* $E(WR|X=x)=\sigma^2_x+\mu^2_x$
$E(WR|X=x)=E[(X+\epsilon)(X+\eta)|X=x]=E(X^2+X\epsilon+X\eta+\epsilon\eta|X=x)=\sigma^2_x+\mu^2_x$
* $E(MR|X=x)=\sigma^2_x+\mu^2_x$
$E(MR|X=x)=E[(X+\xi)(X+\eta)|X=x]=E(X^2+X\xi+X\eta+\xi\eta|X=x)=\sigma^2_x+\mu^2_x$

$E(\frac{WM+WR+MR}{3}|X=x)=\sigma^2_x-\mu^2_x$

**$\sigma^2_x$, $\sigma^2_\epsilon$, $\sigma^2_\xi$, and $\sigma^2_\eta$** are

(1) $\sigma^2_x=E(\frac{WM+WR+MR}{3})-[E(\frac{W+M+R}{3})]^2$
(2) $\sigma^2_\epsilon=Var(W)-\sigma^2_x$
(3) $\sigma^2_\xi=Var(M)-\sigma^2_x$
(4) $\sigma^2_\eta=Var(R)-\sigma^2_x$

**The estimator of $\sigma^2_x$, $\sigma^2_\epsilon$, $\sigma_\xi$, $\sigma_\eta$:**

\begin{align*}
\hat\sigma^2_x&=\frac{\sum_{i=1}^n(w_im_iM+w_ir_i+m_ir_i)}{3(n-1)}-[\frac{\sum_{i=1}^n(w_i+m_i+r_i)}{3n}]^2 \\
\hat\sigma^2_\epsilon&=\frac{\sum_{i=1}^n(w_i-\bar{w})^2}{n-1}-\hat\sigma^2_x \\
\hat\sigma^2_\xi&=\frac{\sum_{i=1}^n(m_i-\bar{m})^2}{n-1}-\hat\sigma^2_x \\
 \hat\sigma^2_\eta&=\frac{\sum_{i=1}^n(r_i-\bar{r})^2}{n-1}-\hat\sigma^2_x
\end{align*}

---
## 3. Weighted method
If
\begin{align*} 
W & \sim F(\mu_x, \sigma^2_W) \\ 
M & \sim F(\mu_x, \sigma^2_M) \\
R & \sim F(\mu_x, \sigma^2_R)
\end{align*}
and $U=\omega_1 W+\omega_2 M+ (1-\omega_1-\omega_2) R$, then find $\omega_1$ and $\omega_2$ subject to $\min_{\omega_1, \omega_2}Var(U)$.

**Proof**
\begin{align*}
Var(U) &=Var(\omega_1 W+\omega_2 M+(1-\omega_1-\omega_2) R)\\
       &=\omega^2_1Var(W)+\omega^2_2Var(M)+(1-\omega_1-\omega_2)^2Var(R)\\
       &=\omega^2_1 \sigma^2_W+\omega^2_2 \sigma^2_M+(1-\omega_1-\omega_2)^2\sigma^2_R
\end{align*}

Partial derivative with $\omega_1$ and $\omega_2$, then
\begin{align*}
&\left\{
\begin{array}{l}
\frac{\partial}{\partial \omega_1}Var(U)=2\omega_1\sigma^2_W-2(1-\omega_1-\omega_2)\sigma^2_R=0\\
\frac{\partial}{\partial \omega_2}Var(U)=2\omega_2\sigma^2_M-2(1-\omega_1-\omega_2)\sigma^2_R=0\\
\end{array}
\right.
\\
\Rightarrow &\left\{
\begin{array}{l}
\omega_1 (\sigma^2_W+\sigma^2_M)=(1-\omega_2)\sigma^2_R\\
\omega_2 (\sigma^2_M+\sigma^2_R)=(1-\omega_1)\sigma^2_R\\
\end{array}
\right.
\end{align*}

The solution of $\omega_1$ and $\omega_2$ are
\begin{align*}
\omega_1&=\frac{\sigma^2_M\sigma^2_R}{\sigma^2_W\sigma^2_M+\sigma^2_W\sigma^2_R+\sigma^2_M\sigma^2_R} \\ 
\omega_2&=\frac{\sigma^2_W\sigma^2_R}{\sigma^2_W\sigma^2_M+\sigma^2_W\sigma^2_R+\sigma^2_M\sigma^2_R}
\end{align*}
then
$$1-\omega_1-\omega_2=\frac{\sigma^2_W\sigma^2_M}{\sigma^2_W\sigma^2_M+\sigma^2_W\sigma^2_R+\sigma^2_M\sigma^2_R}.$$

Let $$T=\sigma^2_W\sigma^2_M+\sigma^2_W\sigma^2_R+\sigma^2_M\sigma^2_R,$$ then

\begin{align}
U&=\frac{\sigma^2_M\sigma^2_R}{T} W+\frac{\sigma^2_W\sigma^2_R}{T} M+ \frac{\sigma^2_W\sigma^2_M}{T} R \\
Var(U)&=\frac{\sigma^2_W\sigma^2_M\sigma^2_R}{T}
\end{align}

---

## 4. Linear Model
1. **UV:** $W=f(X)=\alpha_0+\alpha_1 X+\epsilon,$ $\quad$ $\epsilon \sim N(0,\sigma^2_{\epsilon})$
2. **ECD:** $M=g(X)=\beta_0+\beta_1 X+\xi,$ $\quad$ $\xi \sim N(0,\sigma^2_\xi)$
3. **MS:** $R=h(X)=\gamma_0+\gamma_1X+\eta,$ $\quad$ $\eta\sim N(0,\sigma^2_\eta)$

Let 
\begin{align}
U&=\omega_1 W+\omega_2 M+(1-\omega_1-\omega_2)R \\
&=\{ \omega_1 \alpha_0+\omega_2 \beta_0+(1-\omega_1-\omega_2) \gamma_0 \}+
\{ \omega_1\alpha_1+\omega_2\beta_1+(1-\omega_1-\omega_2)\gamma_1\}X \\
&\quad +\omega_1\epsilon+\omega_2\xi+(1-\omega_1-\omega_2)\eta
\end{align}

Then
\begin{align}
E(U|X=x)&=\{ \omega_1 \alpha_0+\omega_2 \beta_0+(1-\omega_1-\omega_2) \gamma_0 \}+ \{ \omega_1\alpha_1+\omega_2\beta_1+(1-\omega_1-\omega_2)\gamma_1\}x \\
&=x
\end{align}

\begin{align*}
\Rightarrow\left\{
\begin{array}{l}
\omega_1 \alpha_0+\omega_2\beta_0+(1-\omega_1-\omega_2)\gamma_0=0\\
\omega_1 \alpha_1+\omega_2\beta_1+(1-\omega_1-\omega_2)\gamma_1=1
\end{array}
\right.
\end{align*}

We can find the weight $\omega_1$ and $\omega_2$
\begin{align*}
&\min_{\omega_1, \omega_2} Var(U)=\min_{\omega_1,\omega_2}\{ [ \omega_1 \alpha_1+\omega_2\beta_1+(1-\omega_1-\omega_2)\gamma_1 ]^2 \sigma^2_x+\omega^2_1\sigma^2_\epsilon+\omega^2_1\sigma^2_\xi+(1-\omega_1-\omega_2)^2\sigma^2_\eta \}
\end{align*}

\begin{align*}
&\Rightarrow\left\{
\begin{array}{l}
\frac{\partial}{\partial \omega_1}Var(U)=[\omega_1 \alpha_1+\omega_2\beta_1+(1-\omega_1-\omega_2)\gamma_1](\alpha_1-\gamma_1)\sigma^2_x+ \omega_1\sigma^2_\epsilon-(1-\omega_1-\omega_2)\sigma^2_\eta=0\\ 
\frac{\partial}{\partial \omega_2}Var(U)=[\omega_1 \alpha_1+\omega_2\beta_1+(1-\omega_1-\omega_2)\gamma_1](\beta_1-\gamma_1)\sigma^2_x+ \omega_2\sigma^2_\xi-(1-\omega_1-\omega_2)\sigma^2_\eta=0
\end{array}
\right. 
\\ \\
&\Rightarrow\left\{
\begin{array}{l}
(\alpha_1-\gamma_1)\sigma^2_x+\omega_1\sigma^2_\epsilon=(1-\omega_1-\omega_2)\sigma^2_\eta \\
(\beta_1-\gamma_1)\sigma^2_x+\omega_1\sigma^2_\xi=(1-\omega_1-\omega_2)\sigma^2_\eta
\end{array}
\right.
\end{align*}

**Part 1.** To solve $\omega_1$ 
Let
$$\omega_2=\frac{(1-\omega_1)\sigma^2_\eta+(\gamma_1-\beta_1)\sigma^2_x}{\sigma^2_\xi+\sigma^2_\eta}$$ 

and
$$1-\omega_2=\frac{\sigma^2_\xi+\omega_1\sigma^2_\eta+(\gamma_1-\beta_1)\sigma^2_x}{\sigma^2_\xi+\sigma^2_\eta}$$ 

Then
\begin{align}
&\omega_1(\sigma^2_\epsilon+\sigma^2_\eta)=\frac{\sigma^2_\xi+\omega_1\sigma^2_\eta+(\gamma_1-\beta_1)\sigma^2_x}{\sigma^2_\xi+\sigma^2_\eta}\sigma^2_\eta+(\gamma_1-\alpha_1)\sigma^2_x\\ \\
\Rightarrow &\omega_1( \sigma^2_\epsilon \sigma^2_\xi+ \sigma^2_\epsilon 
\sigma^2_\eta+\sigma^2_\xi\sigma^2_\eta)
=\sigma^2_\xi \sigma^2_\eta+(\beta_1-\alpha_1) \sigma^2_x \sigma^2_\eta+(\gamma_1-\alpha_1)\sigma^2_x \sigma^2_\xi\\ \\
\Rightarrow &\omega_1=\frac{\sigma^2_\xi \sigma^2_\eta+(\beta_1-\alpha_1) \sigma^2_x \sigma^2_\eta+(\gamma_1-\alpha_1)\sigma^2_x \sigma^2_\xi}{\sigma^2_\epsilon \sigma^2_\xi+ \sigma^2_\epsilon 
\sigma^2_\eta+\sigma^2_\xi\sigma^2_\eta}
\end{align}

**Part 2.** To solve $\omega_2$ 
Let
$$\omega_1=\frac{(1-\omega_2)\sigma^2_\eta+(\gamma_1-\alpha_1)\sigma^2_x}{\sigma^2_\epsilon+\sigma^2_\eta}$$ 

and
$$1-\omega_1=\frac{\sigma^2_\epsilon+\omega_2\sigma^2_\eta+(\alpha_1-\gamma_1)\sigma^2_x}{\sigma^2_\epsilon+\sigma^2_\eta}$$ 

Then
\begin{align}
&\omega_2(\sigma^2_\xi+\sigma^2_\eta)=\frac{\sigma^2_\epsilon+\omega_2\sigma^2_\eta+(\alpha_1-\gamma_1)\sigma^2_x}{\sigma^2_\epsilon+\sigma^2_\eta}\sigma^2_\eta+(\gamma_1-\beta_1)\sigma^2_x\\ \\
\Rightarrow &\omega_2( \sigma^2_\epsilon \sigma^2_\xi+ \sigma^2_\epsilon 
\sigma^2_\eta+\sigma^2_\xi\sigma^2_\eta)
=\sigma^2_\epsilon \sigma^2_\eta+(\alpha_1-\beta_1) \sigma^2_x \sigma^2_\eta+(\gamma_1-\beta_1)\sigma^2_x \sigma^2_\epsilon\\ \\
\Rightarrow &\omega_2=\frac{\sigma^2_\epsilon \sigma^2_\eta+(\alpha_1-\beta_1) \sigma^2_x \sigma^2_\eta+(\gamma_1-\beta_1)\sigma^2_x \sigma^2_\epsilon}{\sigma^2_\epsilon \sigma^2_\xi+ \sigma^2_\epsilon 
\sigma^2_\eta+\sigma^2_\xi\sigma^2_\eta}
\end{align}

**Part 3.** To solve $1-\omega_1-\omega_2$ 
\begin{align}
1-\omega_1-\omega_2=\frac{\sigma^2_\epsilon \sigma^2_\xi+(\alpha_1-\gamma_1) \sigma^2_x \sigma^2_\xi+(\beta_1-\gamma_1)\sigma^2_x \sigma^2_\epsilon}{\sigma^2_\epsilon \sigma^2_\xi+ \sigma^2_\epsilon 
\sigma^2_\eta+\sigma^2_\xi\sigma^2_\eta}
\end{align}


###### tags: `Chemometric authentication of Taiwanese oolong tea flavor`