R/bandle-utils.R
bandle-prior.Rd
Computes the Kullback-Leibler divergence between Polya-Gamma and Dirichlet priors
Compute the KL divergence between two Dirichlet distributions
A function to compute the prior predictive distribution of the Dirichlet prior.
A function to compute the prior predictive distribution of the Polya-Gamma prior.
the sigma parameter of the Polya-Gamma prior. A positive-definite symmetric matrix.
the mu parameter of the Polya-Gamma prior. A vector of means
The concentration parameter of the first Dirichlet distribution
The concentration parameter of the second Dirichlet distribution
An instance of class MSnSet
The feature column indiating the markers. Default is "markers"
Number of sample to use from prior predictive distribution. Default is 10000
The Dirichlet prior used. If NULL (default) will generate a a default Dirichlet prior. This should be a matrix with the same dimensions as the number of subcellular niches. The diagonal terms correspond to the prior probability of not differentially localising. The (i,j) term corresponds to prior probability of differntially localising between niche i and j.
The upper tail value. That is the prior probability of having more than q differential localisations. Default is 15.
An instance of class MSnSet
, usually the control dataset
An instance of class MSnSet
, usually the treatment dataset
The tau
parameter of the Polya-Gamma prior. Default is 0.2.
The lambda
ridge parameter used for numerical stability.
Default is 0.01
The mean of the Polya-Gamma prior. Default is NULL which generates a default Polya-Gamma prior.
returns a numeric indicating the KL divergence
a numeric indicating the KL divergence
A list contain the prior predictive distribution of differential localisations, the mean number of differential localised proteins and the probability than more than q are differentially localised
A list contain the prior predictive distribution of differential localisations, the mean number of differential localised proteins and the probability than more than q are differentially localised
kldirpg(sigma = diag(c(1,1,1)), mu = c(0,0,0), alpha = 1)
#> [1] -0.09793252
kldir(c(1,1), c(3,1))
#> [1] 0.9013877
library(pRolocdata)
data("tan2009r1")
out <- prior_pred_dir(object = tan2009r1)
library(pRolocdata)
data("tan2009r1")
set.seed(1)
tansim <- sim_dynamic(object = tan2009r1,
numRep = 6L,
numDyn = 100L)
d1 <- tansim$lopitrep
control1 <- d1[1:3]
treatment1 <- d1[4:6]
out <- prior_pred_pg(objectCond1 = control1[[1]],
objectCond2 = treatment1[[1]])