cokrigagem {geoComp} | R Documentation |
Usage
cokrigagem(esti.par, dim.gride, dados.comp)
Arguments
esti.par |
|
dim.gride |
|
dados.comp |
|
Examples
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(esti.par, ## Parametros da otimizacao
dim.gride, ## Dimensao do Gride para predicao
dados.comp ## Uma lista com os dados e as localizacoes amostradas
){
rang.coord.x <- range(dados.comp[[3]][[1]])
rang.coord.y <- range(dados.comp[[3]][[1]])
c.x <- seq(rang.coord.x[1],rang.coord.x[2],length=dim.gride)
c.y <- seq(rang.coord.y[1],rang.coord.y[2],length=dim.gride)
gride <- expand.grid(c.x,c.y)
esti.par <- as.matrix(esti.par)
n.local <- length(gride[,1])*2
dad <- list()
dad[[2]] <- data.frame(c(rep(0,length=n.local),dados.comp[[2]][[1]]))
dad[[3]] <- as.data.frame(rbind(as.matrix(gride),as.matrix(dados.comp[[3]])))
## Reparametrizando
theta1ck <- c(esti.par[4]/esti.par[3],esti.par[5]/esti.par[3],
esti.par[6]/esti.par[3],esti.par[7],esti.par[8])
## Montando a matriz de covariancia
sigmack <- monta.V(theta1ck,dad)
n.local.mais <- n.local +1
dim.matriz <- dim(sigmack)[1]
S00 <- sigmack[c(1:n.local),c(1:n.local)] #dim(S00) 50 50
S0y <- sigmack[c(1:n.local),c(n.local.mais:dim.matriz)] #dim(S0y) 50 152
Sy0 <- sigmack[c(n.local.mais:dim.matriz),c(1:n.local)] #dim(Sy0) 152 50
Syy <- sigmack[c(n.local.mais:dim.matriz),c(n.local.mais:dim.matriz)] #dim(Syy) 152 152
muy <- rep(c(esti.par[1],esti.par[2]),length(dados.comp[[1]]$Y1))
# Como a media de Y0(50x1)e desconhecida, substituimos pela media geral estimada
# Com length=5, muy0(50x1)
muy0 <- rep(c(esti.par[1],esti.par[2]),n.local/2)
InvSyy <- solve(Syy)
## Calculando a media de cokrigagem estimada (50x1):
muck.est <- muy0 + S0y %*% InvSyy %*% (dados[[2]][[1]]-muy)
## Calculando a variancia de cokrigagem estimada(50x1):
vck.est <- S00-S0y%*%InvSyy%*%Sy0
res.cokri <- list()
res.cokri[[1]] <- muck.est
res.cokri[[2]] <- vck.est
return(res.cokri)}
[Package
geoComp version 0.1-0
Index]