Deviance equal to 0

1

I have a question about calculating the value of deviance. I am carrying out the analysis of a community and relating it to environmental variables, so I am interested in having some information criteria.

My different models can be summarized in M = a + sum(bi *x) where M is a 550x10 matrix (550 species in 10 sites) and x are my environmental variables.

When I want to calculate the deviance of all my models (null and the others), they all come out to me 0. What are the reasons why this value comes out 0?.

I'm doing the analysis in the boral package of R.

This would be my community:

"","sp1","sp2","sp3","sp4","sp5","sp6","sp7","sp8","sp9","sp10"
"comu_44",1,0,0,0,1,1,1,1,1,1
"comu_7",1,0,0,1,0,1,1,1,1,1
"comu_21",1,0,0,1,1,1,1,1,1,1
"comu_38",1,1,1,1,1,1,1,1,1,1
"comu_26",1,1,0,0,0,0,0,0,0,0
"comu_2",1,0,1,1,1,1,1,1,1,1
"comu_49",1,0,0,0,0,1,1,1,1,1
"comu_48",1,1,0,1,1,1,1,1,1,1
"comu_23",1,0,0,1,0,1,0,0,1,1
"comu_5",1,0,0,1,1,1,1,1,1,1

these my environmental data:

"","Cl.g.L.","SO4.g.L.","Na.g.L.","K.g.L.","Ca.g.L.","Mg.g.L.","Br.g.","B.g.L.","Li.g.L."
"comu_44",1.71963451266333,2.36109561690706,-2.39861345413745,2.33063236343157,-1.90115237334694,2.42920804871106,2.5317734458085,2.50706812722311,2.3684216334859
"comu_7",0.97196733324449,0.0897853520794281,-0.18565632817097,0.0936293982987063,-0.563150233831579,0.125352630223309,-0.0351025781047973,0.0157673117400964,0.0522013817919093
"comu_21",0.97196733324449,0.0897853520794281,-0.18565632817097,0.0936293982987063,-0.563150233831579,0.125352630223309,-0.0351025781047973,0.0157673117400964,0.0522013817919093
"comu_38",0.59813374353507,0.577583529760531,-0.790697040513867,0.761122218539965,-1.03293765170586,0.783597035505524,0.776644540568638,0.287843585009952,0.840407676398222
"comu_26",-0.14953343588377,-0.794348844967571,0.568572505023598,-0.267177531561433,0.293171135458255,-0.585837520701171,-0.430006581783766,-0.377595974915117,-0.656492874323415
"comu_2",-0.52336702559319,-0.826360600377893,0.485690215661558,-0.828232307493951,0.174237611945779,-0.677419351001306,-0.451945693099264,-0.564443536076343,-0.487097661886094
"comu_49",-0.52336702559319,-0.657155607494761,0.651454794385639,-0.884157381622273,0.560771563361328,-0.687436113690383,-0.517763027045759,-0.613613946908245,-0.732547867662621
"comu_48",-0.89720061530261,0.146949201026432,0.353078552682293,-0.0524974082946504,1.18814589988964,-0.240974690977228,-0.430006581783766,0.0337964623784604,-0.117193830645412
"comu_23",-0.89720061530261,0.146949201026432,0.353078552682293,-0.0524974082946504,1.18814589988964,-0.240974690977228,-0.430006581783766,0.0337964623784604,-0.117193830645412
"comu_5",-1.27103420501203,-1.13428320003909,1.14874853055788,-1.19445134130199,0.65591838217131,-1.03086797731589,-0.978484364671222,-1.33838580257048,-1.20270600830498

This is the code that I tried so far:

library(boral)
comu_rich = read.csv("comu_rich.csv", header = T, row.names = 1)
fq = read.csv("fq.csv", header =T, row.names = 1)

sodium = fq$Na.g.L.

mod_sodium = boral(y = comu_rich, X = sodium, family ="binomial",trial.size = 1, n.burnin = 20000, n.iteration = 100000,save.model = T, do.fit = T, model.name = "mod_sodium.txt")

mod_sodium_mcmc = as.mcmc(mod_sodium$jags.model)
traceplot(mod_sodium_mcmc) ##traceplot for cheking convergence

ic_sodium = mod_sodium$ics
    
asked by Cesar Alejandro Perez Fernande 21.02.2017 в 05:06
source

0 answers