Discretization

From Wikipedia, the free encyclopedia
(Redirected from Discretizing)
Jump to navigation Jump to search
A solution to a discretized partial differential equation, obtained with the finite element method.

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 of linear state space models

[edit | edit source]

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

๐ฑห™(t)=๐€๐ฑ(t)+๐๐ฎ(t)+๐ฐ(t)๐ฒ(t)=๐‚๐ฑ(t)+๐ƒ๐ฎ(t)+๐ฏ(t)

where v and w are continuous zero-mean white noise sources with power spectral densities

๐ฐ(t)โˆผN(0,๐)๐ฏ(t)โˆผN(0,๐‘)

can be discretized, assuming zero-order hold for the input u and continuous integration for the noise v, to

๐ฑ[k+1]=๐€๐๐ฑ[k]+๐๐๐ฎ[k]+๐ฐ[k]๐ฒ[k]=๐‚๐๐ฑ[k]+๐ƒ๐๐ฎ[k]+๐ฏ[k]

with covariances

๐ฐ[k]โˆผN(0,๐๐)๐ฏ[k]โˆผN(0,๐‘๐)

where

๐€๐=e๐€T=โ„’โˆ’1{(s๐ˆโˆ’๐€)โˆ’1}t=T๐๐=(โˆซฯ„=0Te๐€ฯ„dฯ„)๐๐‚๐=๐‚๐ƒ๐=๐ƒ๐๐=โˆซฯ„=0Te๐€ฯ„๐e๐€โŠคฯ„dฯ„๐‘๐=๐‘1T

and T is the sample time. If A is nonsingular, ๐๐=๐€โˆ’1(๐€๐โˆ’๐ˆ)๐.

The equation for the discretized measurement noise is a consequence of the continuous measurement noise being defined with a power spectral density.[1]

A clever trick to compute Ad and Bd in one step is by utilizing the following property:[2]: p. 215 

e[๐€๐๐ŸŽ๐ŸŽ]T=[๐€๐๐๐๐ŸŽ๐ˆ]

Where Ad and Bd are the discretized state-space matrices.

Discretization of process noise

[edit | edit source]

Numerical evaluation of Qd is a bit trickier due to the matrix exponential integral. It can, however, be computed by first constructing a matrix, and computing the exponential of it[3] ๐…=[โˆ’๐€๐๐ŸŽ๐€โŠค]T๐†=e๐…=[๐€๐โˆ’1๐๐๐ŸŽ๐€๐โŠค] The discretized process noise is then evaluated by multiplying the transpose of the lower-right partition of G with the upper-right partition of G: ๐๐=(๐€๐โŠค)โŠค(๐€๐โˆ’1๐๐)=๐€๐(๐€๐โˆ’1๐๐).

Derivation

[edit | edit source]

Starting with the continuous model ๐ฑห™(t)=๐€๐ฑ(t)+๐๐ฎ(t) we know that the matrix exponential is ddte๐€t=๐€e๐€t=e๐€t๐€ and by premultiplying the model we get eโˆ’๐€t๐ฑห™(t)=eโˆ’๐€t๐€๐ฑ(t)+eโˆ’๐€t๐๐ฎ(t) which we recognize as ddt[eโˆ’๐€t๐ฑ(t)]=eโˆ’๐€t๐๐ฎ(t) and by integrating, eโˆ’๐€t๐ฑ(t)โˆ’e0๐ฑ(0)=โˆซ0teโˆ’๐€ฯ„๐๐ฎ(ฯ„)dฯ„๐ฑ(t)=e๐€t๐ฑ(0)+โˆซ0te๐€(tโˆ’ฯ„)๐๐ฎ(ฯ„)dฯ„ which is an analytical solution to the continuous model.

