add more simulations.
This commit is contained in:
parent
4dec710fdc
commit
6af6faeb49
@ -1,16 +1,9 @@
|
|||||||
#!/usr/bin/env Rscript
|
#!/usr/bin/env Rscript
|
||||||
library(argparser)
|
library(argparser)
|
||||||
library(mecor)
|
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
library(data.table)
|
library(data.table)
|
||||||
library(filelock)
|
library(filelock)
|
||||||
library(arrow)
|
library(arrow)
|
||||||
library(Amelia)
|
|
||||||
library(Zelig)
|
|
||||||
library(predictionError)
|
|
||||||
options(amelia.parallel="no",
|
|
||||||
amelia.ncpus=1)
|
|
||||||
setDTthreads(40)
|
|
||||||
|
|
||||||
source("simulation_base.R")
|
source("simulation_base.R")
|
||||||
|
|
||||||
@ -31,8 +24,9 @@ simulate_data <- function(N,
|
|||||||
accuracy_imbalance_difference = 0.3) {
|
accuracy_imbalance_difference = 0.3) {
|
||||||
set.seed(seed)
|
set.seed(seed)
|
||||||
# make w and y dependent
|
# make w and y dependent
|
||||||
z <- rbinom(N, 1, plogis(qlogis(Pz)))
|
l <- rnorm(N)
|
||||||
x <- rbinom(N, 1, plogis(Bzx * z + qlogis(Px)))
|
z <- rbinom(N, 1, plogis(qlogis(Pz)+Bzx*l))
|
||||||
|
x <- rbinom(N, 1, plogis(-1*Bzx*l + qlogis(Px)))
|
||||||
|
|
||||||
y.var.epsilon <- (var(Bzy * z) + var(Bxy * x) + 2 * cov(Bzy * z, Bxy * x)) * ((1 - y_explained_variance) / y_explained_variance)
|
y.var.epsilon <- (var(Bzy * z) + var(Bxy * x) + 2 * cov(Bzy * z, Bxy * x)) * ((1 - y_explained_variance) / y_explained_variance)
|
||||||
y.epsilon <- rnorm(N, sd = sqrt(y.var.epsilon))
|
y.epsilon <- rnorm(N, sd = sqrt(y.var.epsilon))
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
SHELL=bash
|
SHELL=bash
|
||||||
|
|
||||||
Ns=[1000,5000,10000]
|
Ns=[1000,5000,10000]
|
||||||
ms=[100,200,400]
|
ms=[100,200,400,1000]
|
||||||
seeds=[$(shell seq -s, 1 500)]
|
seeds=[$(shell seq -s, 1 500)]
|
||||||
explained_variances=[0.1]
|
explained_variances=[0.1]
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ joblists:example_1_jobs example_2_jobs example_3_jobs
|
|||||||
grid_sweep_script=../simulations/grid_sweep.py
|
grid_sweep_script=../simulations/grid_sweep.py
|
||||||
|
|
||||||
example_1_jobs: 01_indep_differential.R simulation_base.R ${grid_sweep_script} skx_dev.sbatch ../misclassificationmodels
|
example_1_jobs: 01_indep_differential.R simulation_base.R ${grid_sweep_script} skx_dev.sbatch ../misclassificationmodels
|
||||||
${srun} uv run ${grid_sweep_script} --command 01_indep_differential.R --arg_dict '{"N":${Ns},"m":${ms},"seed":${seeds},"outfile":["example_1.feather"],"y_explained_variance":${explained_variances},"Bzx":[1]}' --outfile example_1_jobs --remember_file=remember_grid_sweep.rds
|
${srun} uv run ${grid_sweep_script} --command 01_indep_differential.R --arg_dict '{"N":${Ns},"m":${ms},"seed":${seeds},"outfile":["example_1.feather"],"y_explained_variance":${explained_variances},"Bzx":[1],"prediction_accuracy":0.825}' --outfile example_1_jobs --remember_file=remember_grid_sweep.rds
|
||||||
|
|
||||||
example_1.feather: example_1_jobs my_pylauncher.py
|
example_1.feather: example_1_jobs my_pylauncher.py
|
||||||
sbatch -J "multiple iv measerr correction" spr_2.sbatch my_pylauncher.py $< --cores 1
|
sbatch -J "multiple iv measerr correction" spr_2.sbatch my_pylauncher.py $< --cores 1
|
||||||
|
Loading…
Reference in New Issue
Block a user