Description Usage Arguments Details Value Author(s) References Examples
Computes the radii of the inner, middle and outer disks in a ‘medal plot’.
1 |
Q |
sparse or dense precision matrix of the Gaussian random field |
Qo |
sparse or dense precision of the observation error |
A |
sparse or dense matrix mapping the observations |
subset |
a vector identifying which of the rows in |
Sigma_part |
(optional) the partial or full posterior covariance matrix |
xsamp |
(optional) an |
The medal plot is a visualisation tool for large-scale latent Gaussian models of the form Z = AX + e
where Z
are the observations, A
is a mapping matrix, X
is the collection of hidden states and
e
is the additive noise with variance T
. The medal plot reveals the relation of the uncertainty of the update on linear combinations
of Y = LX
(where Y
is a subet of the rows of A
) with respect to the observation uncertainty T
and the prior uncertainty Var(X)
.
The medal also highlights the effect of the field's dependence structure on uncertainty reduction. The plot consists of a set of concentric disks with the following properties:
The radius of the outer disk is proportional to either the square root of the observation variance T
or the prior variance
Var(X)
, whichever is the smaller (note that the lower of these two is a lower bound for the posterior variance in a pure Gaussian system).
The colour of the outer disk is blue if the disk represents the observation uncertainty, red the prior uncertainty.
The radius of the middle disk (in white), corresponding to Var(Yi | Zi)
. i.e. the uncertainty on Yi
if only Zi
were present (or, alternatively, there was no dependence structure in X
).
The inner disk is proportional to the updated variance Var(Y|Z)
and is gold in colour.
A data frame with five fields, r1
: the radius of the outer disk, r2
: the radius of the middle disk, r3
: the radius of the inner disk, col_outer
: the colour of the outer disk and col_inner
: the colour of the inner disk.
Andrew Zammit-Mangion and Jonathan C. Rougier
Jonathan C. Rougier, Andrew Zammit-Mangion and Nana Schoen (2014). Visualisation for large-scale Gaussian updates. http://www.maths.bris.ac.uk/~MAZJCR/rougierVLSGU.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ### Define the Matern function
Matern <- function(r=0:100,nu=3/2,var=1,kappa=0.1) {
K <- var/((2^(nu-1))*gamma(nu))*(kappa*abs(r))^nu*besselK(kappa*abs(r),nu=nu)
diag(K) = var
return(K) }
### Construct a valid covariance matrix on a grid of 20 cells
n <- 20
s <- 1:n
S <- Matern(as.matrix(dist(s)), nu = 3/2,var=4, kappa = 0.1)
Q <- chol2inv(chol(S))
### Observations and mapping matrix
sy <- 1:n
sigmav <- rep(1,n)
Qo <- diag(1/sigmav^2)
ny <- length(sy)
A <- diag(rep(1,n))
### Medal plot function
M <- medalplot(Q=Q,Qo=Qo,A=A)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.