Logistic function formula for a child given its parents
y_var <- V(g)[is.fixed] %>%
{random_v(g, .)} %>%
{ichildren(g, .)} %>%
{random_v(g, V(g)[.])}
x_vars <- V(g)[iparents(g, y_var)]
.data <- x_vars$output.signal %>%
as.data.frame %>%
`names<-`(paste("v", x_vars$name, sep="")) %>%
mutate(Y = unlist(y_var$output.signal))
params <- LETTERS[1:(length(.data) - 1)]
start_list <- as.list(structure(runif(length(x_vars)), names = params))
names(.data) %>%
setdiff("Y") %>%
paste(params, sep = " * ") %>%
paste(collapse = " + ") %>%
{paste("Y ~ logistic(", ., ")")} %>%
as.formula