simulate_data {BINtools} | R Documentation |
Simulate Data
Description
This function allows the user to generate synthetic data of two groups (control and treatment) of forecasters making probability predictions of binary events. The function is mostly useful for testing and illustration purposes.
Usage
simulate_data(parameters, N, N_0, N_1, rho_o = 0)
Arguments
parameters |
A list containing the true values of the parameters: mu_star,mu_0,mu_1,gamma_0,gamma_1,rho_0,delta_0,rho_1,delta_1 and rho_01 |
N |
Number of events |
N_0 |
Number of forecasters in the control group |
N_1 |
Number of forecasters in the treatment group |
rho_o |
The level of dependence between event outcomes. (Default: the events are independent conditional on the model parameter values. This sets |
Details
See complete_summary
for a description of the model parameters.
Not all combinations of parameters are possible.
In particular, the covariance parameters gamma and rho are dependent on each other and must result in a positive semi-definite covariance matrix for the outcomes and predictions.
To find a feasible set of parameters, we recommend users to experiment: begin with the desired levels of mu, gamma, and delta, and values of rho close to zero, and then increase rho until data can be generated without errors.
Value
List containing the simulated data. The elements of the list are as follows.
Outcomes: Vector containing binary values that indicate the outcome of each event. The j-th entry is equal to 1 if the j-th event occurs and equal to 0 otherwise.
Control: List of vectors (one for each event) containing probability predictions made by the forecasters in the control group.
Treatment: List of vectors (one for each event) containing probability predictions made by the forecasters in the treatment group.
See Also
estimate_BIN
, complete_summary
Examples
simulate_data(list(mu_star = -0.8,mu_0 = -0.5,mu_1 = 0.2,gamma_0 = 0.1,gamma_1 = 0.3,
rho_0 = 0.05,delta_0 = 0.1,rho_1 = 0.2, delta_1 = 0.3,rho_01 = 0.05), 300,100,100)