plotMatrix {LaplacesDemon} | R Documentation |

## Plot a Numerical Matrix

### Description

This function plots a numerical matrix, and is often used to plot the following matrices: correlation, covariance, distance, and precision.

### Usage

```
plotMatrix(x, col=colorRampPalette(c("red","black","green"))(100),
cex=1, circle=TRUE, order=FALSE, zlim=NULL, title="", PDF=FALSE, ...)
```

### Arguments

`x` |
This required argument is a numerical matrix, or an
object of class |

`col` |
This argument specifies the colors of the circles. By
default, the |

`cex` |
When |

`circle` |
Logical. When |

`order` |
Logical. This argument defaults to |

`zlim` |
When |

`title` |
This argument specifies the title of the plot, and the
default does not include a title. When |

`PDF` |
Logical. When |

`...` |
Additional arguments are unused. |

### Details

The `plotMatrix`

function produces one of two styles of plots,
depending on the `circle`

argument. A `K \times K`

numeric matrix of `K`

parameters or variables is plotted. The plot
is a matrix of the same dimensions, in which each element is colored
(and sized, when `circle=TRUE`

) according to its value.

Although `plotMatrix`

does not provide the same detail as a
numeric matrix, it is easier to discover elements of interest
according to color (and size when `circle=TRUE`

).

The `plotMatrix`

function is not inherently Bayesian, and does
not include uncertainty in matrices. Nonetheless, it is included
because it is a useful graphical presentation of a numeric matrices,
and is recommended to be used with the posterior correlation matrix in
an object of class `posteriorchecks`

.

When `x`

is an object of class `bayesfactor`

, matrix
`B`

is plotted. When `x`

is an object of class
`demonoid`

(if it is a matrix), `iterquad`

, `laplace`

,
`pmc`

, or `vb`

, the covariance matrix `Covar`

is
plotted. When `x`

is an object of class `posteriorchecks`

,
the posterior correlation matrix is plotted.

This is a modified version of the `circle.corr`

function
of Taiyun Wei.

### Author(s)

Taiyun Wei

### See Also

### Examples

```
library(LaplacesDemon)
### Although it is most commonly used with an object of class
### posteriorchecks, it is applied here to a different correlation matrix.
data(mtcars)
plotMatrix(cor(mtcars), col=colorRampPalette(c("green","gray10","red"))(100),
cex=1, circle=FALSE, order=TRUE)
plotMatrix(cor(mtcars), col=colorRampPalette(c("green","gray10","red"))(100),
cex=1, circle=TRUE, order=TRUE)
```

*LaplacesDemon*version 16.1.6 Index]