CCGammaToBlockmatrix: This return a 'blockmatrix' object containing the gaussian...

Description Usage Arguments Details See Also Examples

View source: R/GammaBlockmatrix.R

Description

This return a blockmatrix object containing the gaussian cross-correlation matrices.

Usage

1

Arguments

data

data frame or 'zoo' R object containing daily precipitation time series for several gauges (one gauge time series per column). See CCGamma.

lag

numeric (expressed as number of days) used for the element [1,1] of the returned blockmatrix.

p

numeric order $p$ of the auto-regeression

...

further argments of CCGamma

Details

This a wrapper for CCGamma with the option only.matrix=TRUE and the function value is transformed into a blockmatrix object.

See Also

CCGamma,continuity_ratio,omega_inv,omega

Examples

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
library(RMAWGEN)
data(trentino)

year_min <- 1961
year_max <- 1990

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]

p <- 1 ## try p <- 2 !!!
CCGamma <- CCGammaToBlockmatrix(data=prec_mes,lag=0,p=p,tolerance=0.001)

## Not Run in the examples, uncomment to run the following line
# CCGamma_1 <- CCGammaToBlockmatrix(data=prec_mes,lag=1,p=p,tolerance=0.001)


### Alternatively, recommended .....
## Not Run in the examples, uncomment to run the following line
# CCGamma <- CCGammaToBlockmatrix(data=prec_mes,lag=0,p=p+1,tolerance=0.001)

# CCGamma0 <- CCGamma[1:p,1:p]
# CCGamma1 <- CCGamma[(1:p),(1:p)+1]

# CCGamma0_inv <- solve(CCGamma0)


## Not Run in the examples, uncomment to run the following line
#a1 <- blockmatmult(CCGamma0,CCGamma0_inv)
# a2 <- blockmatmult(CCGamma1,CCGamma0_inv)



# CCGamma_1t <- t(CCGamma1)
#CCGamma_0t <- t(CCGamma0)

# A <- t(solve(CCGamma_0t,CCGamma_1t))

RMRAINGEN documentation built on May 1, 2019, 11:36 p.m.