Did I find the right examples for you? yes no

All Samples(8)  |  Call(7)  |  Derive(0)  |  Import(1)

src/n/i/nipy-0.3.0/nipy/labs/group/tests/test_spatial_relaxation_onesample.py   nipy(Download)
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import numpy as np
 
from ..spatial_relaxation_onesample import multivariate_stat
    XYZvol *= 0
    XYZvol[list(XYZ)] = np.arange(p)
    P = multivariate_stat(data)
    P.init_hidden_variables()
    P.evaluate(nsimu=100, burnin=100, J=[XYZvol[5, 5, 5]],
               compute_post_mean=True, verbose=verbose)
    P.log_likelihood_values = P.compute_log_region_likelihood()
    # Verify code consistency
    Q = multivariate_stat(data, vardata*0, XYZ, std=0, sigma=5)
                amplitude=1, noise=0, jitter=0, prng=prng)
    labels = (signal > 0).astype(int)
    P1 = multivariate_stat(data, labels=labels)
    P1.init_hidden_variables()
    P1.evaluate(nsimu=100, burnin=10, verbose=verbose)
    M1 = L1 + Prior1[:-1] - Post1[:-1]
    assert_almost_equal(M1.mean(), P1.compute_marginal_likelihood().mean(), 0)
    P0 = multivariate_stat(data, labels=labels)
    P0.network *= 0
    P0.init_hidden_variables()