estimate precision matrix with given spatial sparsity pattern I have a set of $n$ measurements of $p$ variables $\xi_i$. I am interested in the inverse covariance or precision matrix $P$ of the variables, but because $p \gg n$ and because of limited storage ($p$ can be on the order of several 100,000), I would like to constrain the precision matrix to a given sparsity pattern.
In particular, the variables are associated with positions $(x_i, y_i, z_i)$, and I would like the precision matrix to have non-zero entries only for pairs of variables $(i, j)$ with
$$
\sqrt{ (x_i - x_j)^2 + (y_i - y_j)^2 + (z_i - z_j)^2 } <= r.
$$
Is there a method to estimate such a precision matrix with a given sparsity pattern? I'm aware of the graphical lasso and other methods of sparse precision estimation, but as far as I know they infer the sparsity pattern from the data.
As a second part of the question, would it be possible to apply the same sparsity constraint instead to a matrix $W$ of the same size as $P$, such that $P = W' W$? This matrix would be used to "whiten" or decorrelate the variables.
 A: You may exchange the penalty in the graphical Lasso by a constraint given by your wanted sparsity pattern.
The graphical Lasso is given by
$\hat{\Theta} = \text{argmin}_{\Theta \ge 0} \left(\text{Tr}(S \Theta) - \log \det(\Theta) + \lambda \sum_{j \ne k} |\Theta_{jk}| \right)$
where the constraint $\Theta\ge 0$ means that $\Theta$ is psd. Instead you could solve the optimization problem
$\hat{\Theta} = \text{argmin}_{\Theta \ge 0, \Theta_{ij}=0 \text{ for }(i,j)\in A} \left(\text{Tr}(S \Theta) - \log \det(\Theta)  \right)$
where $A$ is a subset of $\{1,...,p\}\times\{1,...,p\}$ of entries you would like to force to 0. For instance you may use the argument penalizeMatrix in http://sachaepskamp.com/qgraph/reference/EBICglasso.html
Another option is to use, for some very large $\lambda$,
$\hat{\Theta} = \text{argmin}_{\Theta \ge 0} \left(\text{Tr}(S \Theta) - \log \det(\Theta) + \sum_{i,j} \Lambda_{i,j}|\Theta_{ij}|   \right)$
so that only the entries in $A$ are penalized. This last form is implemented in
skggm in python https://skggm.github.io/skggm/tour where you can set the argument lam=... as a $p\times p$ matrix, with large elements for entries you want to penalize, and entries equal to 0 where you do not want to penalize.
