-
Notifications
You must be signed in to change notification settings - Fork 0
/
match4.R
executable file
·25 lines (22 loc) · 982 Bytes
/
match4.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env Rscript
# Kyle Gorman <[email protected]>
#
# Matching experiment with heuristic4.
source("elp.R")
doMC::registerDoMC(max(1, parallel::detectCores() - 1))
d <- get_elp()
# Small set of covariates, for testing.
#covariates <- with(d, sbtlx.freq)
# Medium set of covariates.
covariates <- with(d, cbind(sbtlx.freq, sbtlx.basefreq, sbtlx.pformbase))
# Big set of covariates, what I really want to match on.
#covariates <- with(d, cbind(sbtlx.freq, sbtlx.basefreq, sbtlx.pformbase,
# OLD, length.squared, n.syll))
# Matches on whatever method works, favoring preserving irregulars (of which
# there are many fewer).
method <- "heuristic4"
l <- match_groups(d$regularity, covariates, t_halt, lookahead = 1,
method = method, print_info = TRUE, use_test = TRUE,
max_removed_per_cond = c(irregular= 63, regular = 3363),
max_removed_per_step = 1)
write.csv(d[l,], paste0(method, ".csv")