Learn R Programming

SpaCOAP (version 1.3)

gendata_spacoap: Generate simulated data

Description

Generate simulated data from spaital covariate-augmented Poisson factor models

Usage

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
)

Value

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.

Arguments

seed

a postive integer, the random seed for reproducibility of data generation process.

width

a postive integer, specify the width of the spatial grid.

height

a postive integer, specify the height of the spatial grid.

p

a postive integer, specify the dimension of count variables.

d

a postive integer, specify the dimension of covariate matrix with low-rank regression coefficient matrix.

k

a postive integer, specify the dimension of covariate matrix as control variables.

q

a postive integer, specify the number of factors.

rank0

a postive integer, specify the rank of the coefficient matrix.

eta0

a real between 0 and 1, specify the spatial autocorrelation parameter.

bandwidth

a real positive value, specify the bandwidth in calculating the weighted adjacency matrix.

rho

a numeric vector with length 2 and positive elements, specify the signal strength of loading matrix and regression coefficient, respectively.

sigma2_eps

a positive real, the variance of overdispersion error.

seed.beta

a postive integer, the random seed for reproducibility of data generation process by fixing the regression coefficient matrix beta.

Details

None

References

None

See Also

SpaCOAP

Examples

Run this code
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