PlotStochastic: Stochastic Plot

Description Usage Arguments Functions Examples

Description

Plot stochastic results. PlotStochastic takes a long table, and PlotMatStochastic takes short table or matrix.

Usage

 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, ...)

Arguments

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

Functions

Examples

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

einaooka/tea.eo.plots documentation built on May 16, 2019, 1:25 a.m.