restore feasible estimator in robustness 1
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
x1library(data.table)
|
library(data.table)
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
source('resources/functions.R')
|
source('resources/functions.R')
|
||||||
|
|
||||||
@@ -98,7 +98,6 @@ plot.robustness.2.iv <- function(iv, n.annotations=100, n.classifications=5000){
|
|||||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLA", "zhang"="PL","feasible"="Feasible")
|
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLA", "zhang"="PL","feasible"="Feasible")
|
||||||
|
|
||||||
robust_df <- robust_df[,method := new.levels[method]]
|
robust_df <- robust_df[,method := new.levels[method]]
|
||||||
robust_df <- robust_df[method != "Feasible"]
|
|
||||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
||||||
|
|
||||||
p <- p + facet_wrap(prediction_accuracy~., ncol=4,as.table=F)
|
p <- p + facet_wrap(prediction_accuracy~., ncol=4,as.table=F)
|
||||||
@@ -121,13 +120,11 @@ plot.robustness.2.dv <- function(iv, n.annotations=100, n.classifications=5000){
|
|||||||
r <- readRDS("robustness_2_dv.RDS")
|
r <- readRDS("robustness_2_dv.RDS")
|
||||||
robust_df <- data.table(r[['robustness_2_dv']])
|
robust_df <- data.table(r[['robustness_2_dv']])
|
||||||
|
|
||||||
|
|
||||||
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
||||||
|
|
||||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLA", "zhang"="PL","feasible"="Feasible")
|
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLA", "zhang"="PL","feasible"="Feasible")
|
||||||
|
|
||||||
robust_df <- robust_df[,method := new.levels[method]]
|
robust_df <- robust_df[,method := new.levels[method]]
|
||||||
|
|
||||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
||||||
|
|
||||||
p <- p + facet_wrap(prediction_accuracy~., ncol=4,as.table=F)
|
p <- p + facet_wrap(prediction_accuracy~., ncol=4,as.table=F)
|
||||||
@@ -150,7 +147,7 @@ plot.robustness.3.iv <- function(iv, n.annotations=200, n.classifications=5000){
|
|||||||
|
|
||||||
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
||||||
robust_df <- robust_df[,method := new.levels[method]]
|
robust_df <- robust_df[,method := new.levels[method]]
|
||||||
robust_df <- robust_df[(method != "Feasible") & (Bzx==0.3)]
|
robust_df <- robust_df[(Bzx==0.3)]
|
||||||
robust_df <- robust_df[(method != "PL")]
|
robust_df <- robust_df[(method != "PL")]
|
||||||
|
|
||||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM","MLA", "PL", "Feasible"))
|
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM","MLA", "PL", "Feasible"))
|
||||||
@@ -173,7 +170,6 @@ plot.robustness.3.dv <- function(iv, n.annotations=100, n.classifications=1000){
|
|||||||
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
||||||
|
|
||||||
robust_df <- robust_df[,method := new.levels[method]]
|
robust_df <- robust_df[,method := new.levels[method]]
|
||||||
robust_df <- robust_df[method != "Feasible"]
|
|
||||||
robust_df <- robust_df[,Py := round(plogis(B0),2)]
|
robust_df <- robust_df[,Py := round(plogis(B0),2)]
|
||||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
||||||
robust_df <- robust_df[(method != "PL")]
|
robust_df <- robust_df[(method != "PL")]
|
||||||
@@ -195,6 +191,7 @@ plot.robustness.4.iv <- function(iv, n.annotations=200, n.classifications=5000){
|
|||||||
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
||||||
|
|
||||||
robust_df <- robust_df[,method := new.levels[method]]
|
robust_df <- robust_df[,method := new.levels[method]]
|
||||||
|
robust_df <- robust_df[method != "Feasible"]
|
||||||
|
|
||||||
robust_df <- robust_df[,y_bias:=factor(robust_df$y_bias,levels=sort(unique(robust_df$y_bias),decreasing=TRUE))]
|
robust_df <- robust_df[,y_bias:=factor(robust_df$y_bias,levels=sort(unique(robust_df$y_bias),decreasing=TRUE))]
|
||||||
robust_df <- robust_df[Bzx==1]
|
robust_df <- robust_df[Bzx==1]
|
||||||
|
|||||||
Reference in New Issue
Block a user