Description Usage Arguments Details Value Author(s) See Also Examples
get.phi.final
takes the output of netga
and constructs a final network
from the population, get.phi.final.mcmc
takes a list containing the returned lists of
mcmc_ddepn
and calculates a final network for each result list.
1 2 | get.phi.final(lst, th = 0.8)
get.phi.final.mcmc(retlist,maxiterations,prob=.333,qu=.99999)
|
lst |
Output list from |
th |
Double in [0;1]. Threshold for inclusion of an edge into the final network. |
retlist |
A list returned by MCMC inference. |
maxiterations |
Integer. Number of MCMC sampling iterations. |
prob |
Double \in [0;1].Success probability for binomial density. |
qu |
Double \in [0;1]. Quantile of the binomial distribution, used as significance cutoff for edge inclusion. |
get.phi.final
Takes the population P from the GA resultlist and returns the list with the element lst$phi
replaced by the new final network. lst$weights only contains the weights
with lst$weights > th.
get.phi.final.mcmc
Takes a list of MCMC samplings returned by mcmc_ddepn
and extracts a final network for
each result. It is assumed that any type of edge is expected to be found with probability 1/3=0.33, thus
for maxiterations
samplings we expect the probability of seeing exactly k
edges of a certain
type follows a binomial distribution B(maxiterations, prob, k)
. An edge is included, if the
probability of seeing more than the observed number of occurrences is less or equal than 1-qu
,
i.e. P(k>Kobserved) <= 1-qu.
Result list as in netga
, with replaced phi and weights elements.
Christian Bender
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Not run:
## load package
library(ddepn)
## sample a network
n <- 6
signet <- signalnetwork(n=n, nstim=2, cstim=0, prop.inh=0.2)
phit <- signet$phi
stimuli <- signet$stimuli
## sample data
dataset <- makedata(phit, stimuli, mu.bg=1200, sd.bg=400, mu.signal.a=2000, sd.signal.a=1000)
## Genetic algorithm
ret1 <- ddepn(dataset$datx, phiorig=phit, inference="netga",
maxiterations=30, p=15, q=0.3, m=0.8, P=NULL,
usebics=TRUE)
plotrepresult(ret1,outfile=NULL)
ret2 <- get.phi.final(ret1, th=0.9)
plotrepresult(ret2,outfile=NULL)
## mcmc
maxiterations <- 300
## use original network as prior matrix
## reset all entries for inhibiting edges
## to -1
B <- phit
B[B==2] <- -1
ret3 <- ddepn(dataset$datx,phiorig=phit,
inference="mcmc", usebics=FALSE,
maxiterations=maxiterations, burnin=100, lambda=0.01, B=B)
plotrepresult(ret3$samplings[[1]],outfile=NULL)
ret4 <- get.phi.final(ret3$samplings[[1]],th=0.9)
plotrepresult(ret4,outfile=NULL)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.