Dear R-users I am looking for a help in using the "deal" package. I followed the manual and paper from the author's web site to learn it, as shown below, but I could not figure out how to access the local and posterior probability of the nodes in the constructed network. library(deal) data(ksl) ksl.nw <- network(ksl) ksl.prior <- jointprior(ksl.nw) banlist <- matrix(c(5,5,6,6,7,7,9, 8,9,8,9,8,9,8), ncol = 2) ksl.nw$banlist <- banlist ksl.nw <- learn(ksl.nw, ksl, ksl.prior)$nw According to the manual, the local prior and posterior can be accessed for each node using localprior() and localposterior(). However, I got null from localprior(ksl.nw$nodes[1]) and localposterior(ksl.nw$nodes[1]). Can anyone tell me what I should do to access the local prior and posterior? Any help would be appreciated. Thanks in advance. Young-Jin [[alternative HTML version deleted]]
Dear Young-Jin Lee Please note that there is a 'deal' mailing list, see http://www.math.aau.dk/~dethlef/novo/deal R> I followed the manual and paper from the author's web site to learn it, as R> shown below, but I could not figure out how to access the local and R> posterior probability of the nodes in the constructed network. To access the prior and posterior distributions, use localprior( nodes(ksl.nw)[[1]] ) localposterior( nodes(ksl.nw)[[1]] ) Best, Claus
Thanks for providing such a simple, complete example. I've never used "deal" before, but a few minutes with your example led me to something that might help you: First, the documentation for "localprior" says, "x: an object of class 'node' or 'network'." That information led me to checking 'class(ksl)' and 'class(ksl$node[1])': The first is class 'network', while the second is of class 'list'. However, class(ksl$node[[1]]) is of class 'node'. Bingo: > localprior(ksl.nw$nodes[[1]]) [[1]] [[1]]$alpha [1] NA [[1]]$nu [1] 64 [[1]]$rho [1] 64 [[1]]$mu [1] 179.289 [[1]]$phi [,1] [1,] 113442.3 [[1]]$tau [1] 64 hope this helps. spencer graves Young-Jin Lee wrote:> Dear R-users > > I am looking for a help in using the "deal" package. > I followed the manual and paper from the author's web site to learn it, as > shown below, but I could not figure out how to access the local and > posterior probability of the nodes in the constructed network. > > library(deal) > data(ksl) > ksl.nw <- network(ksl) > ksl.prior <- jointprior(ksl.nw) > banlist <- matrix(c(5,5,6,6,7,7,9, > 8,9,8,9,8,9,8), ncol = 2) > ksl.nw$banlist <- banlist > ksl.nw <- learn(ksl.nw, ksl, ksl.prior)$nw > > According to the manual, the local prior and posterior can be accessed for > each node using localprior() > and localposterior(). However, I got null from localprior(ksl.nw$nodes[1]) > and localposterior(ksl.nw$nodes[1]). > Can anyone tell me what I should do to access the local prior and posterior? > > Any help would be appreciated. > Thanks in advance. > > Young-Jin > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
I am also looking for a help in using the "deal" package. When I try this, I get an error saying "Error in array(1, Dim) : 'dim' specifies too large an array" ksl.prior <- jointprior(ksl.nw) Does anyone know what the error indicates ? My data is gene expression values with about 58 rows (samples) and 20 columns (features) -- View this message in context: http://r.789695.n4.nabble.com/Q-Bayeisan-Network-with-the-deal-package-tp797813p4536014.html Sent from the R help mailing list archive at Nabble.com.