Plots model implied regression strengths at specified times for continuous time models fit with ctStanFit.
ctStanDiscreteParsPlot(
x,
indices = "all",
add = FALSE,
legend = TRUE,
polygon = TRUE,
gg = TRUE,
plot = TRUE,
quantiles = c(0.025, 0.5, 0.975),
times = seq(0, 10, 0.1),
latentNames = "auto",
lwdvec = "auto",
colvec = "auto",
ltyvec = "auto",
plotcontrol = list(ylab = "Value", xlab = "Time interval", main =
"Regression coefficients", type = "l", xaxs = "i"),
grid = FALSE,
legendcontrol = list(x = "topright", bg = "white"),
polygonalpha = 0.1,
polygoncontrol = list(steps = 20)
)
list object returned from ctStanDiscretePars
.
Either a string specifying type of plot to create, or an n by 2 matrix specifying which indices of the output matrix to plot. 'AR' specifies all diagonals, for discrete time autoregression parameters. 'CR' specifies all off-diagonals,for discrete time cross regression parameters. 'all' plots all AR and CR effects at once.
Logical. If FALSE, a new plot is generated, if TRUE, specified plot/s are overlayed on existing plot.
Logical. If TRUE, generates a legend.
Logical. If TRUE, fills a polygon between the first and last specified quantiles.
Logical -- use GGplot2 or not? if TRUE, other graphical parameters are ignored, and the ggplot object is returned and may be modified further.
Logical. Only relevant with gg=TRUE.
numeric vector of length 3, with values between 0 and 1, specifying which quantiles to plot. The default of c(.05,.5,.95) plots 95% credible intervals and the posterior median at 50%.
Numeric vector of positive values, discrete time parameters will be calculated for each.
Vector of character strings denoting names for the latent variables. 'auto' just uses eta1 eta2 etc.
Either 'auto', or a vector of positive integers denoting line widths for each quantile. 'auto' specifies c(1,3,1) if there are 3 quantiles to be plotted (default), otherwise simply 3.
Either 'auto', or a vector of color values denoting colors for each index to be plotted.
'auto' generates colors using the grDevices::rainbow
function.
Either 'auto', or a vector of line type integers (as for the lty parameter normally) denoting line types for each quantile. 'auto' specifies c(3, 1, 3) if there are 3 quantiles to be plotted (default), otherwise simply 1.
list of arguments to pass to plot function. The following arguments are ignored: ylim,lwd,lty,col,x,y.
Logical. Plot with a grid?
list of arguments to pass to legend function. 'legend=' and 'text.col=' arguments will be ignored.
Numeric between 0 and 1 to multiply the alpha (transparency) of colvec by for the fill polygon.
list of arguments to pass to ctPoly function (if polygon=TRUE). x,y, and col arguments will be ignored. Steps specifies the number of polygons to overlay to create a graduated transparency. Set to 1 for a flat looking plot.
# NOT RUN {
if (!exists("ctstantestfit")) example(ctstantestfit)
x <- ctStanDiscretePars(ctstantestfit)
ctStanDiscreteParsPlot(x, indices='CR')
#to modify plot:
g <- ctStanDiscreteParsPlot(x, indices='CR',plot=FALSE) +
ggplot2::labs(title='My ggplot modification')
print(g)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab