df <- FCV[, c(12:15)]
mydists <- list(Outdoor="binomial",
Sex="multinomial",
GroupSize="poisson",
Age="gaussian")
## buildScoreCache -> mostProbable() -> fitAbn()
suppressWarnings({
mycache.mle <- buildScoreCache(data.df = df, data.dists = mydists, method = "mle",
adj.vars = NULL, cor.vars = NULL,
dag.banned = NULL, dag.retained = NULL,
max.parents = 1,
which.nodes = NULL, defn.res = NULL)
}) # ignore non-convergence warnings
mp.dag.mle <- mostProbable(score.cache = mycache.mle, verbose = FALSE)
myres.mle <- fitAbn(object = mp.dag.mle, method = "mle")
myres.sim <- simulateAbn(object = myres.mle,
run.simulation = TRUE,
bugsfile = NULL,
verbose = FALSE)
str(myres.sim)
prop.table(table(myres.sim$Outdoor))
prop.table(table(df$Outdoor))
Run the code above in your browser using DataLab