[R] [Q] Bayeisan Network with the "deal" package
spencer.graves at pdf.com
Thu Apr 20 19:52:10 CEST 2006
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)': The first is class 'network',
while the second is of class 'list'.
However, class(ksl$node[]) is of class 'node'. Bingo:
hope this helps.
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.
> 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)
> and localposterior(ksl.nw$nodes).
> Can anyone tell me what I should do to access the local prior and posterior?
> Any help would be appreciated.
> Thanks in advance.
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help