# Load the included parameterized model
data(truemodel)
# for reference, plot the species interaction network
plot(truemodel, type="network")
# Unconditional predictions
# let's fix environmental predictors at 0, for simplicity.
predict(truemodel, newdata=cbind(env01=0, env02=0))
# Conditional predictions
# predict probabilities for all species conditional on the
# known presence of sp011 (compare sp014 and sp004 with the above)
predict(truemodel, newdata=cbind(env01=0, env02=0, sp011=1))
# Propagation of indirect species effects
# predict probabilities for all species conditional on the known
# absence (first line) and known presence (second line) of sp005 and sp023
predict(truemodel, newdata=cbind(env01=0, env02=0, sp012=c(0, 1), sp018=c(0, 1)), nrep=100000)
# Notice the effects on sp026 and the effect propagation to those
# species which depend on it (sp013, sp008)
# Also compare with unconditional predictions
Run the code above in your browser using DataLab