XYkZ | R Documentation |
Calculates the design matrix X and other quantities that are used by the cdlm
function
XYkZ(Y, s2, C = NULL, CY, CN = NULL, N = NULL)
Y |
observed data (n x 1) |
s2 |
unbiased estimate of variance of Y (n x 1) |
C |
main effects in the linear regression (n x p_C) |
CY |
terms in the linear regression that interact with Y (n x p_Y) |
CN |
terms in the linear regression that interact with Y_i_k for i_k in the ith row of N. This should be a list of length q, where the kth item in the list is an n x p_k matrix. |
N |
neighbors of each index (n x q). This encodes structural information, where the ith row of N contains indices that are expected to be similar to the ith parameter of interest. |
X |
design matrix |
Yk |
matrix of neighboring Y_k indicated by the N matrix |
Z |
vector Z used in the empirical risk function |
n = 10 set.seed(1) theta = sort(rnorm(n)) s2 = abs(theta) + runif(n) Y = theta + rnorm(n, sd = sqrt(s2)) C = cbind(1, s2) CY = cbind(1, 1 / s2) N = cbind(c(n, 1:(n - 1)), c(2:n, 1)) CN = rep(list(matrix(1, n, 1)), ncol(N)) XYkZ(Y, s2, C, CY, CN, N)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.