Appendices A1 Quarternion Three-dimension rotation by quaternions is widely applied in the engineering field. In order to illustrate the whole process explicitly, some basic algebra definitions and calculations are provided as follows. Similar algebra process (Eqs. 33 --62 ) can be found in the standard literature. (e.g. Hamilton 1969 ; Altman 1986 ; Kuipers 1999 ).
A quaternion \( \overrightarrow{\mathbf{b}} \) is defined as the linear combination of a scalar b
4
and a vector \( \overrightarrow{{\mathbf{b}}_{\mathbf{u}}} \) = (b
1
, b
2
, b
3
) where b
1
, b
2
, b
3
, b
4
are real numbers, namely,
$$ \overline{\mathbf{b}}={\overline{\mathbf{b}}}_{\mathbf{u}}^{\to }+{\mathbf{b}}_4={\mathbf{b}}_1\mathbf{i}+{\mathbf{b}}_2\mathbf{j}+{\mathbf{b}}_3\mathbf{k}+{\mathbf{b}}_4. $$
(33)
The conjugate vector of \( \overrightarrow{\mathbf{b}} \) is
$$ {\overline{\mathbf{b}}}^{{}^{*}}=-{\mathbf{b}}_1\mathbf{i}-{\mathbf{b}}_2\mathbf{j}-{\mathbf{b}}_3\mathbf{k}+{\mathbf{b}}_4. $$
(34)
The dot products of the basis elements (i
,
j
,
k ) are given by
$$ \mathbf{i}\bullet \mathbf{i}=\mathbf{j}\bullet \mathbf{j}=\mathbf{k}\bullet \mathbf{k}=-1, $$
(35)
$$ \mathbf{i}\bullet \mathbf{j}=\mathbf{k},\kern0.5em \mathbf{j}\bullet \mathbf{k}=\mathbf{i},\kern0.5em \mathbf{k}\bullet \mathbf{i}=\mathbf{j}, $$
(36)
$$ \mathbf{j}\bullet \mathbf{i}=-\mathbf{k},\kern0.5em \mathbf{k}\bullet \mathbf{j}=-\mathbf{i},\kern0.5em \mathbf{i}\bullet \mathbf{k}=-\mathbf{j}. $$
(37)
Assuming there is another vector \( \overrightarrow{\mathbf{c}} \) with a form
$$ \overline{\mathbf{c}}={\mathbf{c}}_1\mathbf{i}+{\mathbf{c}}_2\mathbf{j}+{\mathbf{c}}_3\mathbf{k}+{\mathbf{c}}_4, $$
(38)
the dot product of \( \overrightarrow{\mathbf{b}}\ \mathrm{and}\ \overrightarrow{\mathbf{c}} \) is shown as
$$ \overrightarrow{\mathbf{b}}\bullet \overrightarrow{\mathbf{c}}=-{\mathbf{b}}_1{\mathbf{c}}_1-{\mathbf{b}}_2{\mathbf{c}}_2-{\mathbf{b}}_3{\mathbf{c}}_3+{\mathbf{b}}_4{\mathbf{c}}_4+\left({\mathbf{b}}_1{\mathbf{c}}_4+{\mathbf{b}}_4{\mathbf{c}}_1+{\mathbf{b}}_2{\mathbf{c}}_3-{\mathbf{b}}_3{\mathbf{c}}_2\right)\mathbf{i}+\left(-{\mathbf{b}}_1{\mathbf{c}}_3+{\mathbf{b}}_2{\mathbf{c}}_4+{\mathbf{b}}_3{\mathbf{c}}_1+{\mathbf{b}}_4{\mathbf{c}}_2\right)\mathbf{j}+\left({\mathbf{b}}_1{\mathbf{c}}_2-{\mathbf{b}}_2{\mathbf{c}}_1+{\mathbf{b}}_3{\mathbf{c}}_4+{\mathbf{b}}_4{\mathbf{c}}_3\right)\mathbf{k}. $$
(39)
The parametric part of the dot product \( \overline{\mathbf{b}}\bullet \overline{\mathbf{c}} \) is able to be rewritten in matrix form as the product of the quaternion component matrix of \( \overline{\mathbf{b}} \) and \( \overline{\mathbf{c}} \) or the product of the quaternion metamorphic matrix of \( \overline{\mathbf{c}} \) and \( \overline{\mathbf{b}} \) :
$$ \overrightarrow{\mathbf{b}}\bullet \overrightarrow{\mathbf{c}}=\left[\mathbf{i},\mathbf{j},\mathbf{k},1\right]\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_4\hfill \\ {}\hfill {\mathbf{b}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_3\hfill \\ {}\hfill {\mathbf{b}}_4\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_2\hfill \\ {}\hfill -{\mathbf{b}}_1\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_2\hfill & \hfill {\mathbf{b}}_1\hfill & \hfill {\mathbf{b}}_4\hfill \\ {}\hfill -{\mathbf{b}}_1\hfill & \hfill -{\mathbf{b}}_2\hfill & \hfill -{\mathbf{b}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{b}}_1\hfill \\ {}\hfill {\mathbf{b}}_2\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_3\hfill \\ {}\hfill {\mathbf{b}}_4\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill {\mathbf{c}}_1\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{c}}_2\hfill \\ {}\hfill {\mathbf{c}}_3\hfill \end{array}\hfill \\ {}\hfill {\mathbf{c}}_4\hfill \end{array}\right]=\left[\mathbf{i},\mathbf{j},\mathbf{k},1\right]\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{c}}_4\hfill \\ {}\hfill -{\mathbf{c}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{c}}_3\hfill \\ {}\hfill {\mathbf{c}}_4\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{c}}_2\hfill \\ {}\hfill {\mathbf{c}}_1\hfill \end{array}\hfill \\ {}\hfill {\mathbf{c}}_2\hfill & \hfill -{\mathbf{c}}_1\hfill & \hfill {\mathbf{c}}_4\hfill \\ {}\hfill -{\mathbf{c}}_1\hfill & \hfill -{\mathbf{c}}_2\hfill & \hfill -{\mathbf{c}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{c}}_1\hfill \\ {}\hfill {\mathbf{c}}_2\hfill \end{array}\hfill \\ {}\hfill {\mathbf{c}}_3\hfill \\ {}\hfill {\mathbf{c}}_4\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill {\mathbf{b}}_1\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{b}}_2\hfill \\ {}\hfill {\mathbf{b}}_3\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_4\hfill \end{array}\right]. $$
(40)
In Eq (40 ), \( \left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_4\hfill \\ {}\hfill {\mathbf{b}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_3\hfill \\ {}\hfill {\mathbf{b}}_4\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_2\hfill \\ {}\hfill -{\mathbf{b}}_1\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_2\hfill & \hfill {\mathbf{b}}_1\hfill & \hfill {\mathbf{b}}_4\hfill \\ {}\hfill -{\mathbf{b}}_1\hfill & \hfill -{\mathbf{b}}_2\hfill & \hfill -{\mathbf{b}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{b}}_1\hfill \\ {}\hfill {\mathbf{b}}_2\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_3\hfill \\ {}\hfill {\mathbf{b}}_4\hfill \end{array}\hfill \end{array}\right] \) is the quaternion component matrix, and \( \left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{c}}_4\hfill \\ {}\hfill -{\mathbf{c}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{c}}_3\hfill \\ {}\hfill {\mathbf{c}}_4\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{c}}_2\hfill \\ {}\hfill {\mathbf{c}}_1\hfill \end{array}\hfill \\ {}\hfill {\mathbf{c}}_2\hfill & \hfill -{\mathbf{c}}_1\hfill & \hfill {\mathbf{c}}_4\hfill \\ {}\hfill -{\mathbf{c}}_1\hfill & \hfill -{\mathbf{c}}_2\hfill & \hfill -{\mathbf{c}}_3\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{c}}_1\hfill \\ {}\hfill {\mathbf{c}}_2\hfill \end{array}\hfill \\ {}\hfill {\mathbf{c}}_3\hfill \\ {}\hfill {\mathbf{c}}_4\hfill \end{array}\hfill \end{array}\right] \) is the quaternion metamorphic matrix. The norm of a quaternion is defined by
$$ \mathbf{N}\left(\overrightarrow{\mathbf{b}}\right)=\mathbf{N}\left({\mathbf{b}}_1\boldsymbol{i}+{\mathbf{b}}_2\boldsymbol{j}+{\mathbf{b}}_3\boldsymbol{k}+{\mathbf{b}}_4\right)=\sqrt{{\mathbf{b}}_1^2+{\mathbf{b}}_2^2+{\mathbf{b}}_3^2+{\mathbf{b}}_4^2}. $$
(41)
A unit quaternion is a quaternion of norm one. Equivalently, its parameters b
1
, b
2
, b
3
, b
4
satisfy the following assumption:
$$ {\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}=\mathbf{1}. $$
(42)
Considering a unit quaternion \( \overrightarrow{\mathbf{b}}={\mathbf{b}}_{\mathbf{4}}+\overrightarrow{{\mathbf{b}}_{\mathbf{u}}} \) , the equation \( {\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}+{\left|\overrightarrow{{\mathbf{b}}_{\mathbf{u}}}\right|}^{\mathbf{2}}=\mathbf{1} \) implies that there should exist some angle φ satisfying that
$$ \mathbf{co}{\mathbf{s}}^{\mathbf{2}}\boldsymbol{\upvarphi} ={\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}, $$
(43)
$$ {\mathbf{sin}}^{\mathbf{2}}\boldsymbol{\upvarphi} ={\left|\overrightarrow{{\mathbf{b}}_{\mathbf{u}}}\right|}^{\mathbf{2}}. $$
(44)
In fact, there exists a unique φ
∈ [0, ] satisfying that cos
φ = b
4 and \( \mathbf{sin}\boldsymbol{\upvarphi } =\left|\overrightarrow{{\mathbf{b}}_{\mathbf{u}}}\right| \) . A unit quaternion is now able to be written in terms of the angle φ and a unit vector \( \mathbf{u}=\overrightarrow{{\mathbf{b}}_{\mathbf{u}}}/\left|\overrightarrow{{\mathbf{b}}_{\mathbf{u}}}\right|: \)
$$ \overrightarrow{\mathbf{b}}=\mathbf{cos}\boldsymbol{\upvarphi } +\mathbf{u}\bullet \bullet \mathbf{sin}\boldsymbol{\upvarphi } . $$
(45)
If there exists a scalar h satisfying that
$$ \mathbf{h}=\sqrt{{{\mathbf{b}}_{\mathbf{1}}}^{\mathbf{2}}+{{\mathbf{b}}_{\mathbf{2}}}^{\mathbf{2}}+{{\mathbf{b}}_{\mathbf{3}}}^{\mathbf{2}}}, $$
(46)
then u is written as
$$ \mathbf{u}=\frac{{\mathbf{b}}_{\mathbf{1}}}{\mathbf{h}}\mathbf{i}+\frac{{\mathbf{b}}_{\mathbf{2}}}{\mathbf{h}}\mathbf{j}+\frac{{\mathbf{b}}_{\mathbf{3}}}{\mathbf{h}}\mathbf{k}. $$
(47)
Unit quaternions are introduced for the purpose of describing the rotations of vectors in a coordinate system. It avoids the problem of gimbal lock caused by Euler angles.
A2 Rotation After the above preparations, the rotation matrix R is discussed. To start with, for any unit quaternion \( \overrightarrow{\mathbf{b}} \) satisfying
$$ \overrightarrow{\mathbf{b}}={\mathbf{b}}_{\mathbf{4}}+\overrightarrow{{\mathbf{b}}_{\mathbf{u}}}=\mathbf{cos}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right)+\mathbf{u}\bullet \mathbf{sin}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right), $$
(48)
and for any vector u ∈ R
3 , the action of the operator on u is equivalent to a rotation of the vector through an angle about \( \overrightarrow{\mathbf{b}} \) as the axis of rotation. Given a point in three-dimensional space, \( \overrightarrow{\mathbf{r}}=\left({\mathbf{r}}_{\mathbf{x}},{\mathbf{r}}_{\mathbf{y}},{\mathbf{r}}_{\mathbf{z}}\right) \) . Its quaternion representation is expressed as:
$$ \mathbf{r}=\left(\overrightarrow{\mathbf{r}},\mathbf{0}\right)=\left({\mathbf{r}}_{\mathbf{x}},{\mathbf{r}}_{\mathbf{y}},{\mathbf{r}}_{\mathbf{z}},\mathbf{0}\right) $$
(49)
The rotation function can be defined as follows:
$$ {\mathbf{r}}^{\mathbf{T}}=\overrightarrow{\mathbf{b}}\bullet \mathbf{r}\bullet {\overrightarrow{\mathbf{b}}}^{*}, $$
(50)
where
r
T
:
denotes the transformed vector;
r
:
denotes the quaternion representation of the vector
\( \overrightarrow{\boldsymbol{r}} \) ;
\( \overrightarrow{\boldsymbol{b}} \)
:
denotes the quaternion representation of an instrumental vector; and
\( {\overrightarrow{\boldsymbol{b}}}^{*} \)
:
denotes the congruent of
\( \overrightarrow{\boldsymbol{b}} \) .
The following shows how the original coordinate system is transformed to a new coordinate system. First, an instrumental vector \( \overrightarrow{\mathbf{b}} \) is defined as:
$$ \overrightarrow{\mathbf{b}}\equiv \left[\begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\right]=\left[\begin{array}{c}\hfill {\mathbf{E}}_{\mathbf{1}}\mathbf{sin}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right)\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{E}}_{\mathbf{2}}\mathbf{sin}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right)\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{E}}_{\mathbf{3}}\mathbf{sin}\left(\frac{\boldsymbol{\upvarphi}}{2}\right)\hfill \\ {}\hfill \mathbf{cos}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right)\hfill \end{array}\hfill \end{array}\hfill \end{array}\right]=\left[\begin{array}{c}\hfill \overrightarrow{\mathbf{E}}\mathbf{sin}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right)\hfill \\ {}\hfill \mathbf{cos}\left(\frac{\boldsymbol{\upvarphi}}{\mathbf{2}}\right)\hfill \end{array}\right], $$
(51)
where
$$ {\mathbf{E}}_{\mathbf{1}}=\frac{{\mathbf{b}}_{\mathbf{1}}}{\mathbf{h}}, $$
(52)
$$ {\mathbf{E}}_{\mathbf{2}}=\frac{{\mathbf{b}}_{\mathbf{2}}}{\mathbf{h}}, $$
(53)
$$ {\mathbf{E}}_{\mathbf{3}}=\frac{{\mathbf{b}}_{\mathbf{3}}}{\mathbf{h}}. $$
(54)
\( \overrightarrow{\mathbf{E}} = \left[\begin{array}{c}\hfill {\mathbf{E}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{E}}_{\mathbf{2}}\hfill \\ {}\hfill {\mathbf{E}}_{\mathbf{3}}\hfill \end{array}\right] = \left[\begin{array}{c}\hfill {\mathbf{X}}_{\mathbf{E}}\hfill \\ {}\hfill {\mathbf{Y}}_{\mathbf{E}}\hfill \\ {}\hfill {\mathbf{Z}}_{\mathbf{E}}\hfill \end{array}\right] \) is the rotation vector proposed previously. In this paper, φ is assumed to be equal to π radians:
$$ \boldsymbol{\upvarphi} =\boldsymbol{\uppi} $$
(55)
According to the previous Equations (34 ), (40 ), and (49 ), it is easy to obtain:
$$ \mathbf{r}\bullet {\overrightarrow{\mathbf{b}}}^{*}=\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill \mathbf{0}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{r}}_{\mathbf{3}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{2}}\hfill & \hfill {\mathbf{r}}_{\mathbf{1}}\hfill & \hfill \mathbf{0}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{1}}\hfill & \hfill -{\mathbf{r}}_{\mathbf{2}}\hfill & \hfill -{\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right] $$
(56)
and
$$ \overrightarrow{\mathbf{b}}\bullet \mathbf{r}\bullet {\overrightarrow{\mathbf{b}}}^{*}=\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill & \hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]\bullet \mathbf{r}\bullet {\overrightarrow{\mathbf{b}}}^{*}, $$
(57)
where \( \mathbf{r}\bullet {\overrightarrow{\mathbf{b}}}^{*} \) is a 4 by 1 matrix. Therefore
$$ {\mathbf{r}}^{\mathbf{T}}=\overrightarrow{\mathbf{b}}\bullet \mathbf{r}\bullet {\overrightarrow{\mathbf{b}}}^{*}=\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill & \hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill \mathbf{0}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{r}}_{\mathbf{3}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{2}}\hfill & \hfill {\mathbf{r}}_{\mathbf{1}}\hfill & \hfill \mathbf{0}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{1}}\hfill & \hfill -{\mathbf{r}}_{\mathbf{2}}\hfill & \hfill -{\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]. $$
(58)
According to the multiplication properties introduced previously, Equation (59 ) can be obtained:
$$ \left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill \mathbf{0}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{r}}_{\mathbf{3}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{2}}\hfill & \hfill {\mathbf{r}}_{\mathbf{1}}\hfill & \hfill \mathbf{0}\hfill \\ {}\hfill -{\mathbf{r}}_{\mathbf{1}}\hfill & \hfill -{\mathbf{r}}_{\mathbf{2}}\hfill & \hfill -{\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]=\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\right]. $$
(59)
Therefore, r
T can be rewritten as:
$$ {\mathbf{r}}^{\mathbf{T}}=\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill & \hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{cc}\hfill \begin{array}{ccc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{2}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{4}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{1}}\hfill & \hfill {\mathbf{b}}_{\mathbf{2}}\hfill & \hfill {\mathbf{b}}_{\mathbf{3}}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \begin{array}{c}\hfill -{\mathbf{b}}_{\mathbf{1}}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{2}}\hfill \end{array}\hfill \\ {}\hfill -{\mathbf{b}}_{\mathbf{3}}\hfill \\ {}\hfill {\mathbf{b}}_{\mathbf{4}}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\right]. $$
(60)
The above is reorganized as:
$$ {\mathbf{r}}^{\mathbf{T}}={\left[\begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\right]}_{\mathbf{T}}=\left[\begin{array}{ccc}\hfill {\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}\hfill & \hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{2}}-{\mathbf{b}}_{\mathbf{3}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill \begin{array}{cc}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{3}}+{\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill \kern1em \mathbf{0}\hfill \end{array}\hfill \\ {}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{2}}+{\mathbf{b}}_{\mathbf{3}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill {\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}\hfill & \hfill \begin{array}{cc}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{3}}-{\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill \kern1em \mathbf{0}\hfill \end{array}\hfill \\ {}\hfill \begin{array}{c}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{3}}-{\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{3}}+{\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill & \hfill \begin{array}{cc}\hfill \begin{array}{c}\hfill {\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\hfill & \hfill \begin{array}{c}\hfill \mathbf{0}\hfill \\ {}\hfill \mathbf{1}\hfill \end{array}\hfill \end{array}\hfill \end{array}\right]\left[\begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{1}}\hfill \\ {}\hfill \begin{array}{c}\hfill {\mathbf{r}}_{\mathbf{2}}\hfill \\ {}\hfill {\mathbf{r}}_{\mathbf{3}}\hfill \end{array}\hfill \\ {}\hfill \mathbf{0}\hfill \end{array}\right]. $$
(61)
The resulting rotation matrix is
$$ \mathbf{R}=\left[\begin{array}{ccc}\hfill {\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}\hfill & \hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{2}}-{\mathbf{b}}_{\mathbf{3}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill 2\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{3}}+{\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill \\ {}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{2}}+{\mathbf{b}}_{\mathbf{3}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill {\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}\hfill & \hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{3}}-{\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill \\ {}\hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{3}}-{\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill \mathbf{2}\left({\mathbf{b}}_{\mathbf{2}}{\mathbf{b}}_{\mathbf{3}}+{\mathbf{b}}_{\mathbf{1}}{\mathbf{b}}_{\mathbf{4}}\right)\hfill & \hfill {\mathbf{b}}_{\mathbf{3}}^{\mathbf{2}}+{\mathbf{b}}_{\mathbf{4}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{1}}^{\mathbf{2}}-{\mathbf{b}}_{\mathbf{2}}^{\mathbf{2}}\hfill \end{array}\right] = \left[\begin{array}{ccc}\hfill {\mathbf{R}}_{\mathbf{1}\mathbf{1}}\hfill & \hfill {\mathbf{R}}_{\mathbf{1}\mathbf{2}}\hfill & \hfill {\mathbf{R}}_{\mathbf{1}\mathbf{3}}\hfill \\ {}\hfill {\mathbf{R}}_{\mathbf{2}\mathbf{1}}\hfill & \hfill {\mathbf{R}}_{\mathbf{2}\mathbf{2}}\hfill & \hfill {\mathbf{R}}_{\mathbf{2}\mathbf{3}}\hfill \\ {}\hfill {\mathbf{R}}_{\mathbf{3}\mathbf{1}}\hfill & \hfill {\mathbf{R}}_{\mathbf{3}\mathbf{2}}\hfill & \hfill {\mathbf{R}}_{\mathbf{3}\mathbf{3}}\hfill \end{array}\right]. $$
(62)
A3 A Two-Dimensional Geographical Case In a two-dimensional geographical case, an element in the weight matrix in Eq (10 ) is transformed to that in Eq (63 ),
$$ {\mathbf{w}}_{\mathbf{ij}}=\frac{\mathbf{1}}{{\mathbf{d}}_{\mathbf{ij}}}. $$
(63)
where w
ij
is an element in the i
th row and the j
th column of a n × n weight matrix W with each row summing to 1 (row stochastic) and d
ij
denotes the spatiotemporal distance between observation i and observation j . It is worth noting that elements in the weight matrix W are no longer required to be arranged in chronological order and the weight matrix W is no longer required to a lower triangular matrix.
In a two-dimensional geographical case, the gradient of the scale field is defined as follows.
Definition 3 The gradient of the scalar field u , on a two-dimensional geographical scale, is a vector function and is defined as follows:
$$ \mathbf{grad}\ \mathbf{u}=\mathbf{\nabla}\mathbf{u}\equiv \frac{\boldsymbol{\Delta} \mathbf{u}}{\mathbf{d}} = \left(\begin{array}{c}\hfill \frac{\mathbf{\partial}\mathbf{u}}{\mathbf{\partial}\mathbf{x}}\hfill \\ {}\hfill \frac{\mathbf{\partial}\mathbf{u}}{\mathbf{\partial}\mathbf{y}}\hfill \end{array}\right), $$
(64)
where
grad u
or ∇u
:
denotes the gradient of vector
u
;
u
:
denotes the estimated residuals;
X
:
denotes the latitude;
Y
:
denotes the longitude; and
D
:
denotes the spatial distance between observations.
Consequently, in a two-dimensional geographical case, the gradient of a kernel observation in a geographical neighborhood is defined as follows.
Definition 4 The gradient of a kernel observation in a two-dimensional geographical neighborhood is defined as the arithmetic mean of the gradients of neighboring observations to the kernel observation.
$$ \mathbf{\nabla}{\mathbf{u}}_{\mathbf{j}} \equiv \frac{\mathbf{1}}{\mathbf{k}}{\displaystyle \sum_{\mathbf{i}=\mathbf{1}}^{\mathbf{k}}}\mathbf{\nabla}{\mathbf{u}}_{\mathbf{i}\mathbf{j}}=\left(\begin{array}{c}\hfill \frac{\mathbf{1}}{\mathbf{n}}{\displaystyle \sum_{\mathbf{i}=\mathbf{1}}^{\mathbf{k}}}\frac{{\mathbf{u}}_{\mathbf{j}}-{\mathbf{u}}_{\mathbf{i}}}{{\mathbf{x}}_{\mathbf{j}}-{\mathbf{x}}_{\mathbf{i}}}\hfill \\ {}\hfill \frac{\mathbf{1}}{\mathbf{n}}{\displaystyle \sum_{\mathbf{i}=\mathbf{1}}^{\mathbf{k}}}\frac{{\mathbf{u}}_{\mathbf{j}}-{\mathbf{u}}_{\mathbf{i}}}{{\mathbf{y}}_{\mathbf{j}}-{\mathbf{y}}_{\mathbf{i}}}\hfill \end{array}\right), $$
(65)
where
∇u
j
:
denotes the gradient of a kernel observation
j ;
u
j
:
denotes the estimated residual of the regression equation for a kernel observation
j ;
x
j
:
denotes the latitude of a kernel observation
j ;
y
j
:
denotes the longitude of a kernel observation
j ;
u
i
:
denotes the estimated residual of the regression equation for a non-kernel observation i ;
x
i
:
denotes the latitude of a non-kernel observation
i ;
y
i
:
denotes the longitude of a non-kernel observation
i
; and
k
:
denotes the number of non-kernel observations in a geographical neighborhood.
The rotation of the two-dimensional spatial coordinate system can be conducted by the quaternion method by adding an equal temporal coordinate to the original two-dimensional geographical coordinates of all observations.
In addition, in a two-dimensional geographical case, the distance calculation in Eq (25 ) is transformed to that in Eq (66 ),
$$ {\mathbf{d}}_{\mathbf{ij}}^{\mathbf{T}}={\left({\left({\mathbf{x}}_{\mathbf{ij}}^{\mathbf{T}}-{\mathbf{x}}_{\mathbf{0j}}^{\mathbf{T}}\right)}^{\mathbf{2}}+{\boldsymbol{\upvarphi}}_{\mathbf{1}}*{\left({\mathbf{y}}_{\mathbf{ij}}^{\mathbf{T}}-{\mathbf{y}}_{\mathbf{0j}}^{\mathbf{T}}\right)}^{\mathbf{2}}\right)}^{\mathbf{1}/2}. $$
(66)
The spatiotemporal forecast method introduced in Section “Spatiotemporal Forecast” still applies to the two-dimensional geographical forecast. However, unlike spatiotemporal forecast, the temporal locations of the ex post observations are not required in a two-dimensional geographical case.
A4 The Comparison of the Goodness of Fit with Different Shrinking Magnitudes
Table 10 The comparison of the goodness of fit with different shrinking magnitudes spatial durbin model (1)
Table 11 The comparison of the goodness of fit with different shrinking magnitudes spatial durbin model (2)
A5 In-Sample Regression Results
Table 12 In-sample non-spatiotemporal model and spatial error model (optimal shrinking magnitudes) estimation results (1)
Table 13 In-sample spatial error model (optimal shrinking magnitudes) estimation results (2)
Table 14 In-sample spatial durbin model (optimal shrinking magnitudes) estimation results (1)
Table 15 In-sample spatial durbin model (optimal shrinking magnitudes) estimation results (2)