Description Usage Arguments Value Note Author(s) See Also Examples
This function extends continuity_ratio
and
adds the corresponding gaussian correlation matrix for
no-precipitation occurence.
1 2 3 4 5 |
data |
data frame or 'zoo' R object containing daily
precipitation time series for several gauges (one gauge
time series per column). See
|
lag |
numeric lag (expressed as number of days) used
for computation for "cross" continuity ratio and joint
probability of prercipitation (no)occurence. See
|
p |
positive integer parameter. Default is
|
valmin |
threshold precipitation value [mm] for
wet/dry day indicator. If precipitation is lower than
|
p0_v1 |
vector for marginal probablities, see
|
nearPD |
see |
interval,tolerance |
see |
only.matrix |
logical value. If |
return.value |
string. If it is not either
|
null.gcorrelation |
numerical value
|
sample |
character string indicated if function must
be calculated differently for subset of the year, e.g.
monthly. Admitted values are |
origin |
character string (yyyy-dd-mm) indicated the
date of the first row of |
... |
additional agruments of
|
An object which is a list containing the following fields:
continuity_ratio
: lag
-day lagged continuity
ratio, as returned by continuity_ratio
;
occurence
: joint probability of lag
-day
lagged precipitation occurence, as returned by
continuity_ratio
;
nooccurence
: joint probability of lag
-day
lagged no precipitation occurence, as returned by
continuity_ratio
;
lag
: number of days lagged between the two compared
events (see argument lag
);
p0_v1
: vector of marginal probability of no
precipitation occurence. If lag
is 0, it corresponds
to the diagonal of nooccurence
matrix (see argument
p0_v1
);
nooccurence_gcorrelation
corresponding gaussian
correlation for no precipitation occurence obtained by
applying omega_inv
to nooccurence
,
TransintionMatrixMCFirstOrder
List of transition
matrices (with condinitioned probability values) of the
first-order Markov Chain. See
TransitionMatrixMCFirstOrder
.
If the argument only.matrix
is TRUE
, only
nooccurence_gcorrelation
is returned as a matrix. In
case the argument lag
is a vector wirh length more
than one, the function returns a list of the above-cited
return object for each value of the vector lag
.
This functon is useful to generate the serial
cross-correlation matrices for no precipitation occurrence
for Yule-Walker Equations. In case lag
is a vactor,
nearPD
must be a vector of the same size, default is
(lag==0)
.
See the R code for major details
Emanuele Cordano
continuity_ratio
,omega_inv
,omega
,CCGammaToBlockmatrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | library(RMAWGEN)
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)
## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.