| rpl_se | R Documentation |
Calculate standard errors for parameters estimated with the RPL
rpl_se(
mydata,
parameters,
pi,
offsets = NULL,
block_indices = NULL,
verbose = FALSE
)
mydata |
Data matrix |
parameters |
Vector providing estimated values for all parameters (means followed by correlations) |
pi |
Bernoulli sampling parameter (0 < pi <= 1) |
offsets |
If needed, a matrix of offsets (optional) |
block_indices |
List of vectors providing indices for each block for blockwise exchangeable correlation matrices |
verbose |
If |
A named list containing the following:
se - standard errors for each estimated parameter
parameters - user-provided estimated parameter values
S - estimated S matrix
Sinv - estimated S^(-1) matrix
Mazo, G., Karlis, D., Rau, A. (2021) A randomized pairwise likelihood method for complex statistical inferences. In revision. hal-03126621.
## 1) Simulate exchangeable correlation matrix ---------------------------------
d <- 10
sim_exchangeable <-
simulate_mvt_poisson(n = 1000, d = d,
param = list(margins = rep(1, d), disp = 0.5),
type = "exchangeable")
init_exchangeable <- init(sim_exchangeable$data, type = "exchangeable")
run_exchangeable <- rpl_optim(init_exchangeable, sim_exchangeable$data, pi = 0.1)
## 2) Simulate unstructured correlation matrix ---------------------------------
d <- 4
sim_unstructured <-
simulate_mvt_poisson(n = 1000, d = d,
param = list(margins = rep(1, d),
disp = c(0.4,0.5,0.6,0.7,0.8,0.9)),
type = "unstructured")
init_unstructured <- init(sim_unstructured$data, type = "unstructured")
run_unstructured <- rpl_optim(init_unstructured, sim_unstructured$data, pi = 0.1)
## Calculate SE of estimated parameters
se_unstructured <- rpl_se(mydata=sim_unstructured$data,
parameters=run_unstructured$par,
pi = 0.1,
offsets=NULL, verbose=FALSE)
## 3) Simulate one-factor correlation matrix -----------------------------------
d <- 4
sim_factor <-
simulate_mvt_poisson(n = 1000, d = d,
param = list(margins = rep(1, d),
disp = seq(0, 1, length = d)),
type = "factor")
init_factor <- init(sim_factor$data, type = "factor")
run_factor <- rpl_optim(init_factor, sim_factor$data, pi = 0.1)
## Calculate SE of estimated parameters
se_factor <- rpl_se(mydata=sim_factor$data,
parameters=run_factor$par,
pi = 0.1,
offsets=NULL, verbose=FALSE)
## 4) Simulate block-exchangeable correlation matrix ---------------------------
d <- 10
block_indices <- list(c(1:5), c(6:10))
sim_block <-
simulate_mvt_poisson(n = 1000, d = d,
block_indices = block_indices,
param = list(margins = rep(1, d),
disp = c(0.5,0.1,0.8)),
type = "block_exchangeable")
init_block<- init(sim_block$data, type = "block_exchangeable",
block_indices = block_indices)
run_block <- rpl_optim(init_block, sim_block$data, pi = 0.1,
block_indices = block_indices)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.