Description Usage Arguments Value References Examples
Weighted Rank Squared Error Loss
Given a set of samples of an n-dimensional random variable, WRSEL
returns a function which, when supplied with a weight vector, returns
optimal estimates under a rank-weighted squared error loss, see references for details.
1 |
X |
samples from the posterior, size |
num_nodes |
the number of nodes to use on multi-core architecture (needs parallel package) |
weights |
the weight function, must be a vector of length 1 or length |
function
Wright, Deanne L., Hal S. Stern, and Noel Cressie. "Loss functions for estimation of extrema with an application to disease mapping." Canadian Journal of Statistics 31.3 (2003): 251-266.
1 2 3 4 5 6 7 8 9 10 11 12 | ### Simulate a three variable system, where the three variables are Gaussian with sd = 1 and means c(-1,0,1)
n <- 3
N <- 100000
X <- matrix(rnorm(n*N),n,N)
X <- X + c(-1,0,1)
### Create the WRSEL function which we can then supply with weight vectors to obtain the optimal estimates
WRSEL_fun <- WRSEL(X = X,num_nodes = NULL)
### Create a weight vector
weights <- c(1,0,0)
### Find and print the optimal estimates
lambda_hat <- WRSEL_fun(weights)
print(lambda_hat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.