Description Usage Arguments Value Author(s) See Also Examples
This function computes quantities in likelihood function based on ensembles y and model outputs x. This function is used in parallel computing of MCMC algorithm.
1 | parcomputeW(y, x)
|
y |
an n by N matrix of ensemble members of measured variable (e.g., temperature increase) |
x |
a list of m elements under m forcing scenarios, each of which is model-output variable (e.g., temperature increase) under a specific forcing scenario |
a list of 6 elements
Pulong Ma <mpulong@gmail.com>
computeW
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 | #################### simulate data ########################
set.seed(1234)
n <- 30 # number of spatial grid cells on the globe
N <- 10 # number of ensemble members
m <- 3 # number of forcing scenarios
Lj <- c(5, 3, 7) # number of runs for each scenario
L0 <- 8 # number of control runs without any external forcing scenario
trend <- 30
DAdata <- simDAdata(n, N, m, Lj, L0, trend)
# ensembles of the measured variable
y <- DAdata[[1]]
# model outputs for the measured variable under different forcing scenarios
x <- DAdata[[2]]
# model outputs for the measured variable without any external forcing scenario
x0 <- DAdata[[3]]
#################### end of simulation ####################
# center the data
y <- y - mean(y)
for(j in 1:m){
x[[j]] <- x[[j]]-mean(x[[j]])
}
# precomputation for W
## Not run:
outW <- parcomputeW(y,x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.