conv.plot {mvnimpute}R Documentation

Convergence plot function

Description

Draws convergence plot for the simulated parameter values of all variables.

Usage

conv.plot(
  data.mat,
  start,
  end,
  x.lab = "Iteration number",
  y.lab = "Simulated values",
  title = NULL
)

Arguments

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.

Details

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.

Value

The plot of simulated values across iterations.

Examples


### 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")


[Package mvnimpute version 1.0.1 Index]