Now we want to discretise the above expression. We assume that u is constant during each timestep. ๐ฑ[k]=def ๐ฑ(kT)๐ฑ[k]=e๐€kT๐ฑ(0)+โˆซ0kTe๐€(kTโˆ’ฯ„)๐๐ฎ(ฯ„)dฯ„๐ฑ[k+1]=e๐€(k+1)T๐ฑ(0)+โˆซ0(k+1)Te๐€[(k+1)Tโˆ’ฯ„]๐๐ฎ(ฯ„)dฯ„๐ฑ[k+1]=e๐€T[e๐€kT๐ฑ(0)+โˆซ0kTe๐€(kTโˆ’ฯ„)๐๐ฎ(ฯ„)dฯ„]+โˆซkT(k+1)Te๐€(kT+Tโˆ’ฯ„)๐๐ฎ(ฯ„)dฯ„ We recognize the bracketed expression as ๐ฑ[k], and the second term can be simplified by substituting with the function v(ฯ„)=kT+Tโˆ’ฯ„. Note that dฯ„=โˆ’dv. We also assume that u is constant during the integral, which in turn yields

๐ฑ[k+1]=e๐€T๐ฑ[k]โˆ’(โˆซv(kT)v((k+1)T)e๐€vdv)๐๐ฎ[k]=e๐€T๐ฑ[k]โˆ’(โˆซT0e๐€vdv)๐๐ฎ[k]=e๐€T๐ฑ[k]+(โˆซ0Te๐€vdv)๐๐ฎ[k]=e๐€T๐ฑ[k]+๐€โˆ’1(e๐€Tโˆ’๐ˆ)๐๐ฎ[k]

which is an exact solution to the discretization problem.

When A is singular, the latter expression can still be used by replacing e๐€T by its Taylor expansion, e๐€T=โˆ‘k=0โˆž1k!(๐€T)k. This yields ๐ฑ[k+1]=e๐€T๐ฑ[k]+(โˆซ0Te๐€vdv)๐๐ฎ[k]=(โˆ‘k=0โˆž1k!(๐€T)k)๐ฑ[k]+(โˆ‘k=1โˆž1k!๐€kโˆ’1Tk)๐๐ฎ[k], which is the form used in practice.

Approximations

[edit | edit source]

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 e๐€Tโ‰ˆ๐ˆ+๐€T. The approximate solution then becomes: ๐ฑ[k+1]โ‰ˆ(๐ˆ+๐€T)๐ฑ[k]+T๐๐ฎ[k]

This is also known as the Euler method, which is also known as the forward Euler method. Other possible approximations are e๐€Tโ‰ˆ(๐ˆโˆ’๐€T)โˆ’1, otherwise known as the backward Euler method and e๐€Tโ‰ˆ(๐ˆ+12๐€T)(๐ˆโˆ’12๐€T)โˆ’1, which is known as the bilinear transform, or Tustin transform. Each of these approximations has different stability properties. The bilinear transform preserves the instability of the continuous-time system.

Discretization of continuous features

[edit | edit source]

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.

Discretization of smooth functions

[edit | edit source]

In generalized functions theory, discretization arises as a particular case of the Convolution Theorem on tempered distributions

โ„ฑ{f*III}=โ„ฑ{f}โ‹…III
โ„ฑ{ฮฑโ‹…III}=โ„ฑ{ฮฑ}*III

where III is the Dirac comb, โ‹…III is discretization, *III is periodization, f is a rapidly decreasing tempered distribution (e.g. a Dirac delta function ฮด or any other compactly supported function), ฮฑ is a smooth, slowly growing ordinary function (e.g. the function that is constantly 1 or any other band-limited function) and โ„ฑ is the (unitary, ordinary frequency) Fourier transform. Functions ฮฑ which are not smooth can be made smooth using a mollifier prior to discretization.

As an example, discretization of the function that is constantly 1 yields the sequence [..,1,1,1,..] which, interpreted as the coefficients of a linear combination of Dirac delta functions, forms a Dirac comb. If additionally truncation is applied, one obtains finite sequences, e.g. [1,1,1,1]. They are discrete in both, time and frequency.

See also

[edit | edit source]

References

[edit | edit source]
  1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Raymond DeCarlo: Linear Systems: A State Variable Approach with Numerical Implementation, Prentice Hall, NJ, 1989
  3. ^ Charles Van Loan: Computing integrals involving the matrix exponential, IEEE Transactions on Automatic Control. 23 (3): 395โ€“404, 1978

Further reading

[edit | edit source]
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
[edit | edit source]

Lua error in Module:Sister_project_links at line 396: attempt to index field 'wikibase' (a nil value). Lua error in Module:Authority_control at line 153: attempt to index field 'wikibase' (a nil value).