adjust_params: Adjust parameters of monthly precipitation

Description Usage Arguments Value Examples

View source: R/WGEN_ppt.R

Description

Adjust parameters of monthly precipitation

Usage

1
adjust_params(params, mean_mult, sd_mult)

Arguments

params

dataframe of parameters from monthly_ppt_params() function

mean_mult

amount to multiply the daily mean by

sd_mult

amount to multiply the standard deviation by

Value

adjusted parameters with probability of rain multiplied by a factor of 1/mean_mult so that total precip is held constant

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
mean_mult <- 1.5
sd_mult <- 2
params <- monthly_ppt_params(wx_data)
params2 <- adjust_params(params, mean_mult, sd_mult)
df <- markov_chain(params2)
df2 <- generate_events(df, params2)
# make histograms
if (FALSE){
breaks <- seq(from = 0, to =10, by = 0.25)
hist(df2$PPT_cm[df2$PPT_cm > 0], breaks = breaks)
hist(wx_data$PPT_cm[wx_data$PPT_cm > 0],breaks = breaks)
}

MartinHoldrege/precipr documentation built on Nov. 4, 2021, 11:10 a.m.