SLIDE 8 Efficient Coding Digression: A Tiny Bit of Asymptotic Notation The ARDL Model Optimal Lag Selection Incremental Code Improvements
Asymptotic Notation
➓ O ♣g ♣nqq(“(big) oh of g of n”), as opposed to Θ♣g♣nqq, is used
here to only denote an upper bound. Notation differs in the literature.
➓ Technically, Θ♣g♣nqq and O♣g♣nqq are sets of functions, so we
write e.g. T ♣nq PO♣g♣nqq.
➓ For matrix operations, g ♣nq is frequently n raised to some low
integer power.
➓ Θ ♣nq is much better than Θ
, which in turn is much better than Θ
➓ (Square) matrix multiplication is Θ
: each element of the new n ✂ n matrix is a sum of n terms. Costly!
➓ Many types of matrix inversion, e.g. the LU-decomposition, are also
Θ
. Costly!
➓ Inner vector products are Θ ♣nq.
➓ When T ♣nq is an i-th order polynomial, the leading term
asymptotically dominates: T ♣nq P O
.
➓ Θ ♣anq is worse than Θ ♣naq; Θ ♣lg nq is better than Θ ♣nq Kripfganz/Schneider Uni Exeter & MPIDR Speeding Up ARDL June 23, 2017 8 / 27