Time Varying Parameter VAR in R
Time Varying Parameter VAR in R
To cite this article: Laura F. Bringmann, Emilio Ferrer, Ellen L. Hamaker, Denny Borsboom
& Francis Tuerlinckx (2018): Modeling Nonstationary Emotion Dynamics in Dyads using
a Time-Varying Vector-Autoregressive Model, Multivariate Behavioral Research, DOI:
10.1080/00273171.2018.1439722
Article views: 85
ABSTRACT
KEYWORDS
Emotion dynamics are likely to arise in an interpersonal context. Standard methods to study Dynamic modeling; dyadic
emotions in interpersonal interaction are limited because stationarity is assumed. This means that interactions; vector
the dynamics, for example, time-lagged relations, are invariant across time periods. However, this autoregressive model;
is generally an unrealistic assumption. Whether caused by an external (e.g., divorce) or an internal generalized addtive model;
(e.g., rumination) event, emotion dynamics are prone to change. The semi-parametric time-varying time series analysis;
vector-autoregressive (TV-VAR) model is based on well-studied generalized additive models, imple- non-stationarity
mented in the software R. The TV-VAR can explicitly model changes in temporal dependency without
pre-existing knowledge about the nature of change. A simulation study is presented, showing that
the TV-VAR model is superior to the standard time-invariant VAR model when the dynamics change
over time. The TV-VAR model is applied to empirical data on daily feelings of positive affect (PA) from
a single couple. Our analyses indicate reliable changes in the male’s emotion dynamics over time, but
not in the female’s—which were not predicted by her own affect or that of her partner. This application
illustrates the usefulness of using a TV-VAR model to detect changes in the dynamics in a system.
1. Introduction
as well as their time-related dependencies (Ferrer &
Emotions are not stable entities, but states that fluctuate Nesselroade, 2003; Ferrer, 2006; Ferrer, Widaman, Card,
over time. These patterns of fluctuations are often studied Selig, & Little, 2008; Ferrer & Zhang, 2009). Another
within a single individual (Boker & Nesselroade, 2002; method that can take into account temporal depen-
Kuppens, Stouten, & Mesquita, 2009; Kuppens et al., dencies between the emotions of two individuals is
2012; Lebo & Nesselroade, 1978), even though emotions multilevel vector-autoregressive modeling and the related
are likely to arise in an interpersonal context, such as a random intercepts cross-lagged panel models (Bring-
romantic relationship (Keltner & Haidt, 1999; Larson & mann et al., 2013; Bringmann, Lemmens, Huibers,
Almeida, 1999; Parkinson, 1996). As individuals inter- Borsboom, & Tuerlinckx, 2015; Hamaker, Kuiper, &
act with each other, there is likely to be a transfer of Grasman, 2015; Koval, Butler, Hollenstein, Lanteigne,
emotions—as well as behavior and cognition—back and & Kuppens, 2015; Randall & Butler, 2013). In addi-
forth between the two people. Emotion dynamics can tion, such models can also be studied in the frequency
thus be conceptualized as temporal interpersonal emo- domain, instead of the standard time domain (Liu &
tion systems, in which the emotions of one individual in, Molenaar, 2016; Sadler, Ethier, Gunn, Duong, & Woody,
say, a couple, depend upon his or her own emotions and 2009). Whereas these methods can model the emo-
the emotions of the partner (Butler, 2011). tion dynamics in discrete time, differential equations
Several methods have been used to study emotions in techniques allow one to model such dynamics in con-
interpersonal, or more specifically, dyadic interactions. tinuous time (e.g., Boker & Laurenceau, 2006; Felmlee &
One such method is dynamic factor analysis. Dynamic Greenberg, 1999; Gottman, 2003; Steele & Ferrer, 2011).
factor analysis combines factor analysis with multivariate A drawback of the above models is that they assume
time series in order to account for the structure of the data stationarity. This means that both the mean of an
CONTACT Laura F. Bringmann [email protected] Faculty of Behavioural and Social Sciences, Department of Psychometrics and Statistics, University
of Groningen, Grote Kruisstraat /, TS, Groningen, The Netherlands.
Color versions of one or more of the figures in this article can be found online at www.tandfonline.com/hmbr.
© Laura F. Bringmann, Emilio Ferrer, Ellen L. Hamaker, Denny Borsboom, and Francis Tuerlinckx. Published with license by Taylor & Francis.
This is an Open Access article distributed under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives License (http://creativecommons.org/licenses/by-nc-
nd/./), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original work is properly cited, and is not altered, transformed, or built upon
in any way.
2 L. F. BRINGMANN ET AL.
emotion process and the temporal dynamics are assumed Chow, 2010). Such exploratory tools do not require as
not to change over time (Chatfield, 2003; Hamilton, many assumptions as standard methods, and therefore
1994). However, based on theories of emotions and are useful as a first step to discover and summarize
empirical research on emotion dynamics, stationarity patterns in the data (Ferrer, 2016).
is a rather strong assumption (Boker et al., 2011; Felm- In this paper, we present an extension of the vector-
lee & Greenberg, 1999). Consider, for example, a life autoregressive model that uses time-varying parameters:
changing event such as going through a divorce. It is only the semi-parametric time-varying vector-autoregressive
natural that the emotional interaction between the two (TV-VAR) model. Because of its regression framework
individuals is different at the beginning of a marriage and well-functioning default settings, the TV-VAR model
than prior to, during, and after the divorce (Gottman, is very easy to use. Our proposed approach can model
1979; Gottman & Levenson, 1986; Gottman, Swanson, changes in the temporal dependency of emotions within
& Swanson, 2002). There is empirical evidence showing a dyad without pre-existing knowledge about the nature
how the emotional exchange between individuals in a of such changes. It further assumes that the change in
couple changes toward negative interactions or toward emotion dynamics is smooth instead of abrupt. The
hardly any interaction at all before a divorce (Gottman TV-VAR model proposed here is based on well-studied
& Levenson, 1992; Gottman, Coan, Carrere, & Swanson, generalized additive models (GAMs; Hastie & Tibshirani
1998). Such changes in the emotional interaction need (1990), and is easily applicable, as it is implemented in
not happen over years or months, but can also take place the freely available software R.
within short periods of time (Hsieh, Ferrer, Chen, & The TV-VAR model has its origins in econometrics
Chow, 2010; Madhyastha, Hamaker, & Gottman, 2011). (Dahlhaus, 1997; Giraitis, Kapetanios, & Yates, 2014).
Furthermore, empirical studies regarding emotion Recently, the TV-(V)AR has been introduced to psycho-
dynamics within an individual have also shown that logical research, where it has been shown to be a very
emotion dynamics can change over time. This can be due powerful model for detecting changes in psychological
to both internal (e.g., negative thoughts) and external dynamics (Bringmann et al., 2017; Chow, Lu, Cohn, &
(e.g., stressful event) factors. For example, a stressful event Messinger, 2017; Haslbeck & Waldorp, under review).
such as speaking in public can lower emotional inertia Here, we implement this modeling approach in the con-
(Koval & Kuppens, 2012), that is, the overspill of an emo- text of dyadic interactions. We demonstrate its usefulness
tion from one time point to the next (Kuppens, Allen, & for detecting and modeling smooth changes in dyadic
Sheeber, 2010; Suls, Green, & Hillis, 1998). In addition, emotion dynamics through both a simulation study and
emotional inertia has been shown to change due to inter- an empirical example.
nal events. To illustrate, experiencing less or more intense The structure of the article is as follows: We first
negative affect can lead to a change in emotional inertia outline the standard VAR model. Then we describe the
(Haan-Rietdijk, Gottman, Bergeman, & Hamaker, 2014). TV-VAR model in detail and discuss the GAM estimation
Thus, in order to deal with nonstationarity in emo- method. To evaluate the performance of the TV-VAR
tional processes within dyads, new models are needed. model under different conditions of change or no change
Examples of such new models include extensions of the in comparison to the standard VAR model, we present
dynamic factor model with time-varying parameters a simulation study. Next, we illustrate how the TV-VAR
using a state space approach (Chow, Zu, Shifren, & model can extract the emotion dynamics underlying
Zhang, 2011; Molenaar, De Gooijer, & Schmitz, 1992), dyadic interactions by applying it to empirical data
an extension of the (multilevel) vector-autoregressive (Ferrer & Nesselroade, 2003). In the final section, we
(VAR) model using threshold parameters representing, discuss possible advantages and disadvantages of the
for example, emotion dynamics under decreased and model and offer some concluding remarks. Example code
increased negative affect (threshold autoregressive mod- is given in the Appendix, demonstrating how TV-VAR
els; Haan-Rietdijk, Gottman, Bergeman, & Hamaker, can be applied to empirical data.
2014; Hamaker, Zhang, & Maas, 2009; Madhyastha,
Hamaker, & Gottman, 2011), and regime switching
2. Vector autoregressive model
models, in which different states of emotion dynamics
can be specified (Frühwirth-Schnatter, 2006; Hamaker, To model temporal dynamics in emotions, a (form of)
Grasman, & Kamphuis, 2010; Stifter & Rovine, 2015). vector autoregressive (VAR) model is typically fitted
Additionally, exploratory tools have been developed to to the data. The standard VAR model is a multivariate
discover which aspects or periods of dyadic interactions regression model in which all the variables on the right
show similar patterns (Boker, Rotondo, Xu, & King, 2002; side of the equation are lagged values (in this case a lag
Ferrer, Steele, & Hsieh, 2012; Hsieh, Ferrer, Chen, & of 1: t − 1) of all the dependent variables. Consider, for
MULTIVARIATE BEHAVIORAL RESEARCH 3
example, a bivariate VAR model: In the VAR specification, the βi0 (i = 1 or 2) coef-
ficients represent the intercepts of the model. The
y1,t = β10 + β11 y1,t−1 + β12 y2,t−1 + ε1,t innovation terms ε1,t and ε2,t (also known as pertur-
y2,t = β20 + β21 y1,t−1 + β22 y2,t−1 + ε2,t . (1) bations or random shocks) are the part of the current
observations y1,t and y2,t that cannot be explained by the
In a VAR model there are yi,t variables, where previous observations (y1,t−1 , y2,t−1 ). The innovations are
i = 1, 2, . . . , m is the number of variables (in this assumed to follow a white-noise process, meaning that all
case m = 2) and t is the time index (Brandt & Williams, innovation processes have a mean zero and a time invari-
2007). Each dependent variable (y1,t , y2,t ) is regressed ant symmetric positive definite covariance matrix that is
on its lagged values (y1,t−1 , y2,t−1 , respectively) through assumed to be a block diagonal. Note that because a block
the autoregressive parameters (β11 and β22 ). These diagonal is assumed, the equations in Equation (1) do not
parameters capture the strength and direction of the have to be estimated simultaneously to obtain correct esti-
autoregressive effects of a variable on itself from one time mates, but can be estimated with equation-by-equation
point to the next controlling for the cross-lagged relations. ordinary least squares (Brandt & Williams, 2007, p. 24).
As an example, consider negative affect (NA) for two indi- The bivariate VAR model specified above can also be
viduals in a romantic relationship. Autoregressive effects rewritten in a more general vector form:
indicate to what extent each variable, NA of the male and
yt = β0 + B1 yt−1 + εt , (2)
NA of the female, is predictive of itself over time (control-
ling for the partner’s NA score). A positive autoregressive with
effect indicates that current levels of NA predict NA levels
y1,t β10 β11 β12
at the next time point, such as the next day, depending on yt = , β0 = , B1 = and
the specific time metric that is used (and again controlling y2,t β20 β21 β22
for the partner’s score). In addition, a positive autoregres- ε
εt = 1,t .
sive effect indicates that the process is not very prone to ε2,t
change, such that its values across time might only slowly
In its most generic form, a VAR model with lag p
go back to baseline values. A negative autoregressive
amounts to
effect, on the other hand, indicates a jigsaw pattern in the
sense that it predicts a fast changing process. That is, high
p
negative values at a given time point predict low values of yt = β0 + Bk yt−k + εt . (3)
k=1
NA at the next time point, and the other way around.
Additionally, each dependent variable (y1,t , y2,t ) is Here, β0 denotes the vector of intercepts (βi0 ), yt−k is
regressed on the lagged values of each of the other depen- a 1 × m vector of the kth lagged variables, Bk are m × m
dent variables (y2,t−1 , y1,t−1 , respectively) through the matrices, containing the coefficients for the kth lag (βi1
cross-lagged parameters β12 and β21 . Cross-lagged effects to βm,mp arranged by lag), and εt are the innovations
indicate the direction and strength of the effect a variable collected in an m vector Brandt & Williams (2007).
has on other variables from one time point to the next Although a VAR model is suitable for modeling
controlling for the autoregressive effects. Considering temporal emotion dynamics, its standard specification
again the example of a romantic relationship, NA expe- assumes stationarity and, thus, cannot capture changes in
rienced at one time is likely to be predicted by not only the dynamics. In general terms, stationarity means that
one’s own NA at the previous time point (autoregressive the statistical properties of the data under study do not
effect), but also by the partner’s NA (cross-lagged effect). change over time. In particular, strict stationarity assumes
For example, if there is a negative cross-lagged effect from that the joint distributions of both time series are time
the male to the female, his increased NA at one time point invariant, whereas weak or covariance stationarity only
predicts decreased NA values for the female at the next assumes the means and the covariance structure of the
time point (controlling for the female’s own previous NA process to be invariant over time (Chatfield, 2003; Lütke-
score). In contrast, a positive cross-lagged effect from the pohl, 2007). In most psychological models, including
male to the female indicates that if he has a high NA at VAR, only covariance stationarity is required. In practice,
one time point she is also likely to experience an increase to ensure that a VAR(p) model is covariance stationary,
in her NA values at the next time point. we first need to re-write it as a VAR(1) model, which
Auto- and cross-lagged coefficients that are close to requires stacking yt , yt−1 , to yt−p+1 in a single vector, and
zero indicate that there is no predictive value within and regressing it on a vector that stacks yt−1 , yt−2 to yt−p.
between the variables. In such a case, for example, an In this new model, we have a block matrix that has the
individual’s NA could not be predicted by his or her own original B1 , B2 , to B p matrices as the first row, and a diag-
NA, nor by the partner’s NA. onal of identity matrices below this. If this block matrix
4 L. F. BRINGMANN ET AL.
has eigenvalues less than 1, the process is covariance functions of β0,t and Bk,t are continuous and have contin-
stationary (see for example, Hamiltion, (1994, p.259)). uous first and second derivatives. Thus, TV-VAR cannot
model abrupt changes such as sudden jumps in the data.
3. TV-VAR model
4. TV-VAR estimation
Because stationarity is often an unrealistic restriction
in emotion dynamics, a different model that does not 4.1. Generalized additive models
require the process to be stationary over time is needed.
The TV-VAR model relaxes the stationary assumption by In order to allow the coefficients of a VAR model to
letting the parameters of a VAR model, or more precisely vary over time, we use the generalized additive modeling
the β coefficients, to vary over time. (GAM) framework (see also Bringmann et al., 2017)
A (bivariate) TV-VAR model is defined as for a thorough discussion of the GAM approach in the
univariate case). GAMs build on general linear models
y1,t = β10,t + β11,t y1,t−1 + β12,t y2,t−1 + ε1,t (GLMs). However, GAMs are more flexible than GLMs as
y2,t = β20,t + β21,t y1,t−1 + β22,t y2,t−1 + ε2,t , (4) they do not require that the functional relation between
criterion and predictors is defined beforehand as a certain
or parametric form (e.g., linear). In order to achieve this,
GAM estimates the functional relation locally instead
yt = β0,t + B1,t yt−1 + εt , (5) of globally. In global estimation, the function between
two variables is described with a mean or β coefficient.
with
In local estimation, used in GAM, the functional form
y1,t β10,t β11,t β12,t is estimated from the data using local estimators or
yt = , β0,t = , B1,t = , and
y2,t β20,t β21,t β22,t smoothers. The smoothers are then estimated for a
restricted range x and y repeatedly so that in the end the
ε1,t
εt = . whole range of x and y is covered. These estimates are
ε2,t
then aggregated by a line summarizing the relationship
Again, one can write a TV-VAR model with lag p in between the variables over the whole range. In this way,
its most general form as local estimators or smooth functions do not impose a par-
ticular functional form on the relationship between two
p
variables. Therefore, GAM estimation does not produce
yt = β0,t + Bk,t yt−k + εt . (6)
a single parameter as is the case with linear modeling, but
k=1
the relationship between variables is summarized visually
As in the standard VAR model, the β0,t coefficients rep- in a plot of the estimated relationship (Keele, 2008). As
resent the intercept, whereas the strength and direction x can also represent time, the GAM approach makes it
of the autoregressive and cross-lagged effects are captured possible to let the parameters vary over time.
by the coefficients Bk,t . However, as the t indicates, the GAMs can model coefficients both as in standard
intercept and the direction and strength of autoregressive regression (i.e., β0 and B1 ) and as nonparametric
and cross-lagged effects can now take different values (smooth) functions (i.e., β0,t and B1,t ), and hence GAMs
over time. Identifying the precise way in which these are said to be semi-parametric (Keele, 2008; Wood,
coefficients vary over time is a data-driven process (the 2006). Although GAM is a more flexible framework
estimation procedure is explained in the next section). than GLM through the incorporation of nonparametric
The innovation terms εt are still assumed to be stationary smooth functions, it does assume additivity as in stan-
with mean zero. Thus, the covariance matrix of the inno- dard regression, meaning that the amount of change in
vations is not allowed to change structurally over time. the dependent variable y caused by a unit increase in an
The TV-VAR model requires two assumptions. First, independent variable x does not depend on the values
although stationarity is no longer required in a TV-VAR of the other independent variables in the model. This
modal, the process still needs to be bounded in order to assumption ensures that GAMs can be interpreted in the
get interpretable results. Statistically, this comes down same way as multiple regression models (Keele, 2008).
to local stationarity. More precisely, although the coeffi-
cients are allowed to vary over time, at each time point
4.2. Regression splines
t the process needs to be covariance stationary; hence,
the term local stationarity (Dahlhaus, 1997). Second, the There exist various ways to fit GAMs. In the method pro-
change of the process or interaction in a TV-VAR modal posed by Wood (2006), GAMs are based on a penalized
is assumed to be smooth. Smoothness entails that the maximum likelihood approach using regression splines.
MULTIVARIATE BEHAVIORAL RESEARCH 5
1.5
1.4
0.8
0.8
0.8
0.6
1.0
0.6
0.6
1.2
0.4
0.4
0.4
0.5
R1(t)
R2(t)
R3(t)
R4(t)
0.2
1.0
y
0.2
0.2
0.0
0.0
0.0
0.0
0.8
−0.2
−0.5
−0.2
−0.2
−0.4
−0.4
−0.4
−1.0
0.6
0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30
t t t t t
1.0
1.0
1.5
0.8
0.8
1.0
0.6
0.5
0.6
0.4
0.4
0.5
R5(t)
R6(t)
R7(t)
0.4
0.2
0.0
βt
^
0.2
0.0
0.0
0.2
0.0
−0.5
−0.5
−0.2
0.0
−0.2
−1.0
−0.4
−0.2
−1.0
−0.4
0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30
t t t t t
Figure . An example of a cubic regression spline basis for the model yt = βt + t . The basis functions for the smooth curve βt of a cubic
regression spline basis are shown. The first panel represents the data through which the smooth curve will be fitted. The knot locations are
shown as vertical lines. The first basis function is defined as R1 (t ) = 1 and the other six basis functions (R2 (t )–R7 (t ) ) are spline-specific
basis functions. Thus, with six knots there are seven basis functions in total. Just as in standard regression, all basis functions Ri (t ) are
weighed by multiplying them with their corresponding αi coefficients. These weighted basis functions are then summed up, resulting in
the smooth curve β̂t (with CI) in the last panel at the bottom right where the black dots again represent the data.
In this approach, the time-varying β0,t and B1,t coeffi- basis functions need to be added. This would quickly
cients of the TV-VAR model (the smooth terms) consist of lead to collinearity problems (Marra & Radice, 2010).
basis functions. For example, if we focus only on one time- To circumvent this problem, regression splines can be
varying intercept, denoted β̂t , it can be represented as used as a basis. Regression splines are pieces of poly-
nomials that are joined smoothly at breakpoints called
β̂t = α̂1 R1 (t ) + α̂2 R2 (t ) + α̂3 R3 (t ) + · · · + α̂K RK (t ). knots (Hastie & Tibshirani, 1990). A common choice for
(7) regression splines are piecewise cubic polynomials, which
Here each smooth term has K known basis functions are constrained to be continuous at the knot points and,
R1 (t ), . . . , RK (t ) and K unknown regression coefficients additionally, are constrained to have a continuous first
α̂1 , . . . , α̂K , that have to be estimated. Additionally, t and second derivative (Fitzmaurice, Davidian, Verbeke,
represents the predictor variable (time in our case). & Molenberghs, 2008). It is important to point out that
Summing up all the weighted basis functions (α̂) results although regression splines are segmented cubic polyno-
in the final curve for the smooth function (here β̂t , see mials joined at the knots, the function evaluation is not
also Figures 1 and 2). The more basis functions a smooth restricted to particular segments. Instead, there is an indi-
term has, the more flexible, “wigglier” and nonlinear the vidual basis function for every knot and each basis func-
smooth term becomes. Estimation of the optimal regres- tion evaluates every value of t in the data (see Figure 1).
sion weights (i.e., α̂) is done using penalized iterative In the analyses of the current paper, we use the default
reweighted least squares (Wood, 2000, 2006). regression spline basis of the GAM software: the thin
As a basis function, a polynomial basis (e.g., x0 , x1 , plate regression spline basis (Wood, 2003, 2006). In
2
x , etc.) could be used. However, in order to capture contrast to cubic regression splines, where the basis func-
complicated nonlinear smooth terms, many of these tions are associated directly with a knot location, the basis
6 L. F. BRINGMANN ET AL.
0.6
1.5
1.4
0.4
1.5
0.4
0.2
1.0
1.0
1.2
0.2
0.0
0.5
0.5
R1(t)
R2(t)
R3(t)
R4(t)
−0.2
0.0
1.0
0.0
y
0.0
−0.5
−0.4
−0.2
0.8
−1.0
−0.5
−0.6
−0.4
−1.5
−0.8
−0.6
−1.0
0.6
0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30
t t t t t
1.5
1.0
1.5
1.0
0.6
1.0
0.5
0.4
0.5
0.5
0.5
0.2
R5(t)
R6(t)
R7(t)
0.0
0.0
0.0
βt
^
0.0
0.0
−0.5
−0.5
−0.5
−0.5
−0.2
−1.0
−1.0
−1.0
−0.4
−1.0
−1.5
0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30
t t t t t
Figure . An example of a thin plate regression spline basis for the model yt = βt + t . The basis functions for the smooth curve βt of
a thin plate regression spline basis are shown. The first panel represents the data through which the smooth curve will be fitted. The
next two panels represent the first two basis functions, which are defined as R1 (t ) = 1 and R2 (t ) = t. The other five basis functions
(R3 (t )–R7 (t )) are thin plate spline-specific basis functions. Just as in standard regression, all basis functions Ri (t ) are weighed by
multiplying them with their corresponding αi coefficients. These weighted basis functions are then summed up, resulting in the smooth
curve β̂t (with CI) in the last panel at the bottom right where the black dots again represent the data.
functions in the thin plate regression splines are not knot- and may not follow the data well. Too many basis func-
based in a conventional sense (see Figure 2). Instead, the tions, on the other hand, will lead to interpolation of the
thin plate regression spline approach starts with one data points and will result in overfitting (Andersen, 2009;
knot per observation, using then an eigen-decomposition Keele, 2008). Thus, one crucial problem is finding the
approach to get the number of basis coefficients maxi- right number of basis functions.
mally accounting for the variance in the data. Addition- One approach to find the right number of basis func-
ally, the basis functions are also no longer so sensitive tions involves using the penalized likelihood approach
to the exact knot placement (for more information, see (Wood, 2006). The idea behind this method is to take
Wood, 2003). Note also that in thin plate regression more basis functions than expected to be necessary and
splines, every basis function that is added is “wigglier” control the function’s smoothness by adding a wiggli-
than the previous basis function: for example, in Figure 2 ness penalty (Wood, 2006). This penalty decreases the
basis function R7 is wigglier than R6 . Different splines influence of the highly “wiggly” components of the basis
often give similar smooth functions and, thus, the choice functions. To determine the wiggliness penalty that
of the spline basis is typically not crucial (Wood, 2006). leads to optimal smoothness of the function, a general-
As stated previously, how complex or “wiggly” the final ized cross-validation technique (GCV; Golub, Heath, &
smooth function (e.g., β̂t ) becomes depends on the num- Wahba, 1979) can be used. The lowest GCV score repre-
ber of (regression spline) basis functions. By increasing sents the penalty that is optimal in the sense that it leads
the number of basis functions, the final smooth functions to the best trade-off between underfitting and overfitting.
become more complex and “wiggly.” When using too few All of the techniques described in this section are
basis functions, the curve will have too little curvature implemented in the mgcv package in R (Wood, 2006).
MULTIVARIATE BEHAVIORAL RESEARCH 7
Besides the type of spline bases, one only has to define 5. Simulation study
enough basis functions, the default being 10 basis
To evaluate the performance of the TV-VAR model, we
functions. The output contains the estimated smooth
carried out a simulation study comparing a standard
functions and a GCV score. The GAM procedure in the
bivariate VAR to a bivariate TV-VAR model under differ-
mgcv package also provides a measure of nonlinearity and
ent conditions of change using R,R (R Core Team, 2017).
95% Bayesian credible intervals (CIs; see Wood, 2006).
We investigated in which cases a TV-VAR model should
The measure of nonlinearity is the effective degrees of
be preferred over a standard VAR model by generating
freedom (edf). An edf of one indicates a linear effect,
data from both models and evaluating their performances
and the higher the edf, the more “wiggly” the estimated
using the mean square error (MSE) and coverage prob-
smooth function (Shadish, Zuur, & Sullivan, 2014). The
ability of the 95% credibility intervals. The population
number of basis functions should be well below the
parameters were based on previous studies (see, for exam-
maximum possible edf for the smooth function (or term)
ple, Bos, Hoenders, & Jonge, 2012; Wigman et al., 2015).
of interest (Wood, 2006). When this is not the case,
the next step is to re-fit the model with a larger num-
ber of basis functions (e.g., double). If the reported edf 5.1. Set up of the simulation study
increases substantially with this operation, this is a sign
that even more basis functions are needed. Furthermore, There were two main conditions:
the ref.df is given. This stands for the reference degrees 1. The data are generated with a standard time-
of freedom and is an alternative measure of degrees of invariant VAR model in which the parameters do
freedom, used for hypothesis testing. The 95% Bayesian not change over time (see also Figure 3A):
credible intervals around the smooth curve reflect the
y1,t = 1 + 0.6y1,t−1 + 0y2,t−1 + ε1t
uncertainty of the smooth function (for more details,
see Wood, 2006).1 y2,t = 1 + 0.2y1,t−1 + 0.3y2,t−1 + ε2t . (8)
Besides visually inspecting the plots of the intercept, 2. The data are generated with a TV-VAR model (see
autoregressive, and cross-lagged smooth functions to also Figure 3B and 3C):
detect changes in the functions over time, it is possible to
calculate fit indices such as the BIC and AIC for model y1,t = β10,t + β11,t y1,t−1 + β12,t y2,t−1 + ε1,t
comparison. Note that the BIC and AIC calculated for y2,t = β20,t + β21,t y1,t−1 + β22,t y2,t−1 + ε2,t . (9)
these penalized models are not maximizing the actual
likelihood but penalized likelihood. Furthermore, to Parameters of the TV-VAR model could vary either
calculate the AIC and BIC, the edf is used instead of as a linear function (Figure 3B) or as a sine function
the actual number of parameters (see for more detailed (Figure 3C). All parameters varied simultaneously over
information Hastie & Tibshirani, 1990). Following the time. Both generating functions (the linear and the sine)
results of a previous simulation study (Bringmann et al., varied from zero to a maximum (absolute) value (M). This
2017), we recommend to use only the BIC for model value corresponded to the parameter values in the stan-
comparison when having over 100 time points. In these dard VAR model of Equation (8). In the case of a linear
circumstances, the BIC functions well and can indicate change, the time-varying parameter (e.g., β10,t ) was then
whether a standard VAR model or one of the time- simulated according to a linear function β10,t = t · M/n,
varying models fits the data better. Under 100 time and in the sine case, the parameter was simulated accord-
points, neither the AIC nor the BIC performs particularly ing to a sine function β10,t = M · sin( 2πt
n
), where n is the
well in selecting the true model (i.e., whether the process total number of time points, M is the maximum absolute
under study is time-varying or time-invariant). The AIC value, and ti denotes the time points i = 1, . . . , n.
will select the time-varying models too often, and the In Figures 6 and 7, the line and tilde symbols represent
BIC will select the time-invariant (standard VAR) model how the parameters in the TV-VAR model changed
too often. In this case, we recommend to use both the over time (i.e., in a linear or sine way), the number in
AIC and BIC, and to see if they converge to the same parentheses being the maximum absolute value of the
model. For more detailed information on model compar- time-varying parameter. For example, β10,t varied as a
ison between TV-(V)AR and standard (V)AR models, linear function, the starting point being 0 and the end
(see Bringmann et al., 2017). point being 1. As another example, parameter β22,t varied
as a sine function with the peak values being 0.3 and
−0.3. Note that β12,t did not vary over time as in this
It has recently also become possible to estimate generalized additive models
case the parameter value was 0. The innovations εt were
in a fully Bayesian way (Wood, ). simulated as a white-noise process, with the mean 0 and
8 L. F. BRINGMANN ET AL.
Figure . Average MSE values for both the TV-VAR (with , , and basis functions) and the VAR model. The data were generated by
the VAR model. A lower MSE value entails a better recovery of the true coefficient values. The number next to the β indicates its value.
model regardless of the process of change. This difference particular, to keep the example parsimonious, we focus
increased as the number of time points increased. Impor- on the feelings of positive affect (PA) in one couple that
tantly, the coverage probability of the TV-VAR model completed a daily questionnaire on their affect for 91
was in all cases above 90%, and this was the case already consecutive days (Figure 8; for more information see
with 100 time points (see Figure 7). Also here the number Ferrer, Widaman, Card, Selig, & Little, 2008; Ferrer,
of basis functions somewhat influenced the results when Steele, & Hsieh, 2012). Every day during the study period,
there were less than 150 time points. However, in most the two individuals in the couple rated items representing
settings these differences were negligible. emotion adjectives from the Positive and Negative Affec-
In conclusion, it seems that when it is suspected that tive Schedule (PANAS; Watson, Clark, & Tellegen, 1988)
time-varying dynamics in the data are present, a TV-VAR responding to the instructions “Indicate to what extent
model is a preferable model from about 100 time points you have felt this way today” on a 5-point likert scale,
on. Furthermore, even if the dynamics are time-invariant, ranging from 1 (very slightly or not at all) to 5 (extremely).
with at least 200 time points, a TV-VAR model gives good The 10 items representing positive affect (PA) included
results. interested, excited, strong, enthusiastic, proud, inspired,
determined, attentive, active, and alert. The PA score
was based on the mean of these 10 items. The data are
6. Empirical example
available on the website of the journal and the R-code to
replicate the analyses can be found in the Appendix.
6.1. Description
In this section, we apply our proposed approach to
empirical data from two individuals in a dyad.3 In 6.2. Analysis
We carried out analyses using the TV-VAR model
The dyad was selected from a larger pool of dyads. The criteria for selecting
the couple were the availability of at least time points and clearly time- to study: (a) changes over time in PA for each indi-
varying parameters when estimating a TV-VAR model. vidual in the dyad, and (b) the extent to which each
10 L. F. BRINGMANN ET AL.
Figure . Average coverage probabilities (CP) in % for both the TV-VAR (with , , and basis functions) and the VAR model. The data
were generated by the VAR model. A higher value entails capturing the true coefficient values better. The number next to the β indicates
its value. CIs for both models were %.
individual’s PA was affected by the partner’s PA. The Both settings gave highly similar results, and therefore 10
model of interest for our analyses is a model in which basis functions were used in the final model (see also the
all terms are time-varying parameters (i.e., model 1 in R-code in the Appendix).
Table 1):
6.3. Results
PAmalet = β10,t + β11,t PAmalet−1 + β12,t PAfemalet−1 + ε1,t
Both the time-varying and the standard VAR model
PAfemalet = β20,t + β21,t PAmalet−1 + β22,t PAfemalet−1 + ε2,t .
indicated that all the parameters pertaining to the male’s
(11) PA were statistically significant, whereas those for the
female’s PA were not. That is, in the emotion system of
This model was compared with alternative specifica- this dyad, only the male’s PA could be predicted over
tions, in other words, simpler models in which some or time. For example, the TV-VAR model, as depicted in
all of the parameters were time invariant (see model 2 model 1 and Equation (11), showed that the smoothing
until 8 in Table 1). parameters for the male’s PA had p-values < 0.024 and
Model selection was based on three criteria: (1) sig- were thus relevant for predicting his PA.
nificance level of the smooth parameters, (2) visual Regarding the question whether the parameters were
inspection of change in the parameters over time, and (3) time-varying or time-invariant, the AIC indices indicated
AIC and BIC fit indices. For all models, the innovations that model 1, in which all parameters are time-varying,
ε1,t and ε2,t were evaluated, and tests indicated a lack of was the best model. In contrast, the BIC indicated the
autocorrelation over time as well as homogeneity and a opposite: model 8, a standard VAR model where all the
normal distribution (see, for example, the innovations parameters are time-invariant, was the best fitting model
of the first model depicted in Figure 9). We used the (see Table 2).4
standard number of basis functions 10, and as a check, This was not a surprising result given simulations done in a previous study
doubled the number of basis functions to 20 as well. Bringmann et al. (), indicating that the AIC tends to choose time-varying
MULTIVARIATE BEHAVIORAL RESEARCH 11
~ ~
Figure . Average MSE values for both the TV-VAR (with , , and basis functions) and the VAR model. The data were generated by
the TV-VAR model. A lower MSE value entails a better recovery of the true coefficient values. The number next to the β indicates the
maximum absolute value of β and the symbols describe how β changed over time.
Interestingly, the second best model indicated by the representation of the data. This means that the male
AIC and BIC fit indices was in both cases model 3. In this in this couple had a stable emotional inertia over time,
model, the intercept and cross-lagged effect (female’s PA) that is, he showed some spillover effects in his positive
were time-varying, whereas the autoregressive parameter emotions from one day to the next. Furthermore, during
(male’s PA) was not time-varying, but fixed to 0.25 with a the first part of the study, such emotions appeared to be
p-value of 0.013. However, the differences in AIC values mainly influenced by his own emotions. Halfway through
between model 1 and model 3 or BIC values between model the study, however, his emotions were also influenced
8 and model 3 were so small that the models can be seen as by those of his female partner, but such effects were in
having an equivalent fit. Visual inspection of the smooth- the opposite direction. In other words, when her positive
ing parameters (see Figure 10) showed that, whereas the emotions were low, his tended to be higher the next day,
cross-lagged function is clearly varying over time, the and the other way around. Thus, a clear change in the
autoregressive function (inertia) cannot be disregarded as dynamics between the partners was apparent in these
a straight time invariant function, as it does not clearly go data (see also Figure 10).
up or down at any point in time. In order to control for Whereas Figure 10 only represents the results of the
effects that are only due to differences in emotional vari- TV-VAR model, it is also helpful to visually compare the
ability, we also standardized the results (mean = 0 and results of a standard VAR model with those of a TV-VAR
variance = 1; see, for example, Bulteel et al., 2016). These model. This is done in Figures 11 and 12, which are
analyses led to the same results and conclusions. conceptual representations of how emotion dynamics
Thus, based on significance testing, visual inspection are modeled in VAR and TV-VAR models, inspired
and fit indices, model 3 was chosen as the most plausible by the network approach (see, for example, Borsboom
& Cramer, 2013) and path analysis (see, for example,
models as the best model whereas the BIC indicates often time-invariant Loehlin, 2004). Figure 11 illustrates the VAR model,
models as the best fitting model, especially when the number of time points
is relatively small. where the dynamics within and between the male and
12 L. F. BRINGMANN ET AL.
~ ~
Figure . Average coverage probabilities (CP) in % for both the TV-VAR (with , , and basis functions) and the VAR model. The data
were generated by the TV-VAR model. A higher value entails capturing the true coefficient values better. The number next to the β
indicates the maximum absolute value of β and the symbols describe how β changed over time. CIs for both models were %.
5
Male
Female
4
Positive Affect
3
2
1
0 20 40 60 80
Day number
Figure . Daily positive affect (PA) scores for a male and a female involved in a romantic relationship.
MULTIVARIATE BEHAVIORAL RESEARCH 13
Table . The eight different models to select from for male and female positive affect.
Model Model specification
Figure . Fitted values versus innovations of positive affect (PA) for both male and female. The innovations were homogenous and
normally distributed.
14 L. F. BRINGMANN ET AL.
Figure . This figure shows the parameters of model (Equation ()) for positive affect (PA) of the male and female. In model all
parameters were allowed to vary over time as smooth functions. The upper panel indicates, from left to right: () the intercept function,
() the autoregressive function (or inertia) of PA of the male, and () the cross-lagged function (the effect of PA of the female on PA of the
male). The lower panel has the same structure, but represents PA of the female, which could not be significantly predicted by her own
PA nor the PA of her partner. Note that model would result in the same figure, except for β11,t and β21,t , which in model are constants
of . and ., respectively.
model was superior to the standard time-invariant VAR model indicated that the female’s positive affect always
model. Moreover, the results indicated that when the influenced the male’s, the TV-VAR model showed that
data were actually time-invariant, with at least 200 time her positive affect did not initially influence his posi-
points, the estimations of the TV-VAR model were still tive affect, but such influence became evident halfway
satisfactory. through the study. These results highlight the importance
We also applied the TV-VAR model to empirical of using a TV-VAR model to identify changes in the
data consisting of positive daily affect ratings from two dynamics in a system. For example, had stable autore-
individuals in a romantic relationship. In comparing the gressive or cross-lagged effects been assumed, the change
stationary VAR model to the TV-VAR model, we found in dynamics would have been overseen.
evidence that the emotion dynamics within the couple The TV-VAR model is also applicable in other
varied over time. Specifically, we found that both the VAR contexts. In fact, in all situations in which temporal
and the TV-VAR model showed that the female’s positive dynamics can possibly alter over time, a TV-VAR model
affect was not influenced by her own affect, nor by that of is potentially useful. For example, in the increasingly
her male partner. However, for the male’s positive affect, popular network approach to psychopathology, the net-
the results from the models differed. Whereas the VAR works are often inferred with a standard VAR model
Figure . Conceptual representation of the VAR model for positive affect (PA) of the male and the female. In the VAR model the dynamics
are not allowed to change over time.
MULTIVARIATE BEHAVIORAL RESEARCH 15
Figure . Conceptual representation of the TV-VAR model for positive affect (PA) of the male and the female. In the TV-VAR model, the
dynamics are allowed to change over time. In this dyad, the dynamics did indeed change. There was initially no effect of the female’s PA
on the male’s PA, but this cross-lagged effect appeared halfway through the study (see the thin red arrow) and got stronger over time
(see the thick red arrow).
(Borsboom & Cramer, 2013; Bringmann et al., 2016; An important limitation of the TV-VAR model is that
Fried et al., 2017; McNally, 2016; Pe et al., 2015; Wigman a relatively large number of time points (around 100) are
et al., 2015). However, many hypotheses underlying the needed in order to get reliable estimates. For physiological
network perspective involve change in the temporal measurements (e.g., heart rate activity) such numbers are
dynamics. For instance, in the area of psychopathology, readily available. However, although self-report studies
an increase in autocorrelation of the emotion dynamics, with a large number of time points are becoming more
referred to as critical slowing down, is assumed to be common, most such studies still collect far fewer than 100
an early warning for a transition into depression (van time points (Rot, Hogenelst, & Schoevers, 2012; Trull &
de Leemput et al., 2014). Translated to network theory, Ebner-Priemer, 2013). Furthermore, the TV-VAR model
it is assumed that the network (i.e., autoregressive and assumes the change to be gradual and abrupt changes
cross-lagged parameters) gets more dense or strongly cannot be identified. Such abrupt changes can be modeled
connected when a person transits to depression (Cramer using regime switching models (Hamaker et al., 2010),
et al., 2016). Whereas a VAR model would be unable and future research should combine regime switching
to detect such shifts, a TV-VAR model could help to models with TV-VAR models in order to enable modeling
discover these important transitions. both abrupt and gradual changes.
An additional advantage of the TV-VAR model is that Additionally, as we estimate the TV-VAR model
it can be used to detect nonstationarity. Even though there equation-by-equation, we are not explicitly estimating
are tests to check for several kinds of stationarity (e.g., the innovation covariance. Note however, that this does
Dickey & Fuller, 1979), there is no direct test that checks not mean the model is based on the assumption that the
for nonstationarity due to changes in the covariance covariance between the innovations is zero. In fact, it
structure (i.e., autoregressive and cross-lagged effects). might very well be nonzero due to: (a) effects the vari-
Because the TV-VAR model can detect both dynamics ables have on one another at shorter intervals (i.e., lags),
that do and do not change over time, it can be used as and (b) omitted variables that affect both variables (i.e.,
an exploratory tool to check for nonstationarity due to unobserved common causes). Thus, further development
changes in the covariance structure. Simultaneously, it can of techniques that allow us to study these innovation
indicate whether trends in the data are present. Addition- covariances can be of great interest.
ally, the TV-VAR model immediately captures how the Another limitation of the TV-VAR model is its idio-
covariance structure and trends in the data vary over time. graphic approach. Future research should explore new
In this paper, we focused on the simplest TV-VAR ways to go beyond a single dyad, for example, by using a
model: a bivariate lag-1 model. A fruitful extension multilevel or a clustering approach. A multilevel version
would be to include more variables and lags. More of the TV-VAR model would allow for estimating both
complex models, however, bring issues such as inter- intra- and inter-individual effects (Bringmann et al., 2013;
pretability and the identification of false positive relations Haan-Rietdijk, Gottman, Bergeman, & Hamaker, 2014;
(e.g., Costantini et al., 2015; Rasmussen & Bro, 2012; Schuurman, Ferrer, Boer-Sonnenschein, & Hamaker,
Tibshirani, 1996). Future research should aim at devel- 2016; Shiyko, Lanza, Tan, Li, & Shiffman, 2012; Snijders
oping regularization techniques for TV-VAR models in & Kenny, 1999; Winter & Wieling, 2016). A disadvantage
order to enhance model interpretability and to decrease of the multilevel approach, however, is that the individual
the number of spurious connections (see, for example, effects are assumed to be drawn from a single distribution
Haslbeck & Waldorp, under review). (usually the multivariate normal), limiting the amount
16 L. F. BRINGMANN ET AL.
of heterogeneity over individuals or dyads. In contrast, participants, maintaining ethical treatment and respect for
in a clustering approach, for every individual or dyad a the rights of human or animal participants, and ensuring the
separate model is estimated, making this approach very privacy of participants and their data, such as ensuring that
individual participants cannot be identified in reported results
flexible. Clustering could then be conducted on the shape or from publicly available original or archival data.
of the autoregressive and cross-lagged effects within the
dyads (for a similar approach, see Heylen, Verduyn, Van Funding: This work was supported by the Consolidator Grant
no. 647209 from the European Research Council (Denny
Mechelen, & Ceulemans, 2015). Such clusters could be Borsboom), the Belgian Federal Science Policy within the
then meaningfully related to other dyad characteristics, framework of the Interuniversity Attraction Poles program
such as relationship satisfaction, relationship duration, or (IAP/P7/06), as well as by grant GOA/15/003 from the KU
personality traits of the partners. A disadvantage of the Leuven, and the grant G.0806.13 from the Research Foundation
clustering approach is that more time points per individ- Flanders - FWO (Francis Tuerlinckx).
ual are needed than with a multilevel approach, and that Role of the Funders/Sponsors: None of the funders or spon-
most clustering models have the unrealistic assumption sors of this research had any role in the design and conduct of
of a perfect within-cluster homogeneity (however, an the study; collection, management, analysis, and interpretation
of data; preparation, review, or approval of the manuscript; or
exception is De Roover, Ceulemans, Timmerman, &
decision to submit the manuscript for publication.
Onghena, 2013).
In the context of dyadic research, it is common practice Acknowledgments: The authors would like to thank Markus
Eronen for his comments on prior versions of this manuscript.
to test for differences in autocorrelation or cross-lagged
The ideas and opinions expressed herein are those of the authors
effects. A commonly used dyadic model, for instance, is alone, and endorsement by the authors’ institutions or the fund-
the actor-partner model with two time points (Kenny & ing agencies is not intended and should not be inferred.
Cook, 1999; Kenny & Ledermann, 2010). In this model,
hypotheses about the equivalences in “actor” (autoregres-
sive) or “partner” (cross-lagged) effects can be tested by References
putting constraints on the model as the model is estimated aan het Rot, M., Hogenelst, K., & Schoevers, R. A. (2012).
in one go (for example, in a structural equation frame- Mood disorders in everyday life: A systematic review of
work). The TV-VAR model, although more elaborated experience sampling and ecological momentary assessment
and flexible, has the limitation that the model is estimated studies. Clinical Psychology Review, 32(6), 510–523. doi:
separately for the two dyads under study. Although direct 10.1016/j.cpr.2012.05.007
Andersen, R. (2009). Nonparametric methods for modeling
testing is not possible, one can compare “actor” or nonlinearity in regression analysis. Annual Review of Sociol-
“partner” effects in an exploratory way, for example, by ogy, 35, 67–85. doi: 10.1146/annurev.soc.34.040507.134631
collating the standardized effect of interest of, in our case, Boker, S. M., Cohn, J. F., Theobald, B.-J., Matthews, I., Mangini,
the male and the female in one plot. As a preliminary test M., Spies, J. R., .. Brick, T. R. (2011). Something in the way
one could examine the credible intervals. If, for instance, we move: Motion dynamics, not perceived sex, influence
head movements in conversation. Journal of Experimen-
the point estimate of the cross-lagged regression coeffi-
tal Psychology: Human Perception and Performance, 37(3),
cient from the male to the female lies outside the credible 874–891. doi: 10.1037/a0021928
interval for the cross-lagged coefficient from the female to Boker, S. M., & Laurenceau, J.-P. (2006). Dynamical systems
the male, this is evidence for these effects being different. modeling: An application to the regulation of intimacy
The aim of this paper was to introduce the semi- and disclosure in marriage. In T. A. Walls & J. L. Schafer
parametric TV-VAR model into research on dyadic (Eds.), Models for intensive longitudinal data (pp. 195–218).
Oxford, England: Oxford University Press.
interactions and psychological research in general. We Boker, S. M., & Nesselroade, J. R. (2002). A method for mod-
hope to have shown that the TV-VAR model is easy to eling the intrinsic dynamics of intraindividual variability:
apply and can detect and capture changing dynamics Recovering the parameters of simulated oscillators in multi-
without prior knowledge of the nature of the change. wave panel data. Multivariate Behavioral Research, 37(1),
127–160. doi: 10.1207/S15327906MBR3701_06
Boker, S. M., Rotondo, J. L., Xu, M., & King, K. (2002). Win-
dowed cross-correlation and peak picking for the analysis of
Article Information variability in the association between behavioral time series.
Psychological Methods, 7(3), 338–355. doi: 10.1037//1082-
Conflict of Interest Disclosures: Each author signed a form for
989X.7.3.338
disclosure of potential conflicts of interest. No authors reported
Borsboom, D., & Cramer, A. O. (2013). Network analysis:
any financial or other conflicts of interest in relation to the work
An integrative approach to the structure of psychopathol-
described.
ogy. Annual Review of Clinical Psychology, 9, 91–121. doi:
Ethical Principles: The authors affirm having followed pro- 10.1146/annurev-clinpsy-050212-185608
fessional ethical guidelines in preparing this work. These Bos, E. H., Hoenders, R., & de Jonge, P. (2012). Wind direc-
guidelines include obtaining informed consent from human tion and mental health: A time-series analysis of weather
MULTIVARIATE BEHAVIORAL RESEARCH 17
influences in a patient with anxiety disorder. BMJ Case De Roover, K., Ceulemans, E., Timmerman, M. E., & Onghena,
Reports, 2012. doi: 10.1136/bcr-2012-006300. P. (2013). A clusterwise simultaneous component method
Brandt, P. T., & Williams, J. T. (2007). Multiple time series models. for capturing within-cluster differences in component vari-
Series: Quantitative applications in the social sciences. Thou- ances and correlations. British Journal of Mathematical and
sand Oaks, CA: Sage Publications Inc. Statistical Psychology, 66(1), 81–102. doi: 10.1111/j.2044-
Bringmann, L. F., Hamaker, E. L., Vigo, D. E., Aubert, A., 8317.2012.02040.x
Borsboom, D., & Tuerlinckx, F. (2017). Changing dynam- Dickey, D. A., & Fuller, W. A. (1979). Distribution of the estima-
ics: Time-varying autoregressive models using generalized tors for autoregressive time series with a unit root. Journal
additive modeling. Psychological Methods, 22(3), 409–425. of the American Statistical Association, 74(366a), 427–431.
doi: 10.1037/met0000085 doi: 10.1080/01621459.1979.10482531
Bringmann, L. F., Lemmens, L. H., Huibers, M. J., Bors- Felmlee, D. H., & Greenberg, D. F. (1999). A dynamic
boom, D., & Tuerlinckx, F. (2015). Revealing the systems model of dyadic interaction. The Jour-
dynamic network structure of the Beck Depression nal of Mathematical Sociology, 23(3), 155–180. doi:
Inventory-II. Psychological Medicine, 45(04), 747–757. doi: 10.1080/0022250X.1999.9990218
10.1017/S0033291714001809 Ferrer, E. (2006). Application of dynamic factor analysis to affec-
Bringmann, L. F., Madeline, L. P., Vissers, N., Ceulemans, E., tive processes in dyads. In A. Ong & M. van Dulmen (Eds.),
Borsboom, D., Vanpaemel, W., .. Kuppens, P. (2016). Assess- Handbook of methods in positive psychology (pp. 41–58).
ing temporal emotion dynamics using networks. Assess- Oxford, UK: Oxford University Press.
ment, 23(4), 425–435. doi: 10.1177/1073191116645909 Ferrer, E. (2016). Exploratory approaches for studying social
Bringmann, L. F., Vissers, N., Wichers, M., Geschwind, N., interactions, dynamics, and multivariate processes in psy-
Kuppens, P., Peeters, F., .. Tuerlinckx, F. (2013). A net- chological science. Multivariate Behavioral Research, 51(2–
work approach to psychopathology: New insights into 3), 240–256. doi: 10.1080/00273171.2016.1140629
clinical longitudinal data. PloS One, 8(4), e60188. doi: Ferrer, E., & Nesselroade, J. R. (2003). Modeling affective pro-
10.1371/journal.pone.0060188 cesses in dyadic relations via dynamic factor analysis. Emo-
Bulteel, K., Tuerlinckx, F., Brose, A., & Ceulemans, E. (2016). tion, 3(4), 344–360. doi: 10.1037/1528-3542.3.4.344
Using raw VAR regression coefficients to build networks can Ferrer, E., Steele, J. S., & Hsieh, F. (2012). Analyzing the
be misleading. Multivariate Behavioral Research, 51(2–3), dynamics of affective dyadic interactions using pat-
330–344. doi: 10.1080/00273171 terns of intra-and interindividual variability. Mul-
Butler, E. A. (2011). Temporal interpersonal emotion sys- tivariate Behavioral Research, 47(1), 136–171. doi:
tems: The “TIES” that form relationships. Personality 10.1080/00273171.2012.640605
and Social Psychology Review, 15(4), 367–393. doi: Ferrer, E., Widaman, K. F., Card, N., Selig, J., & Little, T. (2008).
10.1177/1088868311411164 Dynamic factor analysis of dyadic affective processes with
Chatfield, C. (2003). The analysis of time series: An intro- inter-group differences. In N. Card, J. Selig, & T. Little (Eds.),
duction (5th ed.). Boca Raton, FL: Chapman and Modeling dyadic and interdependent data in the developmen-
Hall/CRC. tal and behavioral sciences (pp. 107–137). Hillsdale, NJ: Psy-
Chow, S.-M., Lu, O., Cohn, J., & Messinger, D. (2017). Repre- chology Press.
senting self-organization and non-stationarities in dyadic Ferrer, E., & Zhang, G. (2009). Time series models for examin-
interaction processes using dynamic systems modeling ing psychological processes: Applications and new develop-
techniques. In A. Von Davier & P. Kyllonen (Eds.), Inno- ments. In R. E. Millsap & A. Maydeu-Olivares (Eds.), Hand-
vative assessment of collaboration (pp. 269–286). New York, book of quantitative methods in psychology (pp. 637–657).
NY: Springer. London: Sage Publications.
Chow, S.-M., Zu, J., Shifren, K., & Zhang, G. (2011). Fitzmaurice, G., Davidian, M., Verbeke, G., & Molenberghs, G.
Dynamic factor analysis models with time-varying param- (2008). Longitudinal data analysis. Boca Raton, FL: Chap-
eters. Multivariate Behavioral Research, 46(2), 303–339. doi: man and Hall/CRC.
10.1080/00273171.2011.563697 Fried, E. I., Borkulo, C. D. van, Cramer, A. O., Boschloo, L.,
Costantini, G., Epskamp, S., Borsboom, D., Perugini, M., Mõt- Schoevers, R. A., & Borsboom, D. (2017). Mental disorders
tus, R., Waldorp, L. J., & Cramer, A. O. (2015). State of the as networks of problems: A review of recent insights. Social
aRt personality research: A tutorial on network analysis of Psychiatry and Psychiatric Epidemiology, 52(1), 1–10. doi:
personality data in R. Journal of Research in Personality, 54, 10.1007/s00127-016-1319-z
13–29. doi: 10.1016/j.jrp.2014.07.003 Frühwirth-Schnatter, S. (2006). Finite mixture and Markov
Cramer, A., van Borkulo, C., Giltay, E., van der Maas, H., switching models: Modeling and applications to random pro-
Kendler, K., Scheffer, M., … Borsboom, D. (2016). Major cesses. New York: Springer.
depression as a complex dynamical system. PLoS ONE, 11, Giraitis, L., Kapetanios, G., & Yates, T. (2014). Infer-
e0167490. ence on stochastic time-varying coefficient mod-
Dahlhaus, R. (1997). Fitting time series models to nonstation- els. Journal of Econometrics, 179(1), 46–65. doi:
ary processes. The Annals of Statistics, 25(1), 1–37. doi: 10.1016/j.jeconom.2013.10.009
10.1214/aos/1034276620 Golub, G. H., Heath, M., & Wahba, G. (1979). General-
de Haan-Rietdijk, S., Gottman, J. M., Bergeman, C. S., ized cross-validation as a method for choosing a good
& Hamaker, E. L. (2014). Get over it! A multilevel ridge parameter. Technometrics, 21(2), 215–223. doi:
threshold autoregressive model for state-dependent 10.1080/00401706.1979.10489751
affect regulation. Psychometrika, 81(1), 217–241. doi: Gottman, J. M. (1979). Marital interaction: Experimental inves-
10.1007/s11336-014-9417-x tigations. New York: Academic Press.
18 L. F. BRINGMANN ET AL.
Gottman, J. M. (2003). The mathematics of marriage: Dynamic inertia. Cognition and Emotion, 29(5), 831–851. doi:
nonlinear models. Cambridge: MIT Press. 10.1080/02699931.2014.948388
Gottman, J. M., Coan, J., Carrere, S., & Swanson, C. (1998). Koval, P., & Kuppens, P. (2012). Changing emotion dynam-
Predicting marital happiness and stability from newlywed ics: Individual differences in the effect of anticipatory social
interactions. Journal of Marriage and Family, 60(1), 5–22. stress on emotional inertia. Emotion, 12(2), 256–267. doi:
doi: 10.2307/353438 10.1037/a0024756
Gottman, J. M., & Levenson, R. W. (1986). Assessing the Kuppens, P., Allen, N. B., & Sheeber, L. B. (2010). Emotional
role of emotion in marriage. Behavioral Assessment, 8(1), inertia and psychological maladjustment. Psychological Sci-
31–48. ence, 21, 984–991. doi: 10.1177/0956797610372634
Gottman, J. M., & Levenson, R. W. (1992). Marital processes Kuppens, P., Sheeber, L. B., Yap, M. B., Whittle, S., Simmons, J.
predictive of later dissolution: Behavior, physiology, and G., & Allen, N. B. (2012). Emotional inertia prospectively
health. Journal of Personality and Social Psychology, 63(2), predicts the onset of depressive disorder in adolescence.
221–233. Emotion, 12(2), 283–289. doi: 10.3389/fpsyg.2012.00380
Gottman, J. M., Swanson, C., & Swanson, K. (2002). A Kuppens, P., Stouten, J., & Mesquita, B. (2009). Individual differ-
general systems theory of marriage: Nonlinear differ- ences in emotion components and dynamics: Introduction
ence equation modeling of marital interaction. Person- to the special issue. Cognition and Emotion, 23(7), 1249–
ality and Social Psychology Review, 6(4), 326–340. doi: 1258. doi: 10.1080/02699930902985605
10.1207/S15327957PSPR0604_07 Larson, R. W., & Almeida, D. M. (1999). Emotional transmis-
Hamaker, E. L., Grasman, R. P. P. P., & Kamphuis, J. H. (2010). sion in the daily lives of families: A new paradigm for study-
Regime-switching models to study psychological processes. ing family process. Journal of Marriage and Family, 61, 5–20.
In P. C. M. Molenaar & K. Newell (Eds.), Individual path- doi: 10.2307/353879
ways of change (pp. 155–168). Washington, DC: American Lebo, M. A., & Nesselroade, J. R. (1978). Intraindividual dif-
Psychological Association. ferences dimensions of mood change during pregnancy
Hamaker, E. L., Kuiper, R. M., & Grasman, R. P. (2015). A cri- identified in five p-technique factor analyses. Journal of
tique of the cross-lagged panel model. Psychological Meth- Research in Personality, 12(2), 205–224. doi: 10.1016/0092-
ods, 20(1), 102–116. doi: 10.1037/a0038889 6566(78)90098-3
Hamaker, E. L., Zhang, Z., & van der Maas, H. L. (2009). Using Liu, S., & Molenaar, P. (2016). Testing for granger causality
threshold autoregressive models to study dyadic interac- in the frequency domain: A phase resampling method.
tions. Psychometrika, 74(4), 727–745. doi: 10.1007/s11336- Multivariate behavioral research, 51(1), 53–66. doi:
009-9113-4 10.1080/00273171.2015.1100528
Hamilton, J. D. (1994). Time series analysis. Princeton, NJ: Loehlin, J. C. (2004). Latent variable models: An introduction to
Princeton university press. factor, path, and structural analysis (4th ed.). Mahwah, NJ:
Haslbeck, J., & Waldorp, L. (under review). MGM: Structure Lawrence Erlbaum Associates Publishers.
estimation for time-varying mixed graphical models in Lütkepohl, H. (2007). New introduction to multiple time series
high-dimensional data. analysis. New York: Springer.
Hastie, T. J., & Tibshirani, R. J. (1990). Generalized additive mod- Madhyastha, T. M., Hamaker, E. L., & Gottman, J. M. (2011).
els. Boca Raton, FL: Chapman and Hall/CRC. Investigating spousal influence using moment-to-moment
Heylen, J., Verduyn, P., Van Mechelen, I., & Ceulemans, E. affect data from marital conflict. Journal of Family Psychol-
(2015). Variability in anger intensity profiles: Structure and ogy, 25(2), 292–300. doi: 10.1037/a0023028
predictive basis. Cognition and Emotion, 29(1), 168–177. Marra, G., & Radice, R. (2010). Penalised regression splines:
doi: 10.1080/02699931.2014.896783 Theory and application to medical research. Statisti-
Hsieh, F., Ferrer, E., Chen, S.-C., & Chow, S.-M. (2010). cal Methods in Medical Research, 19(2), 107–125. doi:
Exploring the dynamics of dyadic interactions via hierar- 10.1177/0962280208096688
chical segmentation. Psychometrika, 75(2), 351–372. doi: McNally, R. J. (2016). Can network analysis transform psy-
10.1007/s11336-009-9146-8 chopathology? Behaviour Research and Therapy, 86, 95–
Keele, L. J. (2008). Semiparametric regression for the social sci- 104.doi: 10.1016/j.brat.2016.06.006.
ences. Chichester, England: John Wiley & Sons. Molenaar, P. C. M., De Gooijer, J. G., & Schmitz, B. (1992).
Keltner, D., & Haidt, J. (1999). Social functions of emotions at Dynamic factor analysis of nonstationary multivariate time
four levels of analysis. Cognition and Emotion, 13(5), 505– series. Psychometrika, 57(3), 333–349.
521. doi: 10.1080/026999399379168 Parkinson, B. (1996). Emotions are social. British Jour-
Kenny, D. A., & Cook, W. (1999). Partner effects in rela- nal of Psychology, 87(4), 663–683. doi: 10.1111/j.2044-
tionship research: Conceptual issues, analytic difficulties, 8295.1996.tb02615.x
and illustrations. Personal Relationships, 6(4), 433–448. doi: Pe, M. L., Kircanski, K., Thompson, R. J., Bringmann,
10.1111/j.1475-6811.1999.tb00202.x L. F., Tuerlinckx, F., Mestdagh, M., .. Gotlib, I. H.
Kenny, D. A., & Ledermann, T. (2010). Detecting, measuring, (2015). Emotion-network density in major depressive dis-
and testing dyadic patterns in the actor–partner interdepen- order. Clinical Psychological Science, 3(2), 292–300. doi:
dence model. Journal of Family Psychology, 24(3), 359–366. 10.1177/2167702614540645
doi: 10.1037/a0019651. R Core Team (2017). R: A language and environment for sta-
Koval, P., Butler, E. A., Hollenstein, T., Lanteigne, D., & tistical computing. R Foundation for Statistical Computing.
Kuppens, P. (2015). Emotion regulation and the tem- Vienna, Austria. Available at http://www.R-project.org/.
poral dynamics of emotions: Effects of cognitive Randall, A. K., & Butler, E. A. (2013). Attachment and emo-
reappraisal and expressive suppression on emotional tion transmission within romantic relationships: Merging
MULTIVARIATE BEHAVIORAL RESEARCH 19
intrapersonal and interpersonal perspectives. Journal of Personality and Social Psychology Bulletin, 24(2), 127–136.
Relationships Research, 4, e10. doi: 10.1017/jrr.2013.10 doi: 10.1177/0146167298242002
Rasmussen, M. A., & Bro, R. (2012). A tutorial on the Tibshirani, R. (1996). Regression shrinkage and selection via
lasso approach to sparse modeling. Chemometrics the lasso. Journal of the Royal Statistical Society. Series B
and Intelligent Laboratory Systems, 119, 21–31. doi: (Methodological), 58, 267–288.
10.1016/j.chemolab.2012.10.003 Trull, T. J., & Ebner-Priemer, U. (2013). Ambulatory assess-
Sadler, P., Ethier, N., Gunn, G. R., Duong, D., & Woody, E. ment. Annual Review of Clinical Psychology, 9, 151–176. doi:
(2009). Are we on the same wavelength? Interpersonal com- 10.1146/annurev-clinpsy-050212-185510
plementarity as shared cyclical patterns during interactions. van de Leemput, I. A., Wichers, M., Cramer, A., Borsboom, D.,
Journal of Personality and Social Psychology, 97(6), 1005– Tuerlinckx, F., Kuppens, P., .. Scheffer, M. (2014). Critical
1020. doi: 10.1037/a0016232 slowing down as early warning for the onset and termina-
Schuurman, N. K., Ferrer, E., Boer-Sonnenschein, M. tion of depression. Proceedings of the National Academy of
de, & Hamaker, E. L. (2016). How to compare Sciences, 111(1), 87–92. doi: 10.1073/pnas.1312114110
cross-lagged associations in a multilevel autoregres- Watson, D., Clark, L. A., & Tellegen, A. (1988). Development
sive model. Psychological Methods, 21(2), 206–261. and validation of brief measures of positive and nega-
doi: 10.1037/met0000062 tive affect: The PANAS scales. Journal of Personality and
Shadish, W. R., Zuur, A. F., & Sullivan, K. J. (2014). Using Social Psychology, 54(6), 1063–1070. doi: 10.1037/0022-
generalized additive (mixed) models to analyze single case 3514.54.6.1063
designs. Journal of School Psychology, 52(2), 149–178. doi: Wigman, J., van Os, J., Borsboom, D., Wardenaar, K., Epskamp,
10.1016/j.jsp.2013.11.004 S., Klippel, A., .. Wichers, M. (2015). Exploring the
Shiyko, M. P., Lanza, S. T., Tan, X., Li, R., & Shiffman, S. (2012). underlying structure of mental disorders: Cross-
Using the time-varying effect model (TVEM) to examine diagnostic differences and similarities from a network
dynamic associations between negative affect and self con- perspective using both a top-down and a bottom-up
fidence on smoking urges: Differences between successful approach. Psychological Medicine, 45(11), 2375–2387. doi:
quitters and relapsers. Prevention Science, 13(3), 288–299. 10.1017/S0033291715000331
doi: 10.1007/s11121-011-0264-z Winter, B., & Wieling, M. (2016). How to analyze linguistic
Snijders, T. A., & Kenny, D. A. (1999). The social rela- change using mixed models, growth curve analysis and gen-
tions model for family data: A multilevel approach. Per- eralized additive modeling. Journal of Language Evolution,
sonal Relationships, 6(4), 471–486. doi: 10.1111/j.1475- 1(1), 7–18. doi: 10.1093/jole/lzv003
6811.1999.tb00204.x Wood, S. N. (2000). Modelling and smoothing parameter esti-
Steele, J. S., & Ferrer, E. (2011). Latent differential equation mation with multiple quadratic penalties. Journal of the
modeling of self-regulatory and coregulatory affective pro- Royal Statistical Society: Series B (Statistical Methodology),
cesses. Multivariate Behavioral Research, 46(6), 956–984. 62(2), 413–428. doi: 10.1111/1467-9868.00240
doi: 10.1080/00273171.2011.625305 Wood, S. N. (2003). Thin plate regression splines. Journal of the
Stifter, C. A., & Rovine, M. (2015). Modeling dyadic pro- Royal Statistical Society: Series B (Statistical Methodology),
cesses using hidden markov models: A time series approach 65(1), 95–114. doi: 10.1111/1467-9868.00374
to mother–infant interactions during infant immuniza- Wood, S. N. (2006). Generalized additive models: An introduc-
tion. Infant and Child Development, 24(3), 298–321.doi: tion with R. Boca Raton, FL: Chapman and Hall/CRC.
10.1002/icd.1907. Wood, S. N. (2016). Just another gibbs additive modeler: Inter-
Suls, J., Green, P., & Hillis, S. (1998). Emotional reactivity facing JAGS and mgcv. Journal of Statistical Software, 75(1),
to everyday problems, affective inertia, and neuroticism. 1–15. doi: 10.18637/jss.v075.i07
Appendix: R-code
###############################################################
################# General information #########################
###############################################################
# R-CODE for the manuscript BRINGMANN ET AL. 2018,
# Multivariate Behavioral Research.
# Title: Modeling nonstationary emotion dynamics in dyads using a
# semi-parametric time-varying vector-autoregressive model.
#%############################################%#
#%##### Installing the libraries #####%#
#%############################################%#
20 L. F. BRINGMANN ET AL.
# Before you start you have to install and load the libraries below.
# Please make sure all files are in the same working directory
# and that you have set your working directory to source file location.
getwd()
ls() # Here you can see which files are in your current working directory.
#%############################################%#
#%##### Loading the data #####%#
#%############################################%#
data_subset<-read.table("data.txt", header=T,stringsAsFactors=F)
#%############################################%#
#%##### Analyzing the data with TV-VAR #####%#
#%############################################%#
tt=1:(dim(data_subset)[1])
# The actual TV-VAR analyses where all the parameters are time-varying:
# the intercept (s(tt)),
# the autoregressive s(tt,by=pamL) and
# cross-lagged parameter s(tt,by=pamf).
gam1<-gam(as.numeric(pam)˜s(tt,k=k)+s(tt,by=pamL,k=k)+s(tt,by=pafL,k=k),
data=data_subset)
gam2<-gam(as.numeric(paf)˜s(tt,k=k)+s(tt,by=pamL,k=k)+s(tt,by=pafL,k=k),
data=data_subset)
# To see how the intercept, autoregressive and cross-lagged effects change over
# time, we would have to plot the functions (see next section).
# The effective degrees of freedom (edf) gives us information on
# how wiggly the smooth function is.
# The edf of the autoregressive smooth function has an edf of 2,
# and could indicate either a straight time-invariant line or a linear
increase.
# The cross-lagged effect is clearly more wiggly and has an edf of over 5.
#%#############################################%#
#%##### Figure of the main results in the paper #
#%#############################################%#
pdf("PA_FigureTVVAR.pdf",w=8.42,h=5)
par(mfrow=c(2,3))
par(oma=c(1,1,1,1))
numb=1
plot(gam1,rug=FALSE,select=1,seWithMean=TRUE,
shift=coef(gam1)[1],xlab="Days",
cex.lab = numb, cex.axis = numb,
ylab=bquote(paste(Intercept˜male˜(italic(beta[10][","][t])))))
22 L. F. BRINGMANN ET AL.
plot(gam1,select=2,ylim=c(-1,1),rug=F,xlab="Days",
cex.lab = numb, cex.axis = numb,
ylab=bquote(paste(PA˜male˜(italic(t-1))˜on˜PA˜male˜
(italic(t)))˜(italic(beta[11][","][t]))))
lines(tt,rep(0,91),col="darkgrey",lty=3)
plot(gam2,rug=FALSE,select=1,seWithMean=TRUE,shift=coef(gam2)[1],xlab="Days",
cex.lab = numb, cex.axis = numb,
ylab=bquote(paste(Intercept˜female˜(italic(beta[20][","][t])))))
dev.off()