# Create a precision matrix and get desired covariance matrix

I am trying to build a Gaussian graphical model for a simulation.

I want to achieve the following:

1. Simulate an undirected graph structure (Markov network). Take nodes as variables and edges as dependence relationships that exist between two variables that persists after conditional on all other variables (strong dependence, or conditional dependence).
2. Each edge has a partial correlation value. Fix each value to a.
3. Create a precision matrix by assigning a to the off diagonal elements corresponding to edges, assign 0 to the other off-diagonal edges, and adjusting the on diagonal elements such that the matrix is positive semidefinate.
4. Simulate MVN data from the precision matrix.

The way I create my precision matrix is to take the adjacency matrix, manually change the 1's to partial correlations, turn the diagonals to 0s, find the minimum of the eigenvalues of the resulting matrix, then reset the values on the diagonal to the absolute value of the lowest eigenvalue plus a little extra. This makes all the eigenvalues of the resulting matrix positive.

However, I'd like to make it so that I can make the resulting covariance matrix have 1 on the diagonal. I suspect this takes further manipulation of the eigenvalues. Anyone know how to do this?