{'fraction_non_alphanumeric': 0.040949100650593186, 'fraction_numerical': 0.018053544984109552, 'mean_word_length': 4.442854555334178, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Inversion Copulas from Nonlinear State Space Models

We propose to construct copulas from the inversion of nonlinear state space models. These allow for new time series models that have the same serial dependence structure of a state space model, but with an arbitrary marginal distribution, and flexible density forecasts. We examine the time series properties of the copulas, outline serial dependence measures, and estimate the models using likelihood-based methods. Copulas constructed from three example state space models are considered: a stochastic volatility model with an unobserved component, a Markov switching autoregression, and a Gaussian linear unobserved component model. We show that all three inversion copulas with flexible margins improve the fit and density forecasts of quarterly U.S. broad inflation and electricity inflation.


Introduction
Parametric copulas constructed through the inversion of a latent multivariate distribution (Nelsen 2006, sec. 3.1) are popular for the analysis of high-dimensional dependence. For example, Gaussian (Song 2000), t (Embrechts, McNeil & Straumann 2001) and skew t (Demarta & McNeil 2005;Smith, Gan & Kohn 2012) distributions have all been used to form such 'inversion copulas'. More recently, Oh & Patton (2015) suggest employing distributions formed through marginalization over a small number of latent factors. However, the copulas constructed from these distributions cannot capture accurately the serial dependence exhibited by many time series. As an alternative, we instead propose a broad new class of inversion copulas formed by inverting parametric nonlinear state space models. Even though the dimension of such a copula is high, it is parsimonious because its parameters are those of the underlying latent state space model. The copula also has the same serial dependence structure as the state space model. But when such copulas are combined with an arbitrary marginal distribution for the data, they allow for the construction of new time series models. These models allow for substantially more flexible density forecasts than the underlying state space models themselves, because the latter typically have rigid margins that are often inconsistent with that observed empirically.
When the latent state space model is non-stationary, the resulting copula model for the data is also, but with time invariant univariate margins. Alternatively, when the state space model is stationary, so is the resulting copula model, and we focus on this case here. When the state space model is Gaussian and linear, the resulting inversion copula is a Gaussian copula (Song 2000) with a closed form likelihood. However, in general, the likelihood function of a nonlinear state space model cannot be expressed in closed form. Similarly, neither can the density of the corresponding inversion copula. Nevertheless, we show how existing techniques for computing the likelihood of such state space models can also be used to compute the copula densities. We also provide an efficient spline approximation method for computing the marginal density and quantile function of the state space model. These are the most computationally demanding aspects of evaluating the copula density for time series data.
We outline in detail how Bayesian techniques can be used to compute posterior estimates of the copula model parameters. A Markov chain Monte Carlo (MCMC) sampler is used, where the existing methods for efficiently sampling the states of a state space model can be employed directly. We also study the time series properties of the copula models, show how to compute measures of serial dependence, as well as construct density forecasts. We show that the density forecasts from the copula model better reflect the nature of the empirical data distribution than the state space model counterpart in real world applications.
Copula models are used extensively to model cross-sectional dependence, including between multiple time series; see Patton (2012) for a review. However, their use to capture serial dependence is much more limited. Joe (1997, pp.243-280), Lambert & Vandenhende (2002), Frees & Wang (2006), Beare (2010), Smith, Min, Almeida & Czado (2010) and Loaiza-Maya, Smith & Maneesoonthorn (2017) use Archimedean, elliptical or decomposable vine copulas to capture serial dependence in univariate time series. While the likelihood is available in closed form for these copulas, they cannot capture as wide a range of serial dependence structures as the inversion copulas proposed here can. Moreover, the proposed inversion copulas are simple to specify, often more parsimonious, and can be easier to estimate than the copulas used previously.
Recently, copulas with time-varying parameters have proven popular for the analysis of multivariate time series data; for example, see Almeida & Czado (2012), Hafner & Manner (2012), De Lira Salvatierra &  and Creal & Tsay (2015). However, these authors use copulas to account for the (conditional) cross-sectional dependence as in Patton (2006). This is completely different to our objective of constructing a T -dimensional copula for serial dependence. Semi-and nonparametric copula functions (Kauermann, Schellhase & Ruppert 2013) can also be used to model serial dependence. However, such an approach is better suited to longitudinal data, where there are repeated observations of the time series.
To highlight the broad range of new copulas that can be formed using our approach, we consider three in detail. They are formed by inversion of three stationary latent state space models that are popular in forecasting macroeconomic time series. The first is a stochastic volatility model with an unobserved first order autoregressive mean component. The second is a Markov switching first order autoregression. The third is a Gaussian unobserved com-ponent model, where the unobserved component follows a pth order autoregression. When forming an inversion copula, all characteristics (including moments) of the marginal distribution of the state space model are lost, leaving the parameters potentially unidentified. For each of the three inversion copulas we study in detail, we solve this problem by imposing constraints on the parameter space. We show how to implement the MCMC sampling scheme, where the states are generated using existing methods, and the parameters are drawn efficiently from constrained distributions. In an empirical setting, we also show how to estimate the copula parameters using maximum likelihood.
To show that that using an inversion copula with a flexible margin can substantially improve forecast density accuracy, compared to employing the state space model directly, we use it to model and forecast quarterly U.S. broad inflation and U.S. electricity inflation. This is a long-standing problem on which there is a large literature (Faust & Wright 2013).
A wide range of univariate time series models have been used previously, including the three state space models examined here. However, all three have marginal distributions that are inconsistent with that observed empirically for inflation, which exhibits strong positive skew and heavy tails. Moreover, the predictive distributions from the state space models are either exactly or approximately symmetric-a feature that places excessively high probability on severe deflation. In comparison, the inversion copula models can employ the same serial dependence structure as the latent state space models, but also incorporate much more accurate asymmetric marginal distributions. We show that this not only improves the fit of the time series models, but that it increases the accuracy of the one-quarter-ahead density forecasts significantly.
The rest of the paper is organized as follows. In Section 2 we first define a time series copula model, and then outline the construction of an inversion copula from a nonlinear state space model. The special case of a Gaussian linear state space model is considered separately. We then discuss estimation, time series properties, measures of serial dependence and prediction. In Section 3 we discuss the three inversion copulas that we examine in detail, while in Section 4 we present the analyses of the U.S. broad inflation and U.S. electricity inflation; Section 5 concludes. In a supplementary appendix, we provide a simulation study that verifies the proposed methodology in a controlled setting (Section A), as well as supplementary figures for the U.S. electricity inflation application (Section B).

Time Series Copula Models
Consider a discrete-time stochastic process {Y t } T t=1 , with a time series of observed values y = (y 1 , . . . , y T ). Then a copula model decomposes its joint distribution function as which we assume to be time invariant. The function C is a T -dimensional copula function (Nelsen 2006, p.45), which captures all serial dependence in the data. All marginal features of the data are captured by G, which can be modeled separately, and either parametrically or non-parametrically. While Equation (2.1) applies equally to both continuous and discretevalued time series data, we focus here on the former, where the density Here, g(y) = d dy G(y) is the marginal density of each observation, and c(u) = d du C(u) is widely called the 'copula density'.
We refer to Equations (2.1) and (2.2) as a 'time series copula model'. The main challenge in constructing such a model is the selection of an appropriate copula function C. It has to be both of high dimension, and also account accurately for the potentially complex serial dependence structure in {Y t } T t=1 .

State Space Inversion Copula
A popular way to construct a high-dimensional copula C is by transformation from a latent continuous-valued stochastic process {Z t } T t=1 , with joint distribution function F Z . Let F Zt be the marginal distribution function of Z t . Then, by setting U t = F Zt (Z t ), the T observations of the stochastic process {U t } T t=1 have distribution function and density function The transformation ensures that each U t is marginally uniformly distributed on [0, 1], so that C meets the conditions of a copula function (Nelsen 2006, p.45).
This approach to copula construction is called inversion by Nelsen (2006, sec. 3.1), and we label such a copula an 'inversion copula'. Table 1 depicts the transformations between Y t , U t and Z t , along with their distribution functions and domains. Previous choices for F Z include elliptical (especially the Gaussian and t), skew t distributions and latent factor models (Oh & Patton 2015). The dependence properties of the resulting inversion copulas are inherited from those of F Z , although all location, scale and other marginal properties of F Zt are lost in the transformation. In this paper we propose to construct an inversion copula from a latent nonlinear state space model for {Z t } T t=1 . In doing so, we aim to construct new high-dimensional copulas that inherit the rich range of serial dependence structures that state space models allow.
The nonlinear state space model we consider is generically given by Here, H t is the distribution function of Z t , conditional on a r-dimensional state vector X t .
The states follow a Markov process, with conditional distribution function K t . Parametric distributions are almost always adopted for H t and K t , and we do so here with parameters we denote collectively as ψ. In the time series literature Equations (2.4) and (2.5) are called the measurement and transition distributions, although in the copula context Z t is not directly observed, but is also latent. Note that even though the state vector X t has Markov order one, Z t is Markov with an arbitrary order; see Durbin & Koopman (2012) for properties of this model.
A key requirement in evaluating the inversion copula density at Equation (2.3) is computing the marginal distribution and density functions of Z t . These are given by where the dependence on ψ is denoted explicitly here. The density h t (z t |x t ; ψ) = d dzt H t (z t |x t ; ψ), and f (x t |ψ) is the marginal density of the state variable X t which can be derived analytically from the transition distribution for most state space models used in practice. Evaluation of the integrals in Equation (2.6) is typically straightforward either analytically or numerically, as we show later for three different state space models. Note that z t is a function of ψ through the quantile function z t = F −1 Zt (u t |ψ), as we discuss later. A more challenging problem is the evaluation of the numerator in Equation (2.3). To compute this, the state vector x = (x 1 , . . . , x T ) needs to be integrated out, with There are many methods suggested for evaluating this high-dimensional integral; for example, see Shephard & Pitt (1997), Stroud, Müller & Polson (2003), Godsill, Doucet & West (2004), Jungbacker & Koopman (2007), Richard & Zhang (2007), Scharth & Kohn (2016) and references therein. In this paper we show how popular Markov chain Monte Carlo (MCMC) methods for solving this problem can also be used to estimate the inversion copula.
Because all features of the marginal distribution of Z t -including the marginal moments-are lost when forming the copula, parameters in a state space model that uniquely affect these are unidentified and can be excluded from ψ. Moreover, where possible we also impose constraints on the parameters so that F Zt has zero mean and unit variance. While this has no effect on the copula function C, it aids identification of the parameters in the likelihood.

Gaussian Linear State Space Inversion Copula
The stationary Gaussian linear state space model encompasses many popular time series models; see Ljung (1999, Sec. 4.3) and Durbin & Koopman (2012, Part 1) for overviews. In this special case, we show here that the inversion copula is the popular Gaussian copula. This state space model is given by R is a (r × r) matrix of autoregressive coefficients, with absolute values of all eigenvalues less than one. The matrices F and Q are of sizes (r × q) and (q × q), respectively, where q represents the dimension of random components driving the r-dimensional state. The copula parameters are ψ ⊆ {b, R, F, Q, σ 2 }, depending on the specific state space model adopted.
To identify the parameters in the likelihood, they are constrained so that E(Z t ) = 0 and Var(Z t ) = 1. For the latter, if Var(X t ) = Σ X , then Var(Z t ) = bΣ X b + σ 2 , where vec(Σ X ) = (I r 2 − R ⊗ R) −1 vec(F QF ). This results in the equality constraint σ 2 = 1 − bΣ X b , along with nonlinear inequality constraints on the other elements of ψ; something we illustrate further for a specific Gaussian state space model in Section 3.3.
With these constraints, the margins of Z t are standard normal. This greatly simplifies evaluation and estimation of the copula compared to the general case, where f Zt and F Zt in Equation (2.6) depend on ψ and need to be recomputed whenever ψ changes. Moreover, where a l = bΓ(l)b , and Γ(l) = Cov(X t , X t−l ) denotes the l th autocovariance matrix of the state vectors, which can be computed using the multivariate Yule-Walker equations (Lutkepohl 2006, pp.26-30).
Because this is a Gaussian copula, its density is known explicitly (Song 2000) as The copula parameters ψ can therefore be estimated using the full likelihood in Equation (2.2). However, Ω −1 ψ is usually computationally demanding to evaluate, so that c Ga (u; ψ) is also. Therefore, we instead employ Bayesian methods where the latent states are generated explicitly as part of a MCMC scheme, as we now discuss. This can be just as fast and efficient for the inversion copula, as it is for the underlying linear Gaussian state space model using the Kalman Filter.

Estimation
Assuming a parametric margin G(y t ; θ) with parameters θ, the likelihood of the time series copula model is where the reliance of the copula density on ψ is made explicit, and z t = F −1 Zt (G(y t ; θ)|ψ). Given parameters (ψ, θ), marginal G, and a method to compute f Zt , F Zt and F −1 Zt , evaluation of the likelihood boils down to evaluation of f Z (z|ψ). There are a range of methods for doing this, usually tailored to specific state space models. They include methods based on sequential importance sampling (Shephard & Pitt 1997;Jungbacker & Koopman 2007;Richard & Zhang 2007) from which maximum likelihood estimates (MLEs) can be computed.
For example, in Section 4.1.6, we compute the MLEs for three inversion copulas outlined in Section 3 for the U.S. broad inflation application.
However, it is popular to estimate nonlinear state space models using robust MCMC methods, and we focus on this approach here. Conditional on the states, the likelihood is . (2.9) Adopting independent priors π ψ (ψ) and π θ (θ), estimation and inference from the model can be based on the sampler below.
Sampling Scheme Step Step 3. Generate from f (θ|x, ψ, y) ∝ T t=1 h t (z t |x t ; ψ)g(y t ; θ)/f Zt (z t |ψ) π θ (θ). Note that the values z = (z 1 , . . . , z T ) are not generated directly in the sampling scheme, but instead are computed for each draw of the parameters ψ, θ. Crucially, Step 1 is exactly the same as that for the underlying state space model, so that the wide range of existing procedures for generating the latent states can be employed.
Step 2 can be undertaken using Metropolis-Hastings, with a proposal based on a numerical or other approximation to the conditional posterior. However, for some state space models it can be more computationally efficient to generate sub-vectors of ψ from their conditional posteriors, using separate steps.
In all our empirical applications in Section 4, we sample each element of ψ individually using normal approximations to the each of the conditional posteriors, obtained based on 15 Newton-Raphson steps. Initial values for the optimization are the parameter means obtained from the density q(ψ) ∝ f (x|ψ)π ψ (ψ). Note that the prior π ψ (ψ) reflects the parameter constraints required to identify the inversion copula, resulting in appropriately truncated normal approximations. To speed up the optimization, F Z 1 (and its inverse and derivative f Z 1 ) are not updated at each Newton-Raphson step. Nevertheless, we show that the resulting normal distributions are appropriate proposal densities later in our empirical work.
For non-parametric marginal models it is often attractive to follow Shih & Louis (1995) and others, and employ two-stage estimation, so that Step 3 is not required. However, for parametric models, θ can be generated at Step 3 using a Metropolis-Hastings step.
It is appealing to use the posterior from the marginal model as a proposal, with density q(θ) ∝ T t=1 g(y t ; θ)π θ (θ). However, this should be avoided because when there is strong dependence -precisely the circumstance where the copula model is most useful -this proposal can be a poor approximation to the conditional posterior.
The computations associated with Step 1 is equivalent to those of the conventional state space model on which the inversion copula is based. We outline later key aspects of the samplers that are used to estimate the three specific inversion copulas considered. However, note that at Steps 2 and 3 the value of z needs updating, although not at the end of Step 1.
Zt is the most computationally demanding aspect of the sampling scheme. In the Appendix we outline how to achieve this quickly and accurately for a stationary nonlinear state space model using spline interpolation.

Time Series Properties
Inversion copulas at Equation (2.3) can be constructed from either stationary or nonstationary state space models for {Z t } T t=1 . Here, stationarity refers to strong or strict stationarity, rather than weak or covariance stationarity; eg. see Brockwell & Davis (1991, p.12).
When a non-stationary state space model is used, the copula model at Equation ( An alternative representation of the copula density at Equation (2.3) can be derived as follows. For a < b, we employ the notation z a:b = (z a , z a+1 , . . . , z b ), with analogous definitions for x a:b and u a:b . Then, the (time invariant) r-dimensional marginal density of the latent process for r ≥ 2 is where t ≥ r and f (x t−r+1:t |ψ) is the r-dimensional marginal density of the states X t−r+1:t .
Then the r-dimensional marginal copula density can be defined as . and the density at Equation (2.3) can then be written in terms of {c (r) ; r = 2, . . . , p + 1} as where we define c (r) = 1 whenever r ≤ 1, and a product to be equal to unity whenever its upper limit is less than its lower limit. For example, for a Markov order p = 1 series, , so that the marginal copula c (2) fully captures the serial dependence structure. In Appendix B, we show how to construct c (2) for the copulas in Section 3.

Serial Dependence and Prediction
Measures of serial dependence at a given lag l ≥ 1, can be computed from the inversion copula. They include Kendall's tau, Spearman's rho, and measures of quantile dependence; see Nelsen (2006, Ch. 5) for an introduction to such measures of concordance. These can be computed from the bivariate copula of the observations of the series at times s and t = s + l as follows. If the density and distribution functions of (Z s , Z t ) are denoted as (2.11) then the bivariate copula function is . Kendall's tau, Spearman's rho and the lower quantile dependence for quantile 0 < α < 0.5, are then are computed similarly. We note that for l = 1, the marginal copula c (2) = c s+1,s .
For the copulas employed in Section 3, the integrals at Equation (2.11) and the dependence metrics can be computed numerically. However, this may be impractical for some state space models. In this case, following Oh & Patton (2013), the dependence measures are readily calculated via simulation. To do this, simply generate (z 1 , . . . , z l+1 ) from the state space model, and then transform each value to u t = F Z 1 (z t ). If the iterates (u l+1 ), j = 1, . . . , J, are generated in this way, then Spearman's rho for pairwise dependence between Y t+l and Y t is The same Monte Carlo iterates can be used to approximate the other measures of dependence.
While large Monte Carlo samples (e.g. J = 50, 000) can be required for these estimates to be accurate, simulating from the marginal copula is both fast and can be undertaken in parallel, so that it is not a problem in practice.
The forecast density for Y t+l conditional on Y 1:t = y 1:t , is . (2.12) Here, f (z t+l |z 1:t , ψ) is the predictive density for Z t+l conditional on Z 1:t = z 1:t , which can be computed either analytically or numerically for many state space models, including those in Section 3 below. Otherwise, the predictive density can be evaluated via simulation-a process which is both straightforward and fast. First, simulate a ray of values from the predictive distribution of the state space model (z t+1 , . . . , z t+l ) ∼ F (z t+1 , . . . , z t+l |z 1:t , ψ, θ). Then is an iterate from the predictive distribution. The predictive distribution can be evaluated conditional on either point estimates of (ψ, θ), or over the sample of parameter values from the posterior. The latter approach integrates out parameter uncertainty in the usual Bayesian fashion, and is undertaken in all our empirical work.

Three Inversion Copulas
We consider three time series inversion copulas in detail. The first two are constructed from two popular nonlinear state space models and cannot be expressed in closed form, while the last is constructed from a linear Gaussian state space model. In each case, we outline constraints required to identify the parameters when forming the copula by inversion, as well as how to implement the generic sampler in Section 2.3. We illustrate the effectiveness of the three copula models in Section 4.

Stochastic Volatility Inversion Copula
The conditional variance of many financial and economic time series exhibit strong positive serial dependence. A popular model used to capture this is the stochastic volatility model, although a major limitation is that its marginal distribution is symmetric, which is inconsistent with most series. Our approach allows for the construction of time series models that have the same serial dependence as a stochastic volatility model, but also an arbitrary margin that can be asymmetric.
We consider the stochastic volatility model with an unobserved autoregressive component (SVUC) given by . Setting this equal to unity provides an equality constraint . With these constraints, the dependence parameters of the resulting inversion copula are ψ = {ρ µ , ρ ζ , σ 2 µ , σ 2 ζ }. The marginal density at Equation (2.6) is where φ 1 (z; a, b 2 ) is a univariate Gaussian density with mean a and variance b 2 . The inner integral in µ can be computed analytically and (with a little algebra) the marginal density and distribution functions are with w(ζ) 2 = s 2 µ + exp(ζ). Computing the (log) copula density at Equation (2.3) requires evaluating log(f Z 1 ) and the quantile function F −1 Z 1 at all T observations. Appendix A outlines how to compute these numerically using spline interpolation of both functions. In our empirical work we find these spline-based approximations to be accurate within 5 to 9 decimals places, and fast because they require direct evaluation of F −1 Z 1 at only one point. We label the inversion copula constructed from the SVUC model as 'InvCop1'. Appendix B outlines how to compute the marginal copula density c (2) (u t , u t−1 |ψ) for this copula.
Because the time series has Markov order one, this bivariate copula characterizes the full serial dependence structure. For example, Figure 1 We employ the prior π ψ (ψ) ∝ 1 where R ψ is the region of feasible parameter values conforming to the restrictions listed above, and I(X) = 1 if X is true, and zero otherwise. We outline here how to implement the Step 1 of the sampling scheme in Section 2.3. We partition the state vector into µ = (µ 1 , . . . , µ T ) and ζ = (ζ 1 , . . . , ζ T ), and use the two separate steps: Step 1a. Generate from f (µ|ψ, ζ, θ, y) ∝ T t=1 φ 1 (z t ; µ t ; exp(ζ t )) f (µ|ψ) Step 1b. Generate from f (ζ|ψ, µ, θ, y) The posterior of µ in Step 1a can be recognized as normal with zero mean and a band 1 precision matrix, so that generation is both straightforward and fast. There are a number of efficient methods to generate ζ in Step 1b in the literature, and we employ the 'precision sampler' for the latent states outlined in Chan & Hsiao (2014). This is a fast sparse matrix implementation of the auxiliary mixture sampler (Kim, Shepherd & Chib 1998) that is known to mix well for the stochastic volatility model.

Markov Switching Inversion Copula
Another popular class of nonlinear state space models are regime switching models, which allow for structural changes in the dynamics of a series. In these models latent regime indicators usually follow an ergodic Markov chain, in which case the model is called a Markov switching model; see Hamilton (1994;Ch.22) for an introduction.
We consider a two regime Markov switching first order autoregressive model (MSAR1) given by for regimes s t ∈ {1, 2}. This is a nonlinear state space model with state vector x t = (z t−1 , s t ).
We assume the Markov chain is ergodic, so that the marginal distribution of s t is time , it can be shown that stationarity results from the constraints |ρ j | < 1 for j = 1, 2, and s 2 i s 2 j − ρ 2 j (s 2 i ) 2 > 0 for (i, j) = (1, 2), (2, 1). These provide inequality constraints on each element of {ρ 1 , ρ 2 , σ 2 1 , σ 2 2 }, given values for the other elements. Following standard practice we identify the two components by assuming π 1 < π 2 .
When forming the copula, we assume the marginal mean This provides the additional equality constraints Also, because σ 2 1 > 0, from the last equality constraint above it follows that π 2 s 2 2 < 1, which can be satisfied by imposing an upper bound on p 22 . The inversion copula parameters are therefore ψ = {c 2 , ρ 1 , ρ 2 , σ 2 2 , p 11 , p 22 }, subject to the inequality constraints above.
The marginal distribution of Z t is a mixture of two Gaussians, with are therefore fast to compute, and the quantile function F −1 Z 1 is computed using the spline interpolation method outlined in Appendix A. The marginal copula c (2) is given in Appendix B, and is the inversion copula of a mixture of four bivariate Gaussians. This is very different than the more common 'mixture copula', which is a finite mixture of copulas; for example, see Patton (2006).
We label the inversion copula constructed from the MSAR1 model as 'InvCop2'. Unlike the other two inversion copulas examined, it can exhibit asymmetric first order serial dependence. To illustrate, Figure 1 As before, we employ the MCMC algorithm in Section 2.3 to estimate the model. The prior π ψ (ψ) ∝ 1 σ 2 2 I(ψ ∈ R ψ ), where R ψ is the region of feasible parameter values outlined above. A forward filtering and backward sampling algorithm (Hamilton 1994, p.694) is used to sample the regime indicators s = (s 1 , ..., s T ) in Step 1.

Gaussian Unobserved Component Inversion Copula
We also construct an inversion copula from a Gaussian unobserved component model, where the component follows a stationary order p autoregression, so that This model (labeled here as UCARp) can be written in state space form at Equation (2.7) with state vector x t = (µ t , µ t−1 , . . . , µ t−p+1 ) and appropriate choices for matrices b, R, F and Q. The resulting inversion copula is a Gaussian copula with the specific time series dependence structure, and is labeled 'InvCop3'.
We follow Barndorff-Neilsen & Schou (1973) and others, and re-parametrize the autoregressive coefficients by the partial correlations π = (π 1 , π 2 , . . . , π p ) via the Durbin-Levinson algorithm. An advantage is that stationarity is easily imposed by the inequalities |π j | < 1 for j = 1, . . . , p. When forming the copula, the marginal mean E(Z t ) =μ = 0. A second equal- variance is unity. The parameters of this copula are therefore ψ = {π, σ 2 µ }, and the prior is As in Section 3.1, we use the precision sampler to sample the latent states (µ 1 , . . . , µ T ) at Step 1. In Step 2 of the scheme, the partial correlations π are sampled jointly using Metropolis-Hasting with a multivariate normal approximation proposal computed as described in Section 2.3, and truncated to the unit cube. The parameter σ 2 µ is also generated using a truncated normal approximation as a proposal. We show these are adequate proposals in our empirical work.

Empirical Analysis
The three inversion copulas in Section 3 are used to model quarterly U.S. broad inflation and U.S. electricity inflation. Here we illustrate that the inversion copulas produce more accurate forecast densities than the three state space models themselves. In the Supplementary Appendix (Part A) we include a simulation study that shows that even the simplest of our proposed inversion copulas with a flexible margin can greatly increase forecast accuracy.

Modeling and Forecasting U.S. Broad Inflation
We employ our methodology to model and forecast U.S. inflation from 1954:Q1 to 2013:Q4.
Inflation is measured by the difference y t = log(P t ) − log(P t−1 ) in the logarithm of the (seasonally adjusted) quarterly GDP price deflator P t , sourced from the FRED database of the Federal Reserve Bank of Saint Louis. Figure 2 a Shapiro & Wilk (1965) test for normality is rejected at any meaningful significance level. A wide range of time series models have been fitted to quarterly inflation data previously (Faust & Wright 2013;Clark & Ravazzolo 2015), including the three state space models considered here. However, these three models-in fact, most time series models used previously-have margins that are inconsistent with that observed empirically. We show that combining each of the three inversion copulas with more flexible margins solves this problem, and significantly improves the accuracy of the one-quarter-ahead predictive densities.

SVUC and InvCop1
Stock & Watson (2007) suggest using an unobserved component model with stochastic volatility for U.S. inflation, and it has become a popular model for this series (Clark & Ravazzolo 2015;Chan 2015). We fit the SVUC model directly to the inflation data using Bayesian methods. Table 2 reports the parameter estimates, labeled as model 'S1'. (Note that this table also reports the parameter estimates for all five other models fit to this data.) The marginal density for inflation implied by the SVUC model is shown in Figure 3(a) in red. It is necessarily symmetric and inconsistent with that observed empirically.
We therefore employ a copula time series model (labeled 'C1') with copula function InvCop1 and a nonparametric margin, for which we employ the kernel density estimator (KDE), with the locally adaptive bandwidth method of Shimazaki & Shinomoto (2010).
This copula model allows for the same serial dependence structure as the SVUC model, but with a more accurate margin. The estimated margin is a smooth asymmetric and heavytailed distribution, and is also plotted in Figure 3(a). Using this for g, the copula data u t = G(y t ) are computed and plotted in Figure 2(b). This time series retains the serial dependence apparent in the original data.
The copula parameters are estimated using the MCMC scheme, where the proposals in Step 2 of the sampler have acceptance rates between 35% and 41%. There is strong positive correlation in both the level (ρ µ = 0.959) and the log-volatilities (ρ ζ = 0.789) of Z t , similar to that for the SVUC model fit directly to the inflation data. Figure 4(a) plots the marginal copula density c (2) (u t , u t−1 |ψ) at the parameter estimates.
There are spikes in the density close to (0,0) and (1,1), so that the vertical axis is truncated at 7 to aid interpretation. The logarithm of the density is also plotted in panel (d). The majority of mass is along the axis between (0,0) to (1,1), which is due to level dependence captured by the unobserved component. However, the conditional heteroskedasticity also affects the form of the copula, with mass around points (0,1) and (1,0) and four edges apparent in panel (d). There is high (symmetric) quantile dependenceλ ++ 1 (0.05) =λ −− 1 (0.05) = 0.507, consistent with the shape of c (2) .

MSAR1 & InvCop2
Amisano & Fagan (2013) employ the MSAR1 model for U.S. inflation, but only allow c 1 and c 2 to vary between regimes. We extend this study here by fitting the more general MSAR1 model (labeled 'S2') directly to the inflation data using Bayesian methods. The implied marginal density is shown in Figure 3(b) in red, and it is more consistent with the data than the margin of the SVUC model.
A time series copula model, with margin G given by the KDE and copula function In-vCop2, is also fit and labeled as model 'C2'. The copula parameters are estimated using the MCMC scheme, and the proposals in Step 2 of the sampler have acceptance rates between 13% and 38%. Parameter estimates for both models S2 and C2 show positive serial dependence and high values for p 11 and p 22 . However, the characteristics of the regimes differ between the two models, and it is shown later that the two models also have very different predictive distributions Table 3 reports the first order serial dependence metrics of copula InvCop2. Similar to the other copulas, there is high overall dependence withr 1 = 0.752, although dependence is highly asymmetric withλ ++ 1 (0.05) = 0.644 >λ −− 1 (0.05) = 0.272. This asymmetry is visible in c (2) and log(c (2) ), which are plotted in Figure 4(b,e). In contrast, the copulas InvCop1 and InvCop3 do not allow for such asymmetric quantile dependence.

UCAR4 and InvCop3
As a benchmark, the UCAR model with p = 4 is also fitted, and labeled as model 'S3'. The margin implied by this model is Gaussian, and plotted in Figure 3(c) in red. The estimates of the partial correlations π suggest that the unobserved component is Markov order one, which is consistent with the GDP data being seasonally-adjusted. To compare, we also fit a time series copula model (labeled 'C3') with copula function InvCop3 and p = 4. To illustrate estimation of a parametric margin, G is a skew t distribution (Azzalini & Capitanio 2003).

Density Forecast Comparison
One-quarter-ahead predictive densities are computed for quarters t = 2, . . . , T for all six fitted models. Point forecast accuracy is measured using the root mean squared error (RMSE).
Density forecast accuracy is measured using the (negative) logarithm of the predictive score  Table 4, where lower values for all metrics indicate increased accuracy. The density forecasts from the copula models C1, C2 and C3 are all more accurate than those from the corresponding state space models S1, S2 and S3, as measured by mean LP, CRPS and TW-CRPS. However, adopting a copula model results in less of an improvement in RMSE.
To show how the predictive distributions differ, Figure 5(b,d,f) plots their standard deviation for models C1-C3 in blue, and for models S1-S3 in red; the differences are striking.
This is particularly the case for model C3 in panel (f), where the combination of an asymmetric margin with InvCop3 produces heteroskedasticity in the predictive distributions, even though the latent state space model is homoskedastic. A similar feature was observed by Smith & Vahey (2016) when they fit a Gaussian copula. The tails of the predictive distributions also differ. For example, Figure 6 plots the predictive probability of deflation for all models. Broad-based deflation is very rare, with only very mild deflation occurring twice in our data. Yet, the state space models can over-estimate this probability. This is because the inaccuracy of the left hand tails of the margins of models S1-S3 apparent in Figure 3 also extends to the predictive distributions. Figure 7 plots the predictive distributions from models S1 and C1 for four different quarters. It shows that the predictive distributions from the copula model do not simply replicate the asymmetry (or other features) of the marginal distribution. Overall, the best performing model is C1, and its inclusion in a real time forecasting study -such as those by Clark & Ravazzolo (2015) and Smith & Vahey (2016) -is merited.

Computation Times
The MCMC estimation algorithms were implemented in MATLAB using a standard workstation, and computation times varied across the three copula models. The time to complete 1000 sweeps was 667s, 44s and 94s for models C1, C2 and C3, respectively. The greater computing time for model C1 is because F Z 1 requires evaluation of a univariate numerical integral, as noted in Section 3.1. In addition, model C3 also involves generation of the parameters of the skew t margin. Our empirical results are based on Monte Carlo samples of size 20,000, 25,000 and 30,000 iterates for models C1, C2 and C3, respectively, with a further 5,000, 15,000 and 20,000 iterates discarded for convergence. While we generated more iterates for the faster schemes, we found that varying these did not affect the results meaningfully.

Maximum Likelihood Estimates
We report maximum likelihood estimates of the copula parameters for the U.S. broad inflation example in Table 5 to show that it is possible to estimate the inversion copulas via MLE. All parameter estimates are obtained using two-stage estimation (Joe 2005), where the margin G is first estimated and the copula data u t = G(y t ) computed for t = 1, . . . , T .
Conditional upon this copula data, ψ is estimated by maximizing the copula density in Equation (2.3). The denominator of this density, as well as the values of z, are computed from f Z 1 , F Z 1 and F −1 Z 1 in the same manner as outlined in the paper. The numerator f Z of the copula density can be evaluated for each of our three inversion copulas by filtering algorithms. For InvCop1, the likelihood of the latent SVUC model is computed by the bootstrap particle filter (Gordon et al. 1993), in combination with the Kalman filter. For InvCop2, the likelihood of the latent MSAR1 model is evaluated in closed form using the Hamilton filter for discrete states (see Hamilton 1989). For InvCop3, the likelihood of the latent state space model is Gaussian with moments that can be computed using the Kalman filter. In all cases, ψ is constrained as discussed in Section 3, and maximization employs constrained optimization as implemented in the Matlab toolbox. The maximum likelihood estimates reported in Table 5 are in line with the posteriors in Table 2.

Modeling and Forecasting U.S. Electricity Inflation
To confirm that our methodology applies to other data, we consider inflation in U.S. electricity prices between 1952:Q1 and 2015:Q4 as a second empirical example. The data are differences in the logarithm of the (seasonally-adjusted) quarterly electricity consumer price index of all urban consumers. This series is produced by the U.S. Bureau of Labor Statistics, and available from the FRED database. The time series plots of the T = 256 observations of the data and the associated copula data are given in Figure 1 of the Supplementary Appendix. The marginal distribution of the data is highly non-Gaussian, and we fit the same six models to this item-specific inflation data, as we do the broad inflation measure in Section 4.1. Even though the data differ, the three state space models S1, S2 and S3 remain attractive time series models for item-specific inflation. Figure 8 plots the histogram of the data in every panel. As with the broader inflation measure, electricity inflation is positively skewed. It also exhibits an excentuated peak around 0%. The marginal distributions of the fitted state space models S1, S2 and S3 are plotted in red in panels (a,b,c), respectively. The symmetric margins of S1 (the SVUC model) and S3 (the UCAR4 model) are highly inconsistent with the data. Also plotted in blue in panels (a,b) is the adaptive KDE estimate -which is far from symmetric -as is the margin of both copula models C1 and C2. Panel (c) plots the posterior estimate of the skew t distribution, which is the margin of copula model C3. It is positively skewed and heavy-tailed. In each case, the margins of the copula models are more accurate than those implied by the respective state space models.
The copula densities from all three models are similar to those in the broad inflation case, with the bivariate marginal copulas c (2) (u t , u t−1 ) showing strong positive dependence (see Figure 2 of the Supplementary Appendix). This is unsurprising because electricity consumption is a major component of economic output. As in Section 4.1, we compute the one-quarter-ahead predictive distributions for all six models at times t = 2, . . . , T . Table 6 reports the accuracy metrics, and in each case the copula time series models out-perform their equivalent state space models using every metric. One-sided t-tests of the CRPS and log-score suggest that these differences are statistically significant. As with the analysis of broad inflation, the flexible modelling of the highly asymmetric margin increases the quality of the fitted time series model and the accuracy of these predictive densities. Illustration of the stark differences between the one-quarter-ahead predictive densities from the state space models, and their equivalent copula models, is given in Figure 3 of the Supplementary Appendix.

Discussion
This paper proposes a new class of copulas for capturing serial dependence. They are constructed from inversion of a general nonlinear state space model, so that the potential range of dependence structures that they can produce is incredibly broad. A major insight is that such copulas can be very different than those that are widely used for capturing cross-sectional dependence. The latter include elliptical and vine copulas, which have also been used previously to capture serial dependence; see Joe (1997), Beare (2010), Smith et al. (2010) and Loaiza-Maya et al. (2017) for examples. Yet, the three inversion copulas studied in detail highlight the wider serial dependence structures that can be captured by our approach.
As with the likelihood of the underlying state space model, in general the density of the inversion copula cannot be expressed in closed form. However, an important insight is that existing methods for evaluating the likelihood of the latent state space model can also be employed in the copula context. While we employ MCMC samplers to evaluate the posterior, other existing methods can also be used to compute the numerator of the copula density, as we do in Section 4.1.6. Either way, a major computational challenge is the repeated evaluation of the quantile F −1 Zt and density f Zt functions at the T observations. When the latent state space model is stationary, we show how this can be achieved using spline approximations to F −1 Z 1 and log(f Z 1 ) outlined in Appendix A. These approximations are highly accurate in our examples, fast to derive, and can be employed with even very large values of T in practice.
Recently, Oh & Patton (2015) construct an inversion copula from a flexible parametric distribution formed through marginalization over a low-dimensional vector of latent factors. This latent factor model can be written in state space form, where the factors are a static state vector X t that does not vary with t at Equation (2.5). Full likelihood-based estimation can then be undertaken using the Bayesian MCMC methods discussed here, providing a better alternative to the moment-based method suggested by Oh & Patton (2015). While these factor copulas are unsuitable for serial dependence, Oh & Patton (2015) show they can capture high-dimensional cross-sectional dependence well.
An interesting result is that the inversion copula of a Gaussian linear state space model is a Gaussian copula. Therefore, in this special case, the likelihood is available in closed form.
Nevertheless, estimation using simulation methods can still prove efficient, just as it is for the latent state space model itself. While all three of our example inversion copulas are Markov and stationary, copulas can also be derived from non-stationary latent state space models.
The resulting time series copula model is also non-stationary, but with a time invariant margin. Such copula models are an interesting topic for further study, although a new approach to computing F −1 Zt and f Zt efficiently is needed. A second interesting extension is to employ the proposed time series inversion copulas to capture serial dependence in discrete data. Here, the copula remains unchanged, but G would be a discrete distribution function.
The model can be estimated using Bayesian data augmentation, as discussed in Pitt, Chan & Kohn (2006) and Smith, Gan & Kohn (2012). This would require z to be generated as an additional step in the sampling scheme in Section 2.3.
A third highly useful extension is to construct the inversion copula of a multivariate state space model. If the dimension of the multivariate time series is m, then the resulting T mdimensional copula captures both cross-sectional and serial dependence jointly. This would provide an alternative to the vine copula models of Smith (2015), Beare & Seo (2015) and Loaiza-Maya et al. (2017) for this case. While the extension is straightforward in principle, implementation relies on the ability to evaluate the univariate marginal distribution functions (and their inverses) for each series of the latent state space model.
To show our methodology can improve the quality of forecast densities, we use it to model and forecast quarterly U.S. broad inflation and U.S. electricity inflation, which is an important problem in empirical macroeconomics (Faust & Wright 2013). We employ inversion copulas constructed from three state space models used previously for this series. When combined with highly asymmetric and heavy-tailed nonparametric or flexible marginal distributions, the predictive distributions from the resulting copula time series models are more accurate than those of the state space models themselves. This is because these state space models have rigid margins, which are very far from that observed for inflation empiricallya problem resolved by the copula models.

Part A: Fast Evaluation of the Marginal Density and Quantile Function
This part of the appendix outlines how to efficiently evaluate the quantile function F −1 Z 1 and the logarithm of the marginal density log(f Z 1 (z)) for a stationary nonlinear state space model. For both, we use spline interpolations based on their values at N absciassae, where we set N = 100 in practise. The advantage of such spline-based approximations is that they are highly accurate (between 5 and 9 decimal places in our empirical work), yet are fast to compute at the T observations once the interpolation is complete-even for large values of T .
We use a uniform grid for the N quantile function values {q 1 , . . . , q N }, which have correpsonding probability values {p 1 , . . . , p N }. We set p 1 = 0.0001 and p N = 0.9999, so that the function is approximated far into the tails of the distribution. The following steps obtain the points at which the interpolations are made.
Notice that numerical inversion of F Z 1 is undertaken above only twice in Step 1. Moreover, F Z 1 and f Z 1 are evaluated only N times in step 3, something that can also be undertaken parallel.
Once the coefficients of the splines are obtained, the log-density and quantile function can be evaluated quickly at even very large number of points {z 1 , . . . , z n }. If F Z 1 is also symmetric (as in Section 3.1), then F −1 and F Z 1 (−z) = 1 − F Z 1 (z) for z ≥ 0. These identities can be exploited to reduce the number of computations at Steps 1 and 3 by one half, further speeding the algorithm.
To illustrate the effectiveness of the method, we consider the approximations to F −1 Z 1 and log(f Z 1 ) for InvCop1 when ψ equals the posterior mean in the inflation study in Section 4.1.1. Plots of the approximations (see Figure 4 of the supplementary material) are visually indistinguishable from the true functions, which can be evaluated (slowly) using numerical methods. The integrated absolute difference between the approximate and true functions are 1.282 × 10 −6 and 2.253 × 10 −10 for the quantile and log-density, respectively, so that the approximations are very accurate. Computation of both approximations, and their evaluation at the T = 240 observations, takes only 0.29s using MATLAB on a standard four core desktop.

Part B: Bivariate Marginal Copulas
This part of the appendix shows how to evaluate the bivariate marginal copula density for InvCop1 and InvCop2. In both cases, the univariate marginal density f 1 (z|ψ) can be computed readily as in Part A above. Computation of f Z is outlined separately for each case below.

For InvCop1
For the SVUC model with the parameter constraints, the bivariate density where z = (z 1 , z 2 ), µ = (µ 1 , µ 2 ), ζ = (ζ 1 , ζ 2 ), and φ 2 (x; a, Ω) is a bivariate normal density with mean a and variance Ω evaluated at point x. The inner two integrals in µ of this 4-dimensional integral can be computed analytically by recognising a bivariate normal. Then, by recognising a second bivariate normal in z, the density can be written as: where W (ζ) = (S µ + V (ζ)). This bivariate integral can be computed numerically.

For InvCop2
For the MSAR1 model with the parameter constraints, the bivariate density is the mixture of four bivariate Gaussians where µ ij = (µ i , µ j ) and    Table 2: Posterior parameter estimates for the six models fit to the U.S. broad inflation data. The top half of the table reports estimates for the three inversion copulas constructed from latent state space models. The bottom half reports estimates for the same state space models fit directly to the data. The posterior mean of each parameter is reported, along with 90% posterior probability intervals below. For InvCop3, the parameters of the jointly estimated skew t margin are also reported. The identification constraintμ = 0 occurs in both InvCop1 and InvCop3.   Table 4: Summary of the accuracy of the one-step-ahead predictive distributions for the six models fit to the U.S. broad inflation data. The metrics are the mean (negative) logarithm predictive score (LP), the mean cumulative rank probability score (CRPS), the mean tailweighted CRPS (TW-CRPS), and the root mean squared error (RMSE). Lower values of all metrics indicate improved accuracy. The first three models employ inversion copulas constructed from latent state space models, along with an asymmetric margin. The bottom three are the same state space models fit directly to the data. When the result for a copula model is statistically significantly better than the corresponding state space model, it is indicated with ' ' at 10% significance level or ' ' at 5% significance level.   Table 6: Summary of the accuracy of the one-step-ahead predictive distributions for the six models fit to the U.S. electricity inflation data. The metrics are the mean (negative) logarithm predictive score (LP), the mean cumulative rank probability score (CRPS), and the root mean squared error (RMSE). Lower values for all metrics indicate improved accuracy. The first three models employ inversion copulas constructed from latent state space models, along with an asymmetric margin. The bottom three are the same state space models fit directly to the data. When the result for a copula model is statistically significantly better than the corresponding state space model, it is indicated with ' ' at 10% significance level, ' ' at 5% significance level or ' ' at 1% significance level.   |ψ) for each of the three inversion copula models fitted to the U.S. broad inflation data.
Panels (a,b,c) plot the densities with a common vertical axis truncated at 7 for interpretation. Panels (d,e,f) plot the logarithm of the same three densities. Each density has been computed at the posterior meanψ of the copula parameters.  Figure 5: Moments of the one-step-ahead predicitve distributions of the U.S. broad inflation data. Panels (a,c,e) plot in blue the predictive means from each of the three copula models C1, C2 and C3, respectively (See Table 4 for their specification). Also plotted is a scatterplot of the data. Panels (b,d,f) plot the standard deviations of the predictive distributions from the three copula models in blue. The standard deviations of the predictive distributions from the three corresponding state space models, fit directly to the same data, are plotted in red.  Figure 6: The one-step-ahead predictive probability of deflation from each of the six models fit to the U.S. broad inflation data. The probabilities arising from the copula models are in blue, and the state space models fit directly to the data in red. Panel (a) plots these for models C1 and S1; panel (b) for models C2 and S2; and panel (c) for models C3 and S3. Circles denote the two quarters where (very mild) deflation is recorded in our data (-0.167% during 2009:Q1, and -0.022% during 2009:Q2).

A: Simulation Study
We simulate data from two time series models. The first (Sim1) is the UCAR1 model outlined in Equation (3.4), but with Z t replaced by Y t . The second (Sim2) is a copula model with a Gamma(2,2) marginal distribution G, and copula function InvCop3 constructed from the same latent UCAR1 model. The parameter values areμ = 0, ρ 1 = 0.7, σ 2 µ = 0.25, and σ 2 = 0.5, which satisfy the constraints in Section 3.3 Both Sim1 and Sim2 exhibit the same simple first order serial dependence structure, but Sim2 has a highly positively skewed margin with skew coefficient 1.41.
One hundred time series datasets, each of length T = 1000, are generated from the data generating processes Sim1 and Sim2. To each dataset we fit two models. The first is the UCAR1 state space model fit directly the data using Bayesian methods, and labeled 'M1'.
The second is a copula model with copula function InvCop3 (with p = 1) and a nonparametric margin, and labeled 'M2'. In the copula literature it is popular to use the empirical distribution function as a nonparametric estimator of G (Shih & Louis 1995;Tsukahara 2005).
However, this can give inaccurate estimates of the tails of G, as illustrated by Smith & Vahey (2015) for macroeconomic series. Therefore, a kernel density estimator (KDE) is fit using the locally adaptive bandwidth method of Shimazaki & Shinomoto (2010). The copula parameters are estimated using the Bayesian method outlined in Section 3.3.
There are four combinations of data generating process and fitted model: Sim1/M1, Sim1/M2, Sim2/M1 and Sim2/M2. For each of these we construct one-step-ahead predictive distributions. For the UCAR1 model (ie. M1) these are Gaussian distributions with moments computed using the Kalman Filter, while for the copula model (ie. M2) they are non-Gaussian as outlined in Section 2.5. Predictive distributions are computed for time points t = 2, . . . , 1000 and for each of the 100 simulated datasets. Point forecast accuracy is measured using the root mean squared error (RMSE). Density forecast accuracy is measured using the (negative) logarithm of the predictive score (LP), the cumulative rank probability score (CRPS) and the tail-weighted CRPS (TW-CRPS). The latter two measures are discussed in Gneiting & Raftery (2007) and Gneiting & Ranjan (2011), and computed directly from the quantile score.
For each of the four cases,  Table 1: Summary of the accuracy of the one-step-ahead predictive distributions in the simulation study. The rows report results for the four combinations of simulation (Sim1 and Sim2) and fitted model (M1 and M2). The columns report results for the four metrics considered, which are the mean (negative) logarithm predictive score (LP), the mean cumulative rank probability score (CRPS), the mean tail-weighted CRPS (TW-CRPS), and the root mean squared error (RMSE). The means are computed over the 999 time points and 100 simulated datasets. Note that tests at the 1% level indicate the values in the bottom row are all statistically significantly different than those in the row immediately above.  |ψ) for each of the three inversion copula models fitted to the quarterly U.S. electricity inflation data. Panels (a,b,c) plot the densities with a common vertical axis truncated at 7 for interpretation. Panels (d,e,f) plot the logarithm of the same three densities. Each density has been computed at the posterior meanψ of the copula parameters.  Figure 3: Moments of the one-step-ahead predictive distributions. Panels (a,c,e) plot in blue the predictive means from each of the three copula models C1, C2 and C3, respectively. Also plotted is a scatterplot of the data. Panels (b,d,f) plot the standard deviations of the predictive distributions from the three copula models in blue. The standard deviations of the predictive distributions from the three corresponding state space models, fit directly to the same data, are plotted in red.
6 C: Accuracy of Spline Interpolation

PDF Accuracy
Figure 4: Summary of the accuracy of spline approximations to the margin of Z 1 computed at the posterior mean ψ =ψ for InvCop1. Panels (a), (b) and (c) plot the approximations of F −1 Z 1 , log f Z 1 and F Z 1 , respectively. Also plotted are the true functions computed using slower but more accurate numerical methods in MATLAB. The approximate and true functions are so similar that they are visually indistinguishable. Panels (d), (e) and (f) plot the absolute difference between the true functions and their spline approximations, which are very small. The integrated absolute difference (computed on a grid of 500 points over the domain of each function) between the two functions in panel (a) is 1.282e-06, while for the two functions in panel (b) it is 2.925e-10.