Generate simulated data from spaital covariate-augmented Poisson factor models
gendata_spacoap(
seed = 1,
width = 20,
height = 30,
p = 500,
d = 40,
k = 3,
q = 5,
rank0 = 3,
eta0 = 0.5,
bandwidth = 1,
rho = c(10, 1),
sigma2_eps = 1,
seed.beta = 1
)return a list including the following components:
X - the high-dimensional count matrix;
Z - the low-dimensional covariate matrix with control variables.
H - the high-dimensional covariate matrix;
Adj_sp - the weighted adjacence matrix;
alpha0 - the regression coefficient matrix corresponing to Z;
bbeta0 - the low-rank large regression coefficient matrix corresponing to H;
B0 - the loading matrix;
F0 - the laten factor matrix;
rank0 - the true rank of bbeta0;
q - the true number of factors;
eta0 - spatial autocorrelation parameter;
pos - spatial coordinates for each observation.
a postive integer, the random seed for reproducibility of data generation process.
a postive integer, specify the width of the spatial grid.
a postive integer, specify the height of the spatial grid.
a postive integer, specify the dimension of count variables.
a postive integer, specify the dimension of covariate matrix with low-rank regression coefficient matrix.
a postive integer, specify the dimension of covariate matrix as control variables.
a postive integer, specify the number of factors.
a postive integer, specify the rank of the coefficient matrix.
a real between 0 and 1, specify the spatial autocorrelation parameter.
a real positive value, specify the bandwidth in calculating the weighted adjacency matrix.
a numeric vector with length 2 and positive elements, specify the signal strength of loading matrix and regression coefficient, respectively.
a positive real, the variance of overdispersion error.
a postive integer, the random seed for reproducibility of data generation process by fixing the regression coefficient matrix beta.
None
None
SpaCOAP
width <- 20; height <- 15; p <- 100
d <- 20; k <- 3; q <- 6; r <- 3
datlist <- gendata_spacoap(width=width, height=height, p=p, d=20, k=k, q=q, rank0=r)
str(datlist)
Run the code above in your browser using DataLab