cokm.condsim: Conditional simulation at new inputs in the autoregressive...

Description Usage Arguments Author(s) See Also Examples

View source: R/cokm.condsim.R

Description

This function simulate from predictive distributions in autogressive cokriging models

Usage

1
cokm.condsim(obj, input.new, nsample = 30)

Arguments

obj

a cokm object construted via the function cokm in this package

input.new

a matrix including new inputs for making prediction

nsample

a numerical value indicating the number of samples

Author(s)

Pulong Ma <mpulong@gmail.com>

See Also

cokm, cokm.fit, cokm.predict, ARCokrig

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
Funcc = function(x){
  return(0.5*(6*x-2)^2*sin(12*x-4)+10*(x-0.5)-5)
}

Funcf = function(x){
  z1 = Funcc(x)
  z2 = 2*z1-20*x+20 + sin(10*cos(5*x))
  return(z2)
}

#####################################################################
###### Nested design 
#####################################################################
Dc <- seq(-1,1,0.1)
indDf <- c(1, 3, 6, 8, 10, 13, 17, 21)
zc <- Funcc(Dc)
Df <- Dc[indDf]
zf <- Funcf(Df)

input.new = as.matrix(seq(-1,1,length.out=200))


## create the cokm object
prior = list(name="Reference")
obj = cokm(formula=list(~1,~1+x1), output=list(c(zc), c(zf)),
              input=list(as.matrix(Dc), as.matrix(Df)),
              prior=prior, cov.model="matern_5_2")

## update model parameters in the cokm object

obj = cokm.fit(obj)


cokrige = cokm.condsim(obj, input.new, nsample=30)

pulongma/ARCokrig documentation built on Sept. 24, 2021, 11:24 p.m.