Abstract
Detecting the temporally and spatially varying correlations is important to understand the biological and disease systems. Here we proposed a geographically weighted temporally correlated logistic regression (GWTCLR) model to identify such dynamic correlation of predictors on binomial outcome data, by incorporating spatial and temporal information for joint inference. The local likelihood method is adopted to estimate the spatial relationship, while the smoothing method is employed to estimate the temporal variation. We present the construction and implementation of GWTCLR and the study of the asymptotic properties of the proposed estimator. Simulation studies were conducted to evaluate the robustness of the proposed model. GWTCLR was applied on real epidemiologic data to study the climatic determinants of human seasonal influenza epidemics. Our method obtained results largely consistent with previous studies but also revealed certain spatial and temporal varying patterns that were unobservable by previous models and methods.
Introduction
Regression analysis is widely used to study the correlation between dependent and independent variables. Some commonly used regression methods, e.g. linear regression, logistic regression and log linear regression, assumed that all sampling data have the uniform relationship with the factors but have a very stringent assumption of constant covariate effects. However, this assumption is not always true, particularly in complex multivariate systems. In public health and geographic information science, it is common to observe the data with dynamic patterns related to their geographical locations and sampling time, which are regarded as spatial and temporal nonstationarity. Such nonuniform relationships could be addressed and revealed by a varying coefficient model introduced by Hastie and Tibshirani^{1}.
Multifactorial dynamic relationships are common in complex biological and disease systems at which some predictors cannot be observed or addressed easily. The usual logistic regression analysis assumes invariant coefficients and hence is inflexible to deal with such cases. For instance, seasonal dynamics of human influenza epidemics have been shown to associate with climatic factors such as temperature and humidity^{2}. However, such association may change over time due to unaccounted factors including molecular evolution of the influenza viruses (e.g. emergence of mutants with a higher resistance against higher temperature) or other social events (e.g. mass gatherings, vaccine failure) that are often hard to measure and analyze with climatic factors. Therefore, the temporally and spatially varying coefficient models rationally surpass the invariant coefficient models with less bias. Yet, many of these unaccounted predictors are believed to follow the fundamental characteristics of spatial and temporal correlation. Our aim is to develop a model that can estimate the spatiotemporal pattern of these factors for accountable correlation.
Earliest temporally varying coefficient models arose from the analysis of longitudinal data commonly seen in medical and health cohort studies. Based on the simplest linear regression, a twostep estimation of functional linear regression method was proposed by Fan and Zhang^{3}, where the collected longitudinal data is divided into different groups based on their sampling time and a linear regression analysis is performed within each group. In order to include information from the whole time period, smoothing method was used to refine the estimated regression coefficients attained from each group. In the generalized linear model’s setup, Cai et al.^{4} proposed a local likelihood method to deal with independent and identically distributed data by assigning a kernel weight to the likelihood of each observation. Şentürk^{5} further extended the local likelihood method to accommodate longitudinal data. Dong et al.^{6} extended the twostep estimation method to logistic regression to analyze binary data. This method is similar to the one proposed by Fan and Zhang^{3} but their raw estimates are more susceptible to bias which results in the requirement of large sample size.
Spatially varying coefficient model is popular in geographic information science. The spatial feature is depicted by the location coordinates, and it is natural to assume an intrinsic difference in relationships between different variables over the spatial unit. As initial and fundamental works, Brunsdon et al.^{7} and Fotheringham et al.^{8} proposed the geographically weighted regression (GWR) analysis for variables with geographically nonstationary coefficients. They used linear regression with a weighted least squares approach by assigning a geographical weight to each observation corresponding to the distance between the observation’s location and the location where the regression coefficient is being inferred. The fundamental assumption of GWR is Tobler’s first law of geography: “everything is related to everything else, but near things are more related than distant things”^{9}, and hence the weight decreases toward zero when distance goes to infinity. Nakaya et al.^{10} proposed a natural extension of GWR model to geographically weighted Poisson regression (GWPR) model for count data. Since the usual least squares estimator is not available for the generalized linear model, a variant of local likelihood approach is used. By applying the iteratively reweighted least squares, they further deduced the asymptotic properties of their proposed estimator. They are also the first to propose the semiparametric GWPR model which allows some of the variables to be invariant.
Some studies proposed to incorporate temporal nonstationarity into GWR framework recently to account for the temporal variation. Huang et al.^{11} proposed the geographically and temporally weighted regression (GTWR) model as an extended version of GWR model to integrate both temporal and spatial information into the analysis by treating time as the third dimension in addition to the location and distance in a straightforward manner to calculate the weight. To further address the possible correlation in the cases of regular sampling times, Wu et al.^{12} proposed the geographically and temporally weighted autoregressive model by applying an autoregressive model within the linear function and proposed a twostage least squares estimation method for the model. Fotheringham et al.^{13} pointed out that treating time as the third dimension of location is not entirely appropriate since time and geographical information are measured in different scales. They modified the GTWR model by defining the weight function as a product of two weight functions calculated from temporal and spatial information respectively.
There is an increasing interest in modeling spatial and temporal data especially in public health. Hu et al.^{14} used GWR model to investigate the determinants for the incidence of hand, foot and mouth disease. Lin and Wen^{15} used GWR model to explore the factors that influence the dengue disease incidence. Tsai and Yeh^{16} used GWR model to identify the possible association for scrub typhus disease. As laboratory testing or diagnosis for disease surveillance often generates binary data (e.g. positive or negative for a certain pathogen in the detection assay), logistic regression model for these binary outcome data with spatial and temporal information has particular value study factors driving the presence or absence of the disease. For instance, the geographically weighted logistic regression (GWLR) were considered by Wu et al.^{17} and Zhou et al.^{18}. However, there is no a similar logistic regression model to deal with those disease detection data and considering both the geographical and temporal variation of the correlation.
To this end, we propose a flexible geographically weighted temporally correlated logistic regression (GWTCLR) model as a natural extension of GWLR model for the analysis of binomial spatial and temporal data. It incorporates both spatial and temporal information by introducing the spatiotemporal varying coefficients to the logistic regression model, which accommodates the potential temporal correlation among the observations with flexible choices of correlation structures. For a specific location, we employ local likelihood method to maximize a geographically weighted likelihood with weight related to the geographical relationship in the spatial variant part to obtain the raw estimates for the coefficients. In order to include information from the entire time period, we use smoothing method to attain the refined estimates for any particular location in the temporal variant part. Using this method, we can attain regression coefficients of other closely related locations at any time within the observation period, and hence a plot of the coefficient over time can be constructed to visualize the temporal variation of the coefficient estimates. To accommodate the potential correlation among the longitudinal data with autocorrelation structure as a special case, the concept of tetrachoric correlation proposed by Lecessie and Vanhouwelingen^{19} is adopted in the model. Simulation study and application on real influenza epidemiological data were conducted to assess and demonstrate the robustness and utilization of the proposed method.
Methods
Suppose the data are collected from \(M\) distinct locations, each with a geographical coordinate (u_{ i },v_{ i }) on T_{ i } occasions (for i = 1, …, M). Moreover S_{i,t} samples are collected from location i at the t^{th} occasion (t = 1, …, T_{ i }) with sampling times \(({t}_{1},{t}_{2},\ldots ,{t}_{{T}_{i}})\). Define the observed data pairs as (X_{i,t,j}, Y_{i,t,j}) where Y_{i,t,j} is a binary dependent variable, X_{i,t,j} is a vector of independent variables for j = 1, …, S_{i,t}, and it is assumed that X_{i,t,j} = X_{i,t}. We assume Y_{i,t,j} = 1 if the underlying event of interest is observed and Y_{i,t,j} = 0 otherwise and let
We now assume that the coefficients of the independent variables in the marginal logistic regression model are spatially and temporally nonstationary. That is
where β(u_{ i }, v_{ i }, t) is a vector of regression coefficients.
Temporal Correlation Structure
For a fixed location and time, each sample is assumed to be identical and independently distributed, under condition on their covariates, that is:
The following discussed correlations are correlations conditional on the given the covariates, and we will omit the conditional notations for simplicity.
The tetrachoric correlation approach, proposed by Lecessie and Vanhouwelingen^{19}, is adopted to accommodate the potential association among the binary variables. Additional information for the tetrachoric correlation can be found in Supplementary Methods. Assume a weakly stationary tetrachoric correlated samples within location \(i\) and denote
It is natural to assume a temporally decreasing correlation structure for all locations. In the cases with irregular sampling times, examples are:

(A)
Linear Correlation Structure
$${\rm{corr}}({Y}_{i,{t}_{1},j},{Y}_{i,{t}_{2},k})={c}_{i}({t}_{2}{t}_{1})=\{\begin{array}{cc}1(\frac{{t}_{2}{t}_{1}}{{\rho }_{i}}), & {\rm{if}}\,{t}_{2}{t}_{1} < {\rho }_{i};\\ 0, & {\rm{otherwise}}\end{array},$$(5)where \({\rho }_{i}\) is the temporal correlation parameter.

(B)
Gaussian Correlation Structure
$${\rm{corr}}({Y}_{i,{t}_{1},j},{Y}_{i,{t}_{2},k})={c}_{i}({t}_{2}{t}_{1})=\exp \{{(\frac{{t}_{2}{t}_{1}}{{\rho }_{i}})}^{2}\}.$$(6)In the cases with discrete regular sampling times, a natural choice is

(C)
AR(1) Correlation Structure:
where −1 ≤ ρ_{ i } ≤ 1 is the tetrachoric correlation when temporal distance is 1.
Regardless of the choice of correlation structure, there is only one temporal correlation parameter, namely \({\rho }_{i}\), involved to describe the temporal correlation which can be estimated by maximum likelihood estimation (MLE) principle. However, it is difficult to give an explicit expression of the estimator. Note that this parameter is a scalar and is often constrained in a specific interval that can be estimated easily by fixing the regression parameters at the most updated estimated values.
Model Construction
In this subsection, we will focus on estimating the regression coefficients for location \(i\) at time t. Suppose the temporal correlation parameter \({\rho }_{i}\) is known.
It is natural to assume that the similarity between coefficients from different time points decreases with their temporal distance. Thus, for location i, we define a τnearest temporal set, and we assume all coefficients β are the same within each set. Here τ is a bandwidth which can be chosen by prior knowledge. It should be noted that the choice of τ depends on the smoothing property of β(u_{ i }, v_{ i }, t) related to t. For a large τ, bias may be introduced. However for a small τ, fewer samples may be involved which results in larger variance of the estimator. For time t_{ k }, its τnearest temporal set is defined as
For each Y_{i,t,j}, there is a corresponding latent variable Z_{i,t,j}, with \({Y}_{i,t,j}={1}_{\{{Z}_{i,t,j} < {{\rm{\Phi }}}^{1}({\pi }_{i,t,j})\}}\), where the marginal distribution of Z_{i,t,j}, is a standard normal distribution, denoted by \({\rm{\Phi }}\). Define Y_{i,tk} be a vector with elements Y_{i,t,j} if t ∈ T[t_{ k }], then the elements of Y_{i,tk} are the random variables used to construct the spatiotemporal local likelihood function for the raw estimation of the regression coefficients for location i and time t_{ k }. Let \({{\rm{\Sigma }}}_{i,{t}_{k}}={\rm{corr}}({Y}_{i,{t}_{k}})\) be the corresponding tetrachoric correlation matrix of Y_{i,tk} and \({N}_{i,{t}_{k}}={\rm{\dim }}({Y}_{i,{t}_{k}})\), the length of vector Y_{i,t,k}.
For simplicity, for fixed location i and time t_{ k }, we redefine the elements of \({Y}_{i,{t}_{k}}\) as \({Y}_{1}.{Y}_{2},\ldots \ldots ,{Y}_{{N}_{i,{t}_{k}}}\), the corresponding latent variable \({Z}_{i,{t}_{k}}\) as \(({Z}_{1},{Z}_{2},\ldots \ldots ,{Z}_{{N}_{i,{t}_{k}}})\), and the corresponding independent variable matrix \({X}_{i,{t}_{k}}\) as \(({X}_{1}.{X}_{2},\ldots \ldots ,{X}_{{N}_{i,{t}_{k}}})\). The marginal distribution of \({Y}_{i}\) is specified by a Bernoulli distribution with P(Y_{ i } = 1X_{ i }) = π_{ i } where π_{ i } = (exp(X_{ i }β))/(1 + exp(X_{ i }β)). Then the spatiotemporal local loglikelihood function for location i and time \({t}_{k}\) given the observed vector \({Y}_{i,{t}_{k}}\) is
where \({\phi }_{{N}_{i,{t}_{k}}}\) is the probability density function of multivariate normal distribution with dimension \({N}_{i,{t}_{k}}\), mean 0 and variance \({{\rm{\Sigma }}}_{i,{t}_{k}}\), the lower and upper limits of the integration with respect to \({Z}_{i,k}\) are respectively −∞ and Φ^{−1}(π_{ j }) if \({Y}_{j}=1\); and are Φ^{−1}(π_{ j }) and +∞, respectively if Y_{ j } = 0.
Now, we focus on providing the raw estimate for \(\beta ({u}_{i},{v}_{i},{t}_{k})\), the regression parameter associated with location \(i\) and time \({t}_{k}\). We can attain the spatiotemporal local likelihood for each location at time \({t}_{k}\). Then what we need to do is to assign a weight to each spatiotemporal local loglikelihood defined by equation (9). A variant local likelihood principle is used, noted that this principle is similar to the weighted likelihood introduced in literature^{20}. A geographical weight function is adopted and based on the first law of geography, we believe that near locations have more impact on the estimate, and hence the weight of nearer locations’ local loglikelihoods should be higher. For those distant locations, their impacts are presumably smaller or could even be ignored. Here we adopt the Gaussian distance decaybased weighting function proposed by Brunsdon et al.^{7}. The function is defined as W_{ ij } = exp(−((d_{ ij })/(h))^{2}), where d_{ ij } is the distance between location i and location j and h is the geographical bandwidth parameter. The temporal local loglikelihood function for location \(i\) and time \({t}_{k}\) is
and let \(\hat{b}({u}_{i},{v}_{i},{t}_{k})\) be the raw estimate for \(\beta ({u}_{i},{v}_{i},{t}_{k})\), we have
The spatiotemporal local loglikelihood is rather complicated and difficult to differentiate. Here we use the pseudolikelihood introduced in literature^{19} to approximate the true likelihood, additional information for the pseudolikelihood and its derivative can be found in Supplementary Methods. Therefore, the raw estimate for \(\beta ({u}_{i},{v}_{i},{t}_{k})\) is given by
Since a weakly stationary correlation is assumed, we use samples from the whole period to estimate temporal correlation parameter \(\rho \). As \(\rho \) is constrained in a specific interval, we search \(\rho \) within the region with a predefined step size. We attain the raw estimates for β and calculate the loglikelihoods under different values of \(\rho \), and the ML estimate for \(\rho \) is approximated by the one which gives the highest loglikelihood.
It is noted that the raw estimate \(\hat{b}({u}_{i},{v}_{i},{t}_{k})\) should reflect \(\beta ({u}_{i},{v}_{i},{t}_{k})\) in certain extent. Since we only use samples with sampling time from the \(\tau \)nearest temporal set \(T[{t}_{k}]\), the raw estimate is incomplete. In order to include information from the whole period, we will refine \(\hat{b}({u}_{i},{v}_{i},{t}_{k})\) using the nonparametric local polynomials method^{21}. For the raw estimate of the set of location \(i\),
and let \({\hat{b}}_{m}=({\hat{b}}_{m}({u}_{i},{v}_{i},{t}_{1}),{\hat{b}}_{m}({u}_{i},{v}_{i},{t}_{2}),\ldots \ldots ,{\hat{b}}_{m}({u}_{i},{v}_{i},{t}_{T}))\) be the m^{th} row of \(\hat{b}\). Given a kernel function \(K\), bandwidth \(h\) and order \(p\), we fit \(\hat{b}\) with the time to get the refined estimate \({\hat{\beta }}_{m}({u}_{i},{v}_{i},{\rm{t}})\) for any time \(t\) within the period. We have
where \(\widehat{{\alpha }_{0}},\widehat{{\alpha }_{1}},\ldots \ldots ,\widehat{{\alpha }_{p}}\) minimize
Let \(B\) be the design matrix and \({{\rm{\Omega }}}_{t}\) be a diagonal matrix with diagonal elements \(K(\frac{t{t}_{n}}{h})\), and let B(t) = (1, t^{1}, t^{2}, …, t^{r}), we have the refined estimate of β(u_{ i }, v_{ i }, t) given by
and \(\hat{\beta }({u}_{i},{v}_{i},{\rm{t}})\) is termed the GWTCLR estimator of \(\beta ({u}_{i},{v}_{i},{\rm{t}}).\)
Geographical Bandwidth Selection
The spatial impact and temporal impact are assumed to be independent. Therefore, we first assume no temporal correlation and hence use all samples from the whole period to estimate a geographical bandwidth. A geographically weighted logistic regression (GWLR)^{8} is used, where a Poisson approximation to the binomial distribution can be considered as an alternative, and small sample bias corrected AIC (AICc)^{22} or BIC is used to choose the bandwidth h of the geographical weight function. This procedure can be done in GWR 4.0, which is available for estimating the bandwidth. More discussion about the choice of bandwidth can be found in literature^{8}.
Asymptotic Properties and Covariance
In order to give the covariance of GWTCLR estimator, the asymptotic properties were studied. The raw estimate \(\hat{b}({u}_{i},{v}_{i},{t}_{k})\) for \(\beta ({u}_{i},{v}_{i},{t}_{k})\) which is derived from
where the probability density of \({Y}_{j,{t}_{k}}\) given \(\beta \) is as defined in equation (9) as
Herein, \({E}_{0}\,{\rm{and}}\,Va{r}_{0}\) denote the expectation and variance under the probability space based on the true parameter. Without loss of generality, we focus on location \(i\) and time \({t}_{k}\), and suppose the temporal correlation parameter is known.
We have the following theorems given the necessary assumptions.
Assumption 1.
Let \({f}_{j,{t}_{k}}({Y}_{j,{t}_{k}}\beta ,{X}_{j,{t}_{k}})\) be the probability density of \({Y}_{j,{t}_{k}}\) given β and \({X}_{j,{t}_{k}}\). Assume for all β ∈ B, where B is the open parameter set that contains the true parameter. When the bandwidth of the geographical weight function is small enough, and when β(u_{ i }, v_{ i }, t_{ k }) is smooth related to u_{ i }, v_{ i }, then the following is always true:
Theorem 1.
(Large Sample and Small Bandwidth Asymptotic Consistency). When sample size is large enough and the bandwidth of the geographical weight function is small enough, under assumption 1, score function (dl_{ M }(β))/(dβ) = 0 almost surely has a solution and this solution asymptotically converges to the real parameter in probability.
Proof.
See Supplementary Methods.
Assumption 2.
Let the parameter β be a pdimensional vector, β = (β_{1},β_{2},…,β_{ p })^{T} and suppose the following conditions are always true:

i.
The probability density \({f}_{j,{t}_{k}}({Y}_{j,{t}_{k}}{\beta },{X}_{j,{t}_{k}})\) is twice differentiable with respect to \(\beta \) for every j.

ii.
Let \(\overline{{{\rm{\Sigma }}}_{M}}=\frac{1}{M}Va{r}_{0}(\frac{\partial {\bar{l}}_{i,{t}_{k}}(\beta )}{\partial \beta }{}_{\beta =\beta ({u}_{i},{v}_{i},{t}_{k})})\), by geographically independent, we have
$$\overline{{{\rm{\Sigma }}}_{M}}=\frac{1}{M}\sum _{j=1}^{M}Va{r}_{0}({W}_{ij}\frac{\frac{\partial {f}_{j,{t}_{k}}({Y}_{j,{t}_{k}}\beta ,{X}_{j,{t}_{k}})}{\partial \beta }{}_{\beta =\beta ({u}_{i},{v}_{i},{t}_{k})}}{{f}_{j,{t}_{k}}({Y}_{j,{t}_{k}}\beta ({u}_{i},{v}_{i},{t}_{k}),{X}_{j,{t}_{k}})})\mathop{\to }\limits^{M\to +\infty }{\rm{\Sigma }},$$(20)where \(\Sigma \) is a finite, positive definite matrix.

iii.
For every j, we have:
$$\mathop{\mathrm{lim}}\limits_{M\to +\infty }{(M\overline{{{\rm{\Sigma }}}_{M}})}^{1}Va{r}_{0}({W}_{ij}\frac{\frac{\partial {f}_{j,{t}_{k}}({Y}_{j,{t}_{k}}\beta ,{X}_{j,{t}_{k}})}{\partial \beta }{}_{\beta =\beta ({u}_{i},{v}_{i},{t}_{k})}}{{f}_{j,{t}_{k}}({Y}_{j,{t}_{k}}\beta ({u}_{i},{v}_{i},{t}_{k}),{X}_{j,{t}_{k}})})=0.$$(21) 
iv.
For every \(1\le i < j\le p\) and M > 0, the second order derivative of \({\bar{l}}_{i,{t}_{k}}(\beta )\) satisfies:
and
where I is a finite, positive definite matrix.
Theorem 2.
(Large Sample and Small Bandwidth Asymptotic Normality). When sample size is large enough and the bandwidth of the geographical weight function is small enough, under assumption 1 and assumption 2, the raw estimator of GWTCLR follows a normal distribution asymptotically as follows:
where
Proof.
See Supplementary Methods.
By Theorem 2, asymptotically, we have
By the same method in the proof of Theorem 2
Then we can estimate them by pseudolikelihood as follows
and
Now, for the refined estimate \(\hat{\beta }({u}_{i},{v}_{i},{t}_{k})\), it has the following general expression
where function \(w({t}_{k},{t}_{j})\) is deduced from the nonparametric fit. So we can finally get the variance estimate as
Note that, we point out that this variance estimate is based on large sample and small bandwidth, and we can further give a raw asymptotic 95% confidence interval for \(\beta ({u}_{i},{v}_{i},{t}_{k})\) by
Simulation Studies
Simulation Design
We conducted simulation studies to evaluate the validity of the proposed method. Our simulation contains 3 coefficient functions for two independent variables \({X}_{1},\,{X}_{2}\) and the yintercept. The \({X}_{1}\) is generated from Uniform(−5, 5), \({X}_{2}\) is generated from Uniform(−50, 50). To account for different cases, we set three coefficient functions (a spatiotemporally fixed \({\beta }_{0}\), a spatiotemporally varying \({\beta }_{1}\) and a spatially fixed but temporally varying \({\beta }_{2}\)). For location \((u,v)\) and time t, the varying coefficient functions are
Two data sets, each of size 10 × 10 × 21, are generated regularly on a square grid with arbitrary distance unit. For data set A, location \((u,v)\) ranges from 8.2 to 11.8 with a step size of 0.4 for u and v. For data set B, location \((u,v)\) ranges from −11.8 to −8.2 with a step size of 0.4 for u and v. Time ranges from 1 to 21 with a step size of 1 for data set A and B. For each location \((u,v)\) and time t, we simulate 500 binary data with probability P as
Result
We applied the GWTCLR estimation on the simulated data sets. Because their sample sizes (100 locations for each data set) are large, the \(\tau \) of \(\tau \)nearest temporal set is set 0 to avoid bias. The optimal geographical bandwidth and the kernel function are used. The heatmap of GWTCLR estimates for the coefficient \({\beta }_{1}\) as well as the heatmap of true values for coefficient \({\beta }_{1}\) of data set A are presented in Fig. 1. The two heatmaps are largely consistent with each other, yet bias is present on the geographic boundary. Figure 2 displays the scatter plot of the coefficient \({\beta }_{1}\) estimates against their true values in data set A, the Pearson correlation between estimates and true value is 0.98 (\({\rm{p}} < 0.005\)), indicating a high consistency. While GWTCLR estimates perform well for the locations close to geographical center (colored with blue), bias can be seen for locations on the boundary (colored with red). We further conducted a linear regression analysis of the estimated values for the coefficient \({\beta }_{1}\) and their true values of data set A, the result is given in Table 1. An approximated equality can be achieved when locations’ distance to the geographical center decrease. The bias on the boundary is due to relatively smaller sample size and unevenly distributed neighbors for location on the boundary.
We choose the geographical center of data set A and B, whose location is (10, 10) and (−10, −10) respectively, to show the GWTCLR estimate for coefficient \({\beta }_{0},\,{\beta }_{1}\) and \({\beta }_{2}\) on the temporal domain. Figure 3 displays the true coefficients function (dashed line) and they GWTCLR estimates (solid line) together with the 95% confidence interval. The GWTCLR estimate has successfully captured the temporally varying pattern of all 3 coefficients.
Application to Human Influenza Data
We have implemented the estimation method in Mathematica 11 code (available at http://github.com/idbioinfo/GWTCLR) and applied to a human influenza data set. It has been previously demonstrated that global dynamics of influenza epidemics are determined by the seasonal fluctuation in climatic factors such as temperature, amount of precipitation and relative humidity, and that the relationships between these climatic factors and influenza incidence are significantly different between distantly separated locations^{2}. In this section, by fitting the data to the proposed GWTCLR model, we aim to explore the spatiotemporal variations of the impacts of these climatic factors on the influenza incidence in 2012–2013. Guidelines and codes for replicating the results of this application are provided in Supplementary Codes.
Data
Influenza surveillance data between 3 October 2011 and 30 March 2014 were downloaded from the World Health Organization via FluNet (http://www.who.int/influenza/gisrs_laboratory/flunet/en/). Weekly number of laboratoryconfirmed influenza positive samples and weekly number of specimens processed are used together as binary data, where influenzapositive specimens are coded as 1 and others as 0 and are binned monthly because of the absence of weekly climate data. A total of 22 countries, either from Europe or Southeast Asia, are chosen for analysis because these countries have relatively smaller sizes as only countrylevel data are available, and are considered as temperate and tropical regions that are believed to play distinct roles in human influenza transmission^{2,23}.
Monthly temperature (in degrees Celsius), amount of precipitation (in mm/month) and vapor pressure (in hPa) of the 22 countries were collected from CRUCY v. 3.23 Dataset^{24} between October 2011 and March 2014. Relative humidity is approximated by the ratio of actual vapor pressure and saturate vapor pressure, while saturate vapor pressure is calculated from temperature by Teten’s equation.
The countries’ geographical center coordinates were downloaded from Wolfram Mathematica and hence the geographical distance (unit: kilometer) instead of the Euclidean distance was used in the geographical weight function. We also conducted the separate analysis by replacing the geographical center coordinates with the capital center coordinates of the countries (data not shown). We found that this has little impact to the estimates and conclusion.
We have four parameters including the intercept. The \(\tau \) of \(\tau \)nearest temporal set is set to be 3 and we estimated a 7month average coefficients. To ensure every month of year 2012 and year 2013 has a complete \(\tau \)nearest temporal set, we also include data of OctoberDecember, 2011 and data of JanuaryMarch, 2014.
Results
We first searched the optimal spatial distance bandwidth by using all data and followed the method in Section “Geographical Bandwidth Selection”, we used the GWR 4.0 software with a fixed Gaussian kernel type and “spherical” coordinates. The optimal bandwidth at 1,450 km with an AICc = 43199.570, which presents a “validfit” in the outcome was chosen.
We determined the temporal correlation parameter \({\rho }_{i}\) of each country. Since the sampling interval in this study is regular, we chose the AR(1) autocorrelation structure to account for potential negative correlation. We used all data and assigned a Gaussian distance decaybased function with bandwidth value 1,450 km as the geographical weight function for each country’s likelihood. We calculated the MLE of coefficients under each possible value of \({\rho }_{i}\) with a step size of 0.01, generated the loglikelihood profile, from which the approximate MLE of \({\rho }_{i}\) was identified. For instance, the optimal value of \({\rho }_{i}\) is 0.17 for France (maximum loglikelihood is −124035.5) and 0.19 for Thailand (maximum loglikelihood is −15316.55) (Fig. 4), both suggesting a positive correlation.
We applied our GWTCLR model on all data to estimate the coefficients for each of the 22 countries. Noteworthy, estimations at the time points with insufficient samples were attained by smoothing method. The bandwidth \(h\,\,\)and order \(p\) in the kernel function were selected by plotting the raw estimates \(\hat{b}\) along with refined estimates \(\hat{\beta }\). For instance, \(p\) was set to be 2 and h was 4 for France and 3 for Thailand.
The refined estimates for the coefficients of all countries between 2012 and 2013 are presented in Fig. 5. The result for France is highlighted in Fig. 6a–c for further illustration. It is observed that temperature shows a significantly negative effect on influenza incidence as the 95% confidence interval is almost completely below the zero. Considering that France locates in a high latitude region, this result is consistent with the previous studies either from laboratory evidence^{25} or epidemiologic analysis^{2}. For precipitation, a rather complicated pattern is observed. A negative effect is shown from month 1 to 8 (corresponding to January 2012August 2012, denoted as Period I), no significant difference from zero is shown from month 9 to 21 (corresponding to September 2012September 2013, denoted as Period II) and a positive effect is shown from month 22 to 24 (corresponding to October 2013December 2013, denoted as Period III). There are no previous studies relating to the timevarying effect of precipitation.
We assessed the timevarying correlation of precipitation in France by referring to the raw data of influenzapositive samples and precipitation, as shown in Fig. 7. Three obvious crests of influenzapositive samples are observed at Dec 2011Apr 2012, Dec 2012Apr 2013, and Dec 2013Mar 2014. The first crest corresponded apparently to the substantial valley of precipitation, explaining the significant negative correlation estimated by GWTCLR. The second crest coincided with a much smaller valley of precipitation, also franking by considerably low level of influenza activities but fluctuating precipitation in the summer of 2012 and 2013. This might contribute to the lack of correlation till October 2013. After Oct 2013, it is the third crest of influenza activity concurring with precipitation, which is mainly characterized by their same drops from January to February 2014. These visual results demonstrated that our model could capture the timevarying relationship between dependent and independent variables.
The effect of relative humidity was found insignificant during most period although it showed a negative effect at the end of year 2013. However, previous laboratory studies^{23} have suggested that relative humidity has negative effect on the influenza activity. Two reasons possibly explain this discordance: Firstly, the relative humidity of France between October 2011 and March 2014 did not vary largely (with a relatively small standard deviation 0.074) and it maintained at a high level (with a median 75.84%) that did not provide sufficient variability in the independent variable. Secondly, it has been pointed out that relative humidity is indeed a weaker predictor of influenza activity compared with temperature^{2,25}, so the true effect of relative humidity may be masked by temperature especially when temperature varies more significantly.
The refined estimates of the coefficients in Thailand between 2012 and 2013 are presented in Fig. 6d–f. All these three factors (temperature, precipitation and relative humidity) do not show a significant effect on the influenza activity. Considering the latitude of Thailand is \({15}^{^\circ }N\), this result was consistent with findings by Tamerius et al.^{2} that in middle latitudes between 12.5° and 25° N/S, there was no significant association between climatic variables and influenza peaks. Moreover, the lack of association was also consistent with Deyle et al.^{23} which attributed to the vaguer seasonality in tropical countries.
Spatially distributed coefficients for temperature and precipitation show a clear spatial clustering (Fig. 5). For example, European countries show a similar negative association between influenza activity and temperature, which is selfevident given the regular winter peak of influenza in European countries^{26}. For Southeast Asian countries, although Singapore and Malaysia deviated from others with quite high coefficients of temperature, none of the coefficient estimates are considered significant because their confidence intervals cover zero. In terms of the association between influenza activity and precipitation, European countries like France show an initial negative association, transiting to a positive association at the end of study period, which is also supported by visual inspection of the data (Fig. 7). Southeast Asian countries remain nonsignificant throughout 2012–2013, which is consistent with the previous report of weak causality^{2}. Overall, our GWTCLR model managed to identify the spatially and temporally varying relationships between influenza disease incidence and climatic variables.
Discussions
In this paper, we propose a geographically weighted temporally correlated logistic regression model (GWTCLR) that is designated for binary outcome data such as disease detection results from public health surveillance. This model integrates the geographically weighted logistic regression (GWLR) model^{8} and twostep estimation approach^{6}, to deal with spatial and temporal nonstationarity simultaneously. We showed the asymptotic properties of the proposed estimator. We also provided a way to estimate the asymptotic covariance under some regularity conditions. Our model is implemented and applied to the regional influenza detection results published by WHO FluNet. GWTCLR obtained consistent conclusions with previous studies, while also revealed the temporal change of association between disease prevalence and climates that could not be shown in previous studies that were unable to accommodate the temporal and spatial nonstationarities simultaneously. Furthermore, it is noteworthy that, unlike the previous temporal and geographical linear regression model^{11}, our GWTCLR also accounts for possible temporal correlation of the longitudinal data.
Our GWTCLR model is an extension of two commonly used models in literature^{6,8}, and can be easily reduced to previous models and other variant models by a simple specification of some parameters. For example, if we assume all samples are independent, then by setting \({\rm{corr}}({Y}_{i,{t}_{1},j},{Y}_{i,{t}_{2},k})=0\), GWTCLR is reduced to GWTLR. If we further assume coefficients are temporally invariable, then by setting \(\tau \) large enough so as to use all samples from the whole time period, GWTCLR is further reduced to GWLR. The same idea applies to the spatial component, by setting an extremely large bandwidth in the geographical weight function, all weights are forced to be equal, the estimation approach reduces to the twostep estimation approach.
An interesting and useful prospect of GWTCLR is that, if a large number of samples is collected from locations that sufficiently spread over a specific region, we can estimate the coefficients at any coordinates within that region and at any time point of the whole period. Therefore, a throughtime animation of geographic heatmap showing the coefficient estimates at every location can be constructed. This can help users to visualize the temporally and spatially varying magnitudes and directions of the predictor’s impacts on the outcomes in an intuitive and comprehensive manner. However, drawing such heatmaps over the time requires relatively larger sampling sizes, coverages and frequencies, as well as computational time. Further research can investigate how the application of GWTCLR could be benefited by better sampling techniques and more efficient inference algorithms.
Several limitations of GWTCLR should be highlighted for future investigation. First, the asymptotic normality test could be studied further, for example, with different sample sizes. Second, we assume a weakly stationary tetrachoric correlation structure to reduce the number of temporal correlation parameters, but the temporal correlation may vary at different times, which could be accommodated by an adaptive correlation structure. Third, a spatiotemporally constant geographical bandwidth was assumed in order to simplify the model, yet this may not be appropriate as the localization of association pattern for different places is likely not constant, and such localization may also change with time. We believe that future research should address this issue, allowing the geographical bandwidth to be dynamic. Fourth, while GWTCLR is an extension of logistic regression model, similar extension may be possible for other generalized linear models.
References
 1.
Hastie, T. & Tibshirani, R. Varyingcoefficient models. J Roy Stat Soc B, 757–796 (1993).
 2.
Tamerius, J. D. et al. Environmental Predictors of Seasonal Influenza Epidemics across Temperate and Tropical Climates. Plos Pathog 9 (2013).
 3.
Fan, J. Q. & Zhang, J. T. Twostep estimation of functional linear models with applications to longitudinal data. J Roy Stat Soc B 62, 303–322 (2000).
 4.
Cai, Z. W., Fan, J. Q. & Li, R. Z. Efficient estimation and inferences for varyingcoefficient models. J Am Stat Assoc 95, 888–902 (2000).
 5.
Senturk, D., Dalrymple, L. S., Mohammed, S. M., Kaysen, G. A. & Nguyen, D. V. Modeling timevarying effects with generalized and unsynchronized longitudinal data. Stat Med 32, 2971–2987 (2013).
 6.
Dong, J., Estes, J. P., Li, G. & Senturk, D. A twostep estimation approach for logistic varying coefficient modeling of longitudinal data. J Stat Plan Infer 174, 38–51 (2016).
 7.
Brunsdon, C., Fotheringham, A. S. & Charlton, M. E. Geographically weighted regression: A method for exploring spatial nonstationarity. Geogr Anal 28, 281–298 (1996).
 8.
Fotheringham, A. S., Brunsdon, C. & Charlton, M. Geographically weighted regression: the analysis of spatially varying relationships. (Wiley, 2002).
 9.
Tobler, W. R. A computer movie simulating urban growth in the Detroit region. Economic geography 46, 234–240 (1970).
 10.
Nakaya, T., Fotheringham, A. S., Brunsdon, C. & Charlton, M. Geographically weighted Poisson regression for disease association mapping. Stat Med 24, 2695–2717 (2005).
 11.
Huang, B., Wu, B. & Barry, M. Geographically and temporally weighted regression for modeling spatiotemporal variation in house prices. Int J Geogr Inf Sci 24, 383–401 (2010).
 12.
Wu, B., Li, R. R. & Huang, B. A geographically and temporally weighted autoregressive model with application to housing prices. Int J Geogr Inf Sci 28, 1186–1204 (2014).
 13.
Fotheringham, A. S. & Crespo, R. & Yao. J. Geographical and Temporal Weighted Regression (GTWR). Geogr Anal 47, 431–452 (2015).
 14.
Hu, M. G. et al. Determinants of the Incidence of Hand, Foot and Mouth Disease in China Using Geographically Weighted Regression Models. Plos One 7 (2012).
 15.
Lin, C. H. & Wen, T. H. Using Geographically Weighted Regression (GWR) to Explore Spatial Varying Relationships of Immature Mosquitoes and Human Densities with the Incidence of Dengue. Int J Env Res Pub He 8, 2798–2815 (2011).
 16.
Tsai, P. J. & Yeh, H. C. Scrub typhus islands in the Taiwan area and the association between scrub typhus disease and forest land use and farmer population density: geographically weighted regression. Bmc Infect Dis 13 (2013).
 17.
Wu, L. et al. Spatial Analysis of Severe Fever with Thrombocytopenia Syndrome Virus in China Using a Geographically Weighted Logistic Regression Model. Int J Env Res Pub He 13 (2016).
 18.
Zhou, Y. B. et al. Geographical variations of risk factors associated with HCV infection in drug users in southwestern China. Epidemiol Infect 144, 1291–1300 (2016).
 19.
Lecessie, S. & Vanhouwelingen, J. C. LogisticRegression for Correlated BinaryData. Appl StatJ Roy St C 43, 95–108 (1994).
 20.
Staniswalis, J. G. The Kernel Estimate of a Regression Function in LikelihoodBased Models. J Am Stat Assoc 84, 276–283 (1989).
 21.
Fan, J. & Gijbels, I. Local polynomial modelling and its applications. 1st edn, (Chapman & Hall, 1996).
 22.
Hurvich, C. M., Simonoff, J. S. & Tsai, C. L. Smoothing parameter selection in nonparametric regression using an improved Akaike information criterion. J Roy Stat Soc B 60, 271–293 (1998).
 23.
Deyle, E. R., Maher, M. C., Hernandez, R. D., Basu, S. & Sugihara, G. Global environmental drivers of influenza. P Natl Acad Sci USA 113, 13081–13086 (2016).
 24.
Harris, I., Jones, P. D., Osborn, T. J. & Lister, D. H. Updated highresolution grids of monthly climatic observations  the CRU TS3.10 Dataset. Int J Climatol 34, 623–642 (2014).
 25.
Lowen, A. C., Mubareka, S., Steel, J. & Palese, P. Influenza virus transmission is dependent on relative humidity and temperature. Plos Pathog 3, 1470–1476 (2007).
 26.
Cox, N. J. & Subbarao, K. Global epidemiology of influenza: Past and present. Annu Rev Med 51, 407–421 (2000).
Acknowledgements
The project described was supported by Themebased Research Scheme (T11705/14N) from University Grants Committee of the HKSAR, and Award Number U54GM088558 from the National Institute of General Medical Sciences. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institute of General Medical Sciences or the National Institutes of Health.
Author information
Affiliations
Contributions
Y.L. and T.T.Y.L. conceived the method and study. Y.L. and K.F.L. developed the model and programming codes. Y.L. and T.T.Y.L. conducted the data analysis and wrote the manuscript, Y.L., K.F.L., J.T.W. and T.T.Y.L. contributed in the revision of the manuscript.
Corresponding author
Ethics declarations
Competing Interests
The authors declare that they have no competing interests.
Additional information
Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Electronic supplementary material
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Liu, Y., Lam, KF., Wu, J.T. et al. Geographically weighted temporally correlated logistic regression model. Sci Rep 8, 1417 (2018). https://doi.org/10.1038/s41598018197726
Received:
Accepted:
Published:
Further reading

Geographically Weighted Method Integrated with Logistic Regression for Analyzing Spatially Varying Accuracy Measures of Remote Sensing Image Classification
Journal of the Indian Society of Remote Sensing (2021)

Housing price variations using spatiotemporal data mining techniques
Journal of Housing and the Built Environment (2021)

SpatialTemporal Analysis of Injury Severity with Geographically Weighted Panel Logistic Regression Model
Journal of Advanced Transportation (2019)

Considering spatiotemporal processes in big data analysis: Insights from remote sensing of land cover and land use
Transactions in GIS (2019)

Examining the spatially varying effects of factors on PM2.5 concentrations in Chinese cities using geographically weighted regression modeling
Environmental Pollution (2019)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.