Description Usage Arguments Value Examples
View source: R/gen_normal_data.R
A function to generate simulated seasons
1 | gen_normal_data(n.seas, n.reg, weeks, mu, new.mu = NULL, sd1, sd2, tau = 1)
|
n.seas |
number of seasons to simulate |
n.reg |
number of regions to simulate |
weeks |
number of weeks in a season |
mu |
vector of means to be sampled from (w/ replacement) |
new.mu |
specific mean to be used in the last season |
sd1 |
standard dev of data model |
sd2 |
standard dev of the normal functional form |
tau |
scaling factor (default=1) |
A data.frame
1 2 3 4 | tmpd=gen_normal_data(n.seas=2, n.reg=2, weeks=1:30, mu=c(11,17), sd1=0.015, sd2=3)
library(ggplot2)
ggplot(data=tmpd) + geom_point(aes(x=week, y=y)) +
facet_grid(region~season) + geom_line(aes(x=week,y=meanfc))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.