In applied mathematics, discretization is the process of transferring continuous functions, models, variables, and equations into discrete counterparts. This process is usually carried out as a first step toward making them suitable for numerical evaluation and implementation on digital computers. Dichotomization is the special case of discretization in which the number of discrete classes is 2, which can approximate a continuous variable as a binary variable (creating a dichotomy for modeling purposes, as in binary classification).
Discretization is also related to discrete mathematics, and is an important component of granular computing. In this context, discretization may also refer to modification of variable or category granularity, as when multiple discrete variables are aggregated or multiple discrete categories fused.
Whenever continuous data is discretized, there is always some amount of discretization error. The goal is to reduce the amount to a level considered negligible for the modeling purposes at hand.
The terms discretization and quantization often have the same denotation but not always identical connotations. (Specifically, the two terms share a semantic field.) The same is true of discretization error and quantization error.
Mathematical methods relating to discretization include the Euler–Maruyama method and the zero-order hold.
Discretization is also concerned with the transformation of continuous differential equations into discrete difference equations, suitable for numerical computing.
The following continuous-time state space model
x |
(t)=Ax(t)+Bu(t)+w(t)
y(t)=Cx(t)+Du(t)+v(t)
where v and w are continuous zero-mean white noise sources with power spectral densities
w(t)\simN(0,Q)
v(t)\simN(0,R)
can be discretized, assuming zero-order hold for the input u and continuous integration for the noise v, to
x[k+1]=Adx[k]+Bdu[k]+w[k]
y[k]=Cdx[k]+Ddu[k]+v[k]
with covariances
w[k]\simN(0,Qd)
v[k]\simN(0,Rd)
where
Ad=eAT=l{L}-1\{(sI-A)-1\}t=T
Bd=\left(
T | |
\int | |
\tau=0 |
eA\taud\tau\right)B=A-1(Ad-I)B
A
Cd=C
Dd=D
Qd=
T | |
\int | |
\tau=0 |
eA\tau
A\top\tau | |
Qe |
d\tau
Rd=R
1 | |
T |
and
T
A\top
A
A clever trick to compute Ad and Bd in one step is by utilizing the following property:[2]
e\begin{bmatrixA&B\\ 0&0\end{bmatrix}T}=\begin{bmatrix}
Ad |
&
Bd |
\\ 0&I\end{bmatrix}
Where
Ad
Bd
Numerical evaluation of
Qd
F= \begin{bmatrix}-A&Q\\ 0&A\top\end{bmatrix}T
G=eF= \begin{bmatrix}...&
-1 | |
A | |
d |
Qd\\ 0&
\top | |
A | |
d |
\end{bmatrix}.
Qd=
\top) | |
(A | |
d |
\top
-1 | |
(A | |
d |
Qd)=Ad
-1 | |
(A | |
d |
Qd).
Starting with the continuous model
|
=Ax(t)+Bu(t)
d | |
dt |
eAt=AeAt=eAtA
e-At
|
=e-AtAx(t)+e-AtBu(t)
d | |
dt |
(e-Atx(t))=e-AtBu(t)
e-Atx(t)-e0x(0)=
t | |
\int | |
0 |
e-A\tauBu(\tau)d\tau
x(t)=eAtx(0)+
t | |
\int | |
0 |
eA(t-\tau)Bu(\tau)d\tau
Now we want to discretise the above expression. We assume that u is constant during each timestep.
x[k] \stackrel{def
x[k]=eAkTx(0)+
kT | |
\int | |
0 |
eA(kT-\tau)Bu(\tau)d\tau
x[k+1]=eA(k+1)Tx(0)+
(k+1)T | |
\int | |
0 |
eA((k+1)T-\tau)Bu(\tau)d\tau
x[k+1]=eAT\left[eAkTx(0)+
kT | |
\int | |
0 |
eA(kT-\tau)Bu(\tau)d\tau\right]+
(k+1)T | |
\int | |
kT |
eA(kT+T-\tau)Bu(\tau)d\tau
x[k]
v(\tau)=kT+T-\tau
d\tau=-dv
u
\begin{matrix}x[k+1]&=&eATx[k]-\left(
v((k+1)T) | |
\int | |
v(kT) |
eAvdv\right)Bu[k]\\ &=&eATx[k]-\left(
0 | |
\int | |
T |
eAvdv\right)Bu[k]\\ &=&eATx[k]+\left(
T | |
\int | |
0 |
eAvdv\right)Bu[k]\\ &=&eATx[k]+A-1\left(eAT-I\right)Bu[k]\end{matrix}
When
A
eAT
e{AT}=
infty | |
\sum | |
k=0 |
1 | |
k! |
({A}T)k.
\begin{matrix}x[k+1]&=&e{AT}x[k]+\left(
T | |
\int | |
0 |
e{Av}dv\right)
infty | |
Bu[k]\\ &=&\left(\sum | |
k=0 |
1 | |
k! |
({A}T)k\right)x[k]+
infty | |
\left(\sum | |
k=1 |
1 | |
k! |
{A}k-1Tk\right)Bu[k],\end{matrix}
Exact discretization may sometimes be intractable due to the heavy matrix exponential and integral operations involved. It is much easier to calculate an approximate discrete model, based on that for small timesteps
eAT ≈ I+AT
x[k+1] ≈ (I+AT)x[k]+TBu[k]
This is also known as the Euler method, which is also known as the forward Euler method. Other possible approximations are
eAT ≈ \left(I-AT\right)-1
eAT ≈ \left(I+
1 | |
2 |
AT\right)\left(I-
1 | |
2 |
AT\right)-1
See main article: Discretization of continuous features. In statistics and machine learning, discretization refers to the process of converting continuous features or variables to discretized or nominal features. This can be useful when creating probability mass functions.
In generalized functions theory, discretizationarises as a particular case of the Convolution Theoremon tempered distributions
l{F}\{f*\operatorname{III}\}=l{F}\{f\} ⋅ \operatorname{III}
l{F}\{\alpha ⋅ \operatorname{III}\}=l{F}\{\alpha\}*\operatorname{III}
where
\operatorname{III}
⋅ \operatorname{III}
*\operatorname{III}
f
\delta
\alpha
1
l{F}
\alpha
As an example, discretization of the function that is constantly
1
[..,1,1,1,..]
[1,1,1,1]