|
|||||||||||||||||||||||||||||||
ValueAn object which is a list containing the following fields:
If the argument NoteThis functon is useful to generate the serial
cross-correlation matrices for no precipitation occurrence
for Yule-Walker Equations. In case See the R code for major details Author(s)Emanuele Cordano ReferencesD.S. Wilks (1998), Multisite Generalization of a Daily Stochastic Precipitation Generation Model, Journal of Hydrology, Volume 210, Issues 1-4, September 1998, Pages 178-191, http://www.sciencedirect.com/science/article/pii/S0022169498001863 Muamaraldin Mhanna and Willy Bauwens (2011) A Stochastic Space-Time Model for the Generation of Daily Rainfall in the Gaza Strip, International Journal of Climatology, Volume 32, Issue 7, pages 1098-1112, http://dx.doi.org/10.1002/joc.2305 See Also
Examplesdata(trentino) year_min <- 1961 year_max <- 1990 origin <- paste(year_min,1,1,sep="-") period <- PRECIPITATION$year>=year_min & PRECIPITATION$year<=year_max station <- names(PRECIPITATION)[!(names(PRECIPITATION) %in% c("day","month","year"))] prec_mes <- PRECIPITATION[period,station] ## removing nonworking stations (e.g. time series with NA) accepted <- array(TRUE,length(names(prec_mes))) names(accepted) <- names(prec_mes) for (it in names(prec_mes)) { accepted[it] <- (length(which(!is.na(prec_mes[,it])))==length(prec_mes[,it])) } prec_mes <- prec_mes[,accepted] ## the dateset is reduced!!! prec_mes <- prec_mes[,1:2] CCGamma <- CCGamma(data=prec_mes,lag=0,tolerance=0.001,only.matrix=FALSE) ## Not Run in the examples, uncomment to run the following line ## CCGamma <- CCGamma(data=prec_mes,lag=0:2,tolerance=0.001,only.matrix=FALSE) ## Not Run in the examples, uncomment to run the following line ## CCGamma_monthly <- CCGamma(data=prec_mes,lag=0,tolerance=0.001,only.matrix=FALSE, # sample="monthly",origin=origin) ResultsR version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(RGENERATEPREC) Loading required package: copula Loading required package: RGENERATE Loading required package: RMAWGEN Loading required package: chron Loading required package: date Loading required package: vars Loading required package: MASS Loading required package: strucchange Loading required package: zoo Attaching package: 'zoo' The following objects are masked from 'package:base': as.Date, as.Date.numeric Loading required package: sandwich Loading required package: urca Loading required package: lmtest Attaching package: 'vars' The following object is masked from 'package:copula': A Loading required package: blockmatrix Loading required package: Matrix Loading required package: stringr Attaching package: 'stringr' The following object is masked from 'package:strucchange': boundary > png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RGENERATEPREC/CCGamma.Rd_%03d_medium.png", width=480, height=480) > ### Name: CCGamma > ### Title: This function extends 'continuity_ratio' and adds the > ### corresponding gaussian correlation matrix for no-precipitation > ### occurence. > ### Aliases: CCGamma > > ### ** Examples > > data(trentino) > > year_min <- 1961 > year_max <- 1990 > origin <- paste(year_min,1,1,sep="-") > > period <- PRECIPITATION$year>=year_min & PRECIPITATION$year<=year_max > station <- names(PRECIPITATION)[!(names(PRECIPITATION) %in% c("day","month","year"))] > prec_mes <- PRECIPITATION[period,station] > > ## removing nonworking stations (e.g. time series with NA) > accepted <- array(TRUE,length(names(prec_mes))) > names(accepted) <- names(prec_mes) > for (it in names(prec_mes)) { + accepted[it] <- (length(which(!is.na(prec_mes[,it])))==length(prec_mes[,it])) + } > > prec_mes <- prec_mes[,accepted] > ## the dateset is reduced!!! > prec_mes <- prec_mes[,1:2] > > CCGamma <- CCGamma(data=prec_mes,lag=0,tolerance=0.001,only.matrix=FALSE) lag 0 Hmm... p0 - first argument - must be a matrix of probabilities!!! > ## Not Run in the examples, uncomment to run the following line > ## CCGamma <- CCGamma(data=prec_mes,lag=0:2,tolerance=0.001,only.matrix=FALSE) > > ## Not Run in the examples, uncomment to run the following line > ## CCGamma_monthly <- CCGamma(data=prec_mes,lag=0,tolerance=0.001,only.matrix=FALSE, > # sample="monthly",origin=origin) > > > > > > dev.off() null device 1 > |
|||||||||||||||||||||||||||||||
|