Description Usage Arguments Details Author(s) See Also Examples

Function aiding the visual inspection of the fit of an estimated (possibly regularized) precision matrix vis-a-vis the sample covariance matrix.

1 | ```
evaluateSfit(Phat, S, diag = FALSE, fileType = "pdf", nameExt = "", dir = getwd())
``` |

`Phat` |
(Regularized) estimate of the precision |

`S` |
Sample covariance |

`diag` |
A |

`fileType` |
A |

`nameExt` |
A |

`dir` |
A |

The function outputs various visualizations to aid the visual inspection of an estimated and possibly regularized
precision matrix vis-a-vis the sample covariance matrix. The inverse of the estimated precision matrix `P`

is taken
to represent the estimated covariance matrix. The function then outputs a QQ-plot and a heatmap of the observed covariances
against the estimated ones. The heatmap has the estimated covariances as lower-triangular elements and the observed covariances
as the upper-triangular elements. The function outputs analogous plots for the estimated and observed correlations. In case the
observed covariance matrix `S`

is non-singular also a QQ-plot an a heatmap are generated for the estimated and observed
partial correlations.

The function generates files with extension `fileType`

under default output names. These files are stored in the directory
`dir`

(default is the working directory). To avoid overwriting of files when working in a single directory one may employ
the argument `nameExt`

. By using `nameExt`

the default output names are extended with a character of choice.

Wessel N. van Wieringen, Carel F.W. Peeters <[email protected]>

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
## Not run:
## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
Cx <- covML(X)
## Obtain regularized precision matrix
P <- ridgeP(Cx, lambda = 10, type = 'Alt')
## Evaluate visually fit of regularized precision matrix vis-a-vis sample covariance
evaluateSfit(P, Cx, diag = FALSE, fileType = "pdf", nameExt = "test")
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.