In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
(including
combinatorics
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many appl ...
,
linear algebra
Linear algebra is the branch of mathematics concerning linear equations such as:
:a_1x_1+\cdots +a_nx_n=b,
linear maps such as:
:(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n,
and their representations in vector spaces and through matrices.
...
, and
dynamical systems
In mathematics, a dynamical system is a system in which a function describes the time dependence of a point in an ambient space. Examples include the mathematical models that describe the swinging of a clock pendulum, the flow of water in a p ...
), a linear recurrence with constant coefficients
(also known as a linear recurrence relation or linear difference equation) sets equal to 0 a
polynomial
In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An exa ...
that is linear in the various iterates of a
variable
Variable may refer to:
* Variable (computer science), a symbolic name associated with a value and whose associated value may be changed
* Variable (mathematics), a symbol that represents a quantity in a mathematical expression, as used in many ...
—that is, in the values of the elements of a
sequence
In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is calle ...
. The polynomial's linearity means that each of its terms has
degree
Degree may refer to:
As a unit of measurement
* Degree (angle), a unit of angle measurement
** Degree of geographical latitude
** Degree of geographical longitude
* Degree symbol (°), a notation used in science, engineering, and mathematics
...
0 or 1. A linear recurrence denotes the evolution of some variable over time, with the current
time period
The categorisation of the past into discrete, quantified named blocks of time is called periodization.Adam Rabinowitz. And kingIt’s about time: historical periodization and Linked Ancient World Data'. Study of the Ancient universe Papers, 2014 ...
or discrete moment in time denoted as , one period earlier denoted as , one period later as , etc.
The ''
solution
Solution may refer to:
* Solution (chemistry), a mixture where one substance is dissolved in another
* Solution (equation), in mathematics
** Numerical solution, in numerical analysis, approximate solutions within specified error bounds
* Soluti ...
'' of such an equation is a function of , and not of any iterate values, giving the value of the iterate at any time. To find the solution it is necessary to know the specific values (known as ''
initial condition
In mathematics and particularly in dynamic systems, an initial condition, in some contexts called a seed value, is a value of an evolving variable at some point in time designated as the initial time (typically denoted ''t'' = 0). For ...
s'') of of the iterates, and normally these are the iterates that are oldest. The equation or its variable is said to be ''
stable
A stable is a building in which livestock, especially horses, are kept. It most commonly means a building that is divided into separate stalls for individual animals and livestock. There are many different types of stables in use today; the ...
'' if from any set of initial conditions the variable's limit as time goes to infinity exists; this limit is called the ''
steady state
In systems theory, a system or a Process theory, process is in a steady state if the variables (called state variables) which define the behavior of the system or the process are unchanging in time. In continuous time, this means that for those p ...
''.
Difference equations are used in a variety of contexts, such as in
economics
Economics () is the social science that studies the Production (economics), production, distribution (economics), distribution, and Consumption (economics), consumption of goods and services.
Economics focuses on the behaviour and intera ...
to model the evolution through time of variables such as
gross domestic product
Gross domestic product (GDP) is a money, monetary Measurement in economics, measure of the market value of all the final goods and services produced and sold (not resold) in a specific time period by countries. Due to its complex and subjec ...
, the
inflation rate
In economics, inflation is an increase in the general price level of goods and services in an economy. When the general price level rises, each unit of currency buys fewer goods and services; consequently, inflation corresponds to a reductio ...
, the
exchange rate
In finance, an exchange rate is the rate at which one currency will be exchanged for another currency. Currencies are most commonly national currencies, but may be sub-national as in the case of Hong Kong or supra-national as in the case of ...
, etc. They are used in modeling such
time series
In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. Exa ...
because values of these variables are only measured at discrete intervals. In
econometric
Econometrics is the application of statistical methods to economic data in order to give empirical content to economic relationships. M. Hashem Pesaran (1987). "Econometrics," '' The New Palgrave: A Dictionary of Economics'', v. 2, p. 8 p. 8 ...
applications, linear difference equations are modeled with
stochastic terms in the form of
autoregressive (AR) models and in models such as
vector autoregression
Vector autoregression (VAR) is a statistical model used to capture the relationship between multiple quantities as they change over time. VAR is a type of stochastic process model. VAR models generalize the single-variable (univariate) autoregres ...
(VAR) and
autoregressive moving average
In statistics, econometrics and signal processing, an autoregressive (AR) model is a representation of a type of random process; as such, it is used to describe certain time-varying processes in nature, economics, etc. The autoregressive model spe ...
(ARMA) models that combine AR with other features.
Definitions
A linear recurrence with constant coefficients is an equation of the following form, written in terms of
parameters
A parameter (), generally, is any characteristic that can help in defining or classifying a particular system (meaning an event, project, object, situation, etc.). That is, a parameter is an element of a system that is useful, or critical, when ...
and :
:
or equivalently as
:
The positive integer
is called the order of the recurrence and denotes the longest time lag between iterates. The equation is called homogeneous if and nonhomogeneous if .
If the equation is homogeneous, the coefficients determine the
characteristic polynomial
In linear algebra, the characteristic polynomial of a square matrix is a polynomial which is invariant under matrix similarity and has the eigenvalues as roots. It has the determinant and the trace of the matrix among its coefficients. The chara ...
(also "auxiliary polynomial" or "companion polynomial")
:
whose roots play a crucial role in finding and understanding the sequences satisfying the recurrence.
Conversion to homogeneous form
If , the equation
:
is said to be ''nonhomogeneous''. To solve this equation it is convenient to convert it to homogeneous form, with no constant term. This is done by first finding the equation's ''steady state value''—a value such that, if successive iterates all had this value, so would all future values. This value is found by setting all values of equal to in the difference equation, and solving, thus obtaining
:
assuming the denominator is not 0. If it is zero, the steady state does not exist.
Given the steady state, the difference equation can be rewritten in terms of deviations of the iterates from the steady state, as
:
which has no constant term, and which can be written more succinctly as
:
where equals . This is the homogeneous form.
If there is no steady state, the difference equation
:
can be combined with its equivalent form
:
to obtain (by solving both for )
:
in which like terms can be combined to give a homogeneous equation of one order higher than the original.
Solution example for small orders
The roots of the characteristic polynomial play a crucial role in finding and understanding the sequences satisfying the recurrence. If there are
distinct roots
then each solution to the recurrence takes the form
:
where the coefficients
are determined in order to fit the initial conditions of the recurrence. When the same roots occur multiple times, the terms in this formula corresponding to the second and later occurrences of the same root are multiplied by increasing powers of
. For instance, if the characteristic polynomial can be factored as
, with the same root
occurring three times, then the solution would take the form
:
Order 1
For order 1, the recurrence
:
has the solution
with
and the most general solution is
with
. The characteristic polynomial equated to zero (the
characteristic equation) is simply
.
Order 2
Solutions to such recurrence relations of higher order are found by systematic means, often using the fact that
is a solution for the recurrence exactly when
is a root of the characteristic polynomial. This can be approached directly or using
generating function
In mathematics, a generating function is a way of encoding an infinite sequence of numbers () by treating them as the coefficients of a formal power series. This series is called the generating function of the sequence. Unlike an ordinary seri ...
s (
formal power series
In mathematics, a formal series is an infinite sum that is considered independently from any notion of convergence, and can be manipulated with the usual algebraic operations on series (addition, subtraction, multiplication, division, partial sum ...
) or matrices.
Consider, for example, a recurrence relation of the form
:
When does it have a solution of the same general form as
? Substituting this guess (
ansatz
In physics and mathematics, an ansatz (; , meaning: "initial placement of a tool at a work piece", plural Ansätze ; ) is an educated guess or an additional assumption made to help solve a problem, and which may later be verified to be part of the ...
) in the recurrence relation, we find that
:
must be true for all
.
Dividing through by
, we get that all these equations reduce to the same thing:
:
:
which is the characteristic equation of the recurrence relation. Solve for
to obtain the two roots
,
: these roots are known as the
characteristic root
In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denoted b ...
s or eigenvalues of the characteristic equation. Different solutions are obtained depending on the nature of the roots: If these roots are distinct, we have the general solution
:
while if they are identical (when
), we have
:
This is the most general solution; the two constants
and
can be chosen based on two given initial conditions
and
to produce a specific solution.
In the case of complex eigenvalues (which also gives rise to complex values for the solution parameters
and
), the use of complex numbers can be eliminated by rewriting the solution in trigonometric form. In this case we can write the eigenvalues as
Then it can be shown that
:
can be rewritten as
:
where
:
Here
and
(or equivalently,
and
) are real constants which depend on the initial conditions. Using
:
:
one may simplify the solution given above as
:
where
and
are the initial conditions and
:
In this way there is no need to solve for
and
.
In all cases—real distinct eigenvalues, real duplicated eigenvalues, and complex conjugate eigenvalues—the equation is
stable
A stable is a building in which livestock, especially horses, are kept. It most commonly means a building that is divided into separate stalls for individual animals and livestock. There are many different types of stables in use today; the ...
(that is, the variable
converges to a fixed value
pecifically, zero if and only if ''both'' eigenvalues are smaller than one in
absolute value
In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), an ...
. In this second-order case, this condition on the eigenvalues can be shown
[Papanicolaou, Vassilis, "On the asymptotic stability of a class of linear difference equations," ''Mathematics Magazine'' 69(1), February 1996, 34–43.] to be equivalent to
, which is equivalent to
and
.
General solution
Characteristic polynomial and roots
Solving the homogeneous equation
:
involves first solving its characteristic polynomial
:
for its characteristic roots . These roots can be solved for
algebraically if , but
not necessarily otherwise. If the solution is to be used numerically, all the roots of this characteristic equation can be found by
numerical methods
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods th ...
. However, for use in a theoretical context it may be that the only information required about the roots is whether any of them are greater than or equal to 1 in
absolute value
In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), an ...
.
It may be that all the roots are
real
Real may refer to:
Currencies
* Brazilian real (R$)
* Central American Republic real
* Mexican real
* Portuguese real
* Spanish real
* Spanish colonial real
Music Albums
* ''Real'' (L'Arc-en-Ciel album) (2000)
* ''Real'' (Bright album) (2010)
...
or instead there may be some that are
complex number
In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...
s. In the latter case, all the complex roots come in
complex conjugate
In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, (if a and b are real, then) the complex conjugate of a + bi is equal to a - ...
pairs.
Solution with distinct characteristic roots
If all the characteristic roots are distinct, the solution of the homogeneous linear recurrence
:
can be written in terms of the characteristic roots as
:
where the coefficients can be found by invoking the initial conditions. Specifically, for each time period for which an iterate value is known, this value and its corresponding value of can be substituted into the solution equation to obtain a linear equation in the as-yet-unknown parameters; such equations, one for each initial condition, can be
solved simultaneously for the parameter values. If all characteristic roots are real, then all the coefficient values will also be real; but with non-real complex roots, in general some of these coefficients will also be non-real.
Converting complex solution to trigonometric form
If there are complex roots, they come in conjugate pairs and so do the complex terms in the solution equation. If two of these complex terms are and , the roots can be written as
:
where is the
imaginary unit
The imaginary unit or unit imaginary number () is a solution to the quadratic equation x^2+1=0. Although there is no real number with this property, can be used to extend the real numbers to what are called complex numbers, using addition an ...
and is the
modulus of the roots:
:
Then the two complex terms in the solution equation can be written as
:
where is the angle whose cosine is and whose sine is ; the last equality here made use of
de Moivre's formula
In mathematics, de Moivre's formula (also known as de Moivre's theorem and de Moivre's identity) states that for any real number and integer it holds that
:\big(\cos x + i \sin x\big)^n = \cos nx + i \sin nx,
where is the imaginary unit (). ...
.
Now the process of finding the coefficients and guarantees that they are also complex conjugates, which can be written as . Using this in the last equation gives this expression for the two complex terms in the solution equation:
:
which can also be written as
:
where is the angle whose cosine is and whose sine is .
Cyclicity
Depending on the initial conditions, even with all roots real the iterates can experience a transitory tendency to go above and below the steady state value. But true cyclicity involves a permanent tendency to fluctuate, and this occurs if there is at least one pair of complex conjugate characteristic roots. This can be seen in the trigonometric form of their contribution to the solution equation, involving and .
Solution with duplicate characteristic roots
In the second-order case, if the two roots are identical (), they can both be denoted as and a solution may be of the form
:
Solution by conversion to matrix form
An alternative solution method involves converting the th order difference equation to a first-order
matrix difference equation
A matrix difference equation is a difference equation in which the value of a vector (or sometimes, a matrix) of variables at one point in time is related to its own value at one or more previous points in time, using matrices. The order of the eq ...
. This is accomplished by writing , , , and so on. Then the original single th-order equation
:
can be replaced by the following first-order equations:
:
Defining the vector as
:
this can be put in matrix form as
:
Here is an matrix in which the first row contains and all other rows have a single 1 with all other elements being 0, and is a column vector with first element and with the rest of its elements being 0.
This matrix equation can be solved using the methods in the article
Matrix difference equation
A matrix difference equation is a difference equation in which the value of a vector (or sometimes, a matrix) of variables at one point in time is related to its own value at one or more previous points in time, using matrices. The order of the eq ...
.
Solution using generating functions
The recurrence
:
can be solved using the theory of
generating function
In mathematics, a generating function is a way of encoding an infinite sequence of numbers () by treating them as the coefficients of a formal power series. This series is called the generating function of the sequence. Unlike an ordinary seri ...
s. First, we write
. The recurrence is then equivalent to the following generating function equation:
:
where
is a polynomial of degree at most
correcting the initial terms.
From this equation we can solve to get
:
In other words, not worrying about the exact coefficients,
can be expressed as a
rational function
In mathematics, a rational function is any function that can be defined by a rational fraction, which is an algebraic fraction such that both the numerator and the denominator are polynomials. The coefficients of the polynomials need not be rat ...
The closed form can then be derived via
partial fraction decomposition
In algebra, the partial fraction decomposition or partial fraction expansion of a rational fraction (that is, a fraction such that the numerator and the denominator are both polynomials) is an operation that consists of expressing the fraction as ...
. Specifically, if the generating function is written as
:
then the polynomial
determines the initial set of corrections
, the denominator
determines the exponential term
, and the degree
together with the numerator
determine the polynomial coefficient
.
Relation to solution to differential equations
The method for solving linear
differential equations
In mathematics, a differential equation is an equation that relates one or more unknown functions and their derivatives. In applications, the functions generally represent physical quantities, the derivatives represent their rates of change, an ...
is similar to the method above—the "intelligent guess" (
ansatz
In physics and mathematics, an ansatz (; , meaning: "initial placement of a tool at a work piece", plural Ansätze ; ) is an educated guess or an additional assumption made to help solve a problem, and which may later be verified to be part of the ...
) for linear differential equations with constant coefficients is
where
is a complex number that is determined by substituting the guess into the differential equation.
This is not a coincidence. Considering the
Taylor series
In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor serie ...
of the solution to a linear differential equation:
:
it can be seen that the coefficients of the series are given by the
-th derivative of
evaluated at the point
. The differential equation provides a linear difference equation relating these coefficients.
This equivalence can be used to quickly solve for the recurrence relationship for the coefficients in the power series solution of a linear differential equation.
The rule of thumb (for equations in which the polynomial multiplying the first term is non-zero at zero) is that:
: