View source: R/Markovchart_functions_20220203.r
plot.Markov_grid | R Documentation |
Markov_grid
control chart results.
Convenience function for plotting G-values in a contour plot as the function of the time between samplings and the critical value.
## S3 method for class 'Markov_grid' plot( x, y = expression(atop(italic("G")*-value~per, unit~time)), xlab = "Time between samplings", ylab = "Critical value", low = "white", mid = "#999999", high = "black", colour = "white", nbreaks = 16, ...)
x |
A |
y |
The name of the scale. |
xlab |
A title for the x axis. |
ylab |
A title for the x axis. |
low |
Colour for the low end of the gradient. |
mid |
Colour for the midpoint. |
high |
Colour for the high end of the gradient. |
colour |
Colour of the contour lines. |
nbreaks |
Number of contour breaks. Uses |
... |
Further arguments to be passed down to |
A plot object of class gg
and ggplot
produced using the ggplot2
package.
The plot itself is made using the package ggplot
by Hadley Wickham et al. The text on the contour lines is added with the geom_text_contour
function from the package metR
by Elio Campitelli.
Balazs Dobi and Andras Zempleni
Zempleni A, Veber M, Duarte B and Saraiva P. (2004) Control charts: a cost-optimization approach for processes with random shifts. Applied Stochastic Models in Business and Industry, 20(3), 185-200.
Dobi B and Zempleni A. (2019) Markov chain-based cost-optimal control charts for health care data. Quality and Reliability Engineering International, 35(5), 1379-1395.
Dobi B and Zempleni A. (2019) Markov chain-based cost-optimal control charts with different shift size distributions. Annales Univ. Sci. Budapest., Sect. Comp., 49, 129-146.
Markovchart
Markovstat
#Defining parallel_opt parallel settings. #parallel_opt can also be left empty to be defined automatically by the function. require(parallel) num_workers <- min(c(detectCores(),2)) #Exponential shift - default cost functions. stat_exp <- Markovstat(shiftfun="exp", h=1, k=1, sigma=1, s=0.2, delta=2, RanRep=TRUE, alpha=1, beta=3, Vd=30, V=18) parall <- list(cl=makeCluster(num_workers), forward=FALSE, loginfo=TRUE) Gmtx <- Markovchart(statdist=stat_exp, h=seq(1,10,by=(10-1)/5), k=seq(0.1,5,by=(5-0.1)/5), p=0.9, cs=1, coparams=c(10,3), crparams=c(1,2), vcoparams=c(8,1.5), vcrparams=c(5,2), V=18, parallel_opt=parall) plot(Gmtx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.