spatialtis_core.spatial_de.somde.util#

Module Contents#

spatialtis_core.spatial_de.somde.util.LL(delta, UTy, UT1, S, n, Yvar=None)#

Log-likelihood of GP model as a function of delta.

The parameter delta is the ratio s2_e / s2_t, where s2_e is the observation noise and s2_t is the noise explained by covariance in time or space.

spatialtis_core.spatial_de.somde.util.SE_kernel(X, l)#
spatialtis_core.spatial_de.somde.util.brent_max_LL(UTy, UT1, S, n)#
spatialtis_core.spatial_de.somde.util.const_fits(exp_tab)#

Get maximum LL for const model

spatialtis_core.spatial_de.somde.util.cosine_kernel(X, p)#

Periodic kernel as l -> oo in [Lloyd et al 2014]

Easier interpretable composability with SE?

spatialtis_core.spatial_de.somde.util.dyn_de(X, exp_tab, kernel_space=None)#
spatialtis_core.spatial_de.somde.util.factor(K)#
spatialtis_core.spatial_de.somde.util.get_UT1(U)#
spatialtis_core.spatial_de.somde.util.get_UTy(U, y)#
spatialtis_core.spatial_de.somde.util.get_l_limits(X)#
spatialtis_core.spatial_de.somde.util.get_mll_results(results, null_model='const')#
spatialtis_core.spatial_de.somde.util.gower_scaling_factor(K)#

Gower normalization factor for covariance matric K

Based on https://github.com/PMBio/limix/blob/master/limix/utils/preprocess.py

spatialtis_core.spatial_de.somde.util.lbfgsb_max_LL(UTy, UT1, S, n, Yvar=None)#
spatialtis_core.spatial_de.somde.util.lengthscale_fits(exp_tab, U, UT1, S, Gower, num=64)#

Fit GPs after pre-processing for particular lengthscale

spatialtis_core.spatial_de.somde.util.linear_kernel(X)#
spatialtis_core.spatial_de.somde.util.logdelta_prior_lpdf(log_delta)#
spatialtis_core.spatial_de.somde.util.make_FSV(UTy, S, n, Gower)#
spatialtis_core.spatial_de.somde.util.make_objective(UTy, UT1, S, n, Yvar=None)#
spatialtis_core.spatial_de.somde.util.mu_hat(delta, UTy, UT1, S, n, Yvar=None)#

ML Estimate of bias mu, function of delta.

spatialtis_core.spatial_de.somde.util.null_fits(exp_tab)#

Get maximum LL for null model

spatialtis_core.spatial_de.somde.util.qvalue(pv, pi0=None)#
spatialtis_core.spatial_de.somde.util.regress_out(sample_info, expression_matrix, covariate_formula, design_formula='1', rcond=- 1)#
spatialtis_core.spatial_de.somde.util.s2_t_hat(delta, UTy, S, n, Yvar=None)#

ML Estimate of structured noise, function of delta

spatialtis_core.spatial_de.somde.util.search_max_LL(UTy, UT1, S, n, num=32)#

Search for delta which maximizes log likelihood.

spatialtis_core.spatial_de.somde.util.simulate_const_model(MLL_params, N)#
spatialtis_core.spatial_de.somde.util.stabilize(expression_matrix)#