The functions plot/tabulate the posterior distribution of trajectories of net migration rates for a given location, or for all locations, including their median and given probability intervals.
mig.trajectories.plot(
mig.pred,
country,
pi = c(80, 95),
nr.traj = 50,
mark.estimation.points = FALSE,
xlim = NULL,
ylim = NULL,
type = "b",
xlab = "Year",
ylab = "Migration rate",
main = NULL,
lwd = c(2, 2, 2, 2, 1),
col = c("black", "green", "red", "red", "#00000020"),
show.legend = TRUE,
add = FALSE,
scale = FALSE,
...
)mig.trajectories.plot.all(
mig.pred,
output.dir = NULL,
output.type = "png",
verbose = FALSE,
...
)
mig.trajectories.table(mig.pred, country, pi = c(80, 95), ...)
No return value.
Prediction object of class bayesMig.prediction.
Name or numerical code of a location. If it is a country, it can also be given as ISO-2 or ISO-3 characters.
Probability interval (as percentage) to be included in the output. It can be a single number or a vector.
Number of trajectories to be plotted. If NULL, all trajectories are plotted, otherwise they are thinned evenly.
Logical. If TRUE, points that were not used in the estimation are shown in a lighter color.
Graphical parameters passed to the plot function.
Main title for the plot(s). In mig.trajectories.plot.all any occurrence of the string
“XXX” is replaced by the name of the appropriate country.
Vector of five elements giving the line width and color for: 1. observed data, 2. imputed values, 3. median, 4. quantiles, 5. trajectories.
Logical controlling whether a legend should be drawn.
Logical controlling whether the trajectories should be plotted into a new graphic
device (FALSE) or into an existing device (TRUE). One can use this argument to plot
trajectories from multiple countries into one graphics.
Logical. If TRUE, values are scaled to be “per population”, i.e.
they are divided by pop.denom passed to run.mig.mcmc.
Additional graphical parameters. In addition, for mig.trajectories.plot.all
any of the arguments of tfr.trajectories.plot can be passed here.
Directory into which resulting plots are written. By default, the plots are saved into directory sim.dir/predictions/migTrajectories.
Type of the resulting plot files. Can be "png", "pdf", "jpeg", "bmp", "tiff", or "postscript".
Logical value. Switches log messages on and off.
mig.trajectories.plot plots posterior distribution of trajectories of net migration
rates for a given location. mig.trajectories.table gives the same output as a table.
mig.trajectories.plot.all creates a set of graphs (one per location) that are stored in
output.dir.
The median and given probability intervals are computed using all available trajectories.
Thus, nr.traj does not influence those values - it is used only to control the number
of trajectories in the graphs.
mig.predict, summary.bayesMig.prediction