| conv.plot | R Documentation |
Draws convergence plot for the simulated parameter values of all variables.
conv.plot( data.mat, start, end, x.lab = "Iteration number", y.lab = "Simulated values", title = NULL )
data.mat |
data matrix including the simulated values. |
start |
the number of cycle to start. |
end |
the number of cycle to end. |
x.lab |
label of the x axis in the generated plot, default is set to "Iteration number". |
y.lab |
label of the y axis in the generated plot, default is set to "Simulated values". |
title |
title of each generated plot. |
The function generates the trace plot of simulated values across iterations.
iter can be any number of iterations you want to draw, the corresponding number of rows
of the data is iter + 1.
The plot of simulated values across iterations.
### generate some data
dat <- MASS::mvrnorm(n = 1000, mu = c(1, 2, 3, 4), Sigma = diag(4))
### set column names
colnames(dat) <- paste0("Var ", 1:ncol(dat))
### convergence plot: select samples from 500 to 1000 rows
conv.plot(data.mat = dat[500:1000, ], start = 500, end = 1000, title = "Random Variables")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.