# Logistic regression on clustered presence observations

Edit 4/5/16: added example As a simplified example, in social science surveys a single household may provide 1 to $n$ responses to a questionnaire (assume a single question); say $n = 5$. I have read that this is often handled by taking the mean response of the household or perhaps by taking the head-of-house hold response as representative. For my example, I want to use all household responses as data points, address intra-household correlation, and $n$ may be in the thousands. Further, making the household a HMM group may not be useful, because each house is unique and I will not be predicting for that house in the future.

Motivation: I want to treat the measurements of each $X$ variable within a cluster $k_i$ as a continuous distribution and not an independent observation. Treating it as a distribution is intuitively more consistent with natural processes being measured. In my field, this problem is most often addressed by aggregating all measures of $X_n$ within group $k_i$ as a mean of $X_n$ or calculating the geographic centroid of $k_i$ and using that single point measurement to represent all of $X_n$. Both approaches are unappealing because neither represents the variation of $X_n$ within $k_i$.

Data: The structure of these data is nearly the same as is typical for logistic regression with observed presence and absence $Y_1\dots Y_i$ where $Y_i\in\{1,0\}$ modeled by covariates $X_1\dots X_n$ where $X_{ni}\in\mathbb{R}$, plus $\epsilon$. However, in this case $Y_i,X_i$ is a part of a group $(k_1\dots k_n)$ where $Y_{ik_n} = 1$ and for a single dependent variable $X_{ik_n}\dots X_{nk_n}$ each take on a value $X_{ik_n}\in\mathbb{R}$. The cases of absence $Y_i = 0$ are not from a group and can be represented as point observations. Simply, each presence observation comes from a group where the presence $Y$ within the group is consistently $1$ and the value of each dependent variable $X_n$ range within the group, where the absence observations are not grouped.

Data Example: The data described above are generated through spatial clustering of presence observations. Each group or cluster $(k_i\dots k_n)$ is known as a "loci" and can take on an arbitrary shape and size (typically ovoid and on the order of 1 to 100 acres). At each loci a series of environmental variables are measured at a regular interval grid (typically 3 to 30 meter interval). For each variable $X$ and each sample $i\dots n$ within a given $k_i$, the total $n$ can range from 4 to over 100,000. This is multiplied for each $X$ in $X_i \dots X_n$ (typically 2 to 100). The absence measures are taken as randomly distributed and non clustered point measures.

Potential Methods:

1. Mixed or Hierarchical models. The observations from each group $k$ are modeled to understand group effects

2. Spatial structure. CAR or SAR models that account of the covariance structure of grouped observations via a distance matrix. Can be combined with other methods

3. Regression over functions. e.g. scalar-on-function regression where the dependent variables are treated as functions

4. Geostatistical approaches. e.g. Kriging or Gaussian Process where presence/absence is treated as a continuous function.

5. Ignorance of structure. Model each observation as i.i.d

Issues with those methods

1. Best approach I have come up with, but can be very slow when dealing with large clusters, especially if attempted with Stan (MCMC). Additionally, the groups themselves are not particularity of interest and are known to have relatively high inter-group variance. Further, I do not want to predict on the same groups in the future.

2. Again not very scalable and many applications are with areal data with clustered point observations aggregated into areal units. However, the use of distance or VCV matrices to account for spatial structure makes a lot of sense.

3. While typically used in time series, I have read about these in a spatial context. However, I think it would require multi-directional functions as the covariates vary in all directions. I have seen examples of medical imagery computing functions over transects that radiate out from a centroid.

4. The distribution of presence/absence is not an inherently spatial process in this case. It is assumed that the spatial distribution of loci are independent and non-continuous, but related to the underlying environment. If a cluster of loci exist, it should not be assumed that there is a higher likelihood of unidentified loci in the same area specifically because of the proximity to known loci.

5. Ignoring the spatial structure leads to inflated parameter estimates and possibly over-fitting. It is simple to model this way, but these observations are clearly not i.i.d

Disclaimer
I wish I had a more concise way to ask this question. I hope my notation does not make it more complicated than necessary. The answer very well may be "That is what a mixed more with spatial weights is doing dummy."; and that is totally fine. Thank you for any input of direction you may have to offer.