Description Usage Arguments Functions Examples
Plot stochastic results. PlotStochastic takes a long table, and PlotMatStochastic takes short table or matrix.
1 2 3 4 5 6 7 8 9 10 11 | PlotStochastic(x, ys, col.f = blue.f, q1 = c(0.05, 0.95), q2 = c(0.25,
0.75), add = FALSE, ylim = NULL, ...)
PlotMatStochastic(x, ys, col.f = blue.f, q1 = c(0.05, 0.95), q2 = c(0.25,
0.75), ylim = NULL, add = FALSE, na.rm = FALSE, ...)
Plot2Stochastics(x, y1, y2, col1.f, col2.f, qs = c(0.05, 0.95), ylim = NULL,
...)
Plot2MatStochastics(x, ys1, ys2, col1.f, col2.f, qs = c(0.05, 0.95),
ylim = NULL, ...)
|
x |
x An array of x variable. |
ys |
An array or matrix of y variables. |
col.f |
Color function with transparency index. |
q1 |
An array of quantiles. Default set as c(0.05,0.95). |
q2 |
An array of quantiles. Default set as c(0.25, 0.75). |
add |
TRUE/FALSE |
ylim |
|
na.rm |
PlotMatStochastic
: One Stochastic data series in a short table format
Plot2Stochastics
: Two stochastic data series in a long table format.
Plot2MatStochastics
: Two stochastic data series in a matrix format.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Generate a long table
niter <- 100
df <- data.frame("Date"=rep(seq(as.Date("2010-1-1"), by="month", length.out = 12),niter)
, "Iter" = rep(1:niter,each=12), "Y"=rnorm(12*niter))
for (i in 2:nrow(df))if(diff(df$Iter)[i-1]==0) df$Y[i] <- df$Y[i] + df$Y[i-1]
PlotStochastic(df$Date, df$Y, blue.f, q1 = c(0.05,0.95), q2=c(0.25, 0.75), ylab="y")
# 2 stochastic data in long table format
Plot2Stochastics(df$Date, df$Y, df$Y/2+2, red.f, blue.f, qs = c(0.05,0.95), ylab="y")
# A short table
df <- cast(df, Date ~ Iter, value="Y")
PlotMatStochastic(df$Date, df[,-1], blue.f, q1 = c(0.05,0.95), q2=c(0.25, 0.75), ylab="y")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.