Inheritance diagram for nipy.labs.group.spatial_relaxation_onesample:
Bases: object
Methods
compute_conditional_posterior_mean([v, ...]) | Compute posterior mean of mean effect map, |
compute_log_conditional_displacements_posterior([...]) | Compute posterior log density of elementary displacements at point U, conditional on model parameters |
compute_log_conditional_posterior([v, ...]) | compute log posterior density of model parameters, conditional on hidden parameters. |
compute_log_posterior([v, m_mean, m_var, ...]) | compute log posterior density of region parameters by Rao-Blackwell method, |
compute_log_prior([v, m_mean, m_var, std]) | compute log prior density of model parameters, spatial uncertainty excepted, |
compute_log_region_likelihood([v, m_mean, m_var]) | |
compute_log_region_likelihood_slow([v, ...]) | Essentially maintained for debug purposes |
compute_log_voxel_likelihood([v, m_mean, ...]) | |
compute_marginal_likelihood([v, m_mean, ...]) | |
estimate_displacements_SA([nsimu, c, ...]) | MAP estimate of elementary displacements conditional on model parameters |
evaluate([nsimu, burnin, J, verbose, ...]) | Sample posterior distribution of model parameters, or compute their MAP estimator |
init_hidden_variables([mode, init_spatial]) | |
sample_log_conditional_posterior([v, ...]) | sample log conditional posterior density of region parameters |
update_block(i, b[, proposal, proposal_std, ...]) | |
update_block_SA(i, b[, T, proposal_std, ...]) | Update displacement block using simulated annealing scheme |
update_displacements() | |
update_displacements_SA([T, proposal_std, ...]) | |
update_effects([T]) | T is a temperature used to compute log posterior density |
update_labels() | |
update_mean_effect([T]) | T is a temperature used to compute log posterior density |
update_parameters_mcmc([update_spatial]) | |
update_parameters_saem([update_spatial]) | |
update_summary_statistics([w, ...]) |
Multivariate modeling of fMRI group data accounting for spatial uncertainty In: data (n,p) estimated effects
vardata (n,p) variances of estimated effects XYZ (3,p) voxel coordinates std <float> Initial guess for standard deviate of spatial displacements sigma <float> regularity of displacement field labels (p,) labels defining regions of interest network (N,) binary region labels (1 for active, 0 for inactive) v_shape <float> intensity variance prior shape v_scale <float> intensity variance prior scale std_shape <float> spatial standard error prior shape std_scale <float> spatial standard error prior scale m_mean_rate <float> mean effect prior rate m_var_shape <float> effect variance prior shape m_var_scale <float> effect variance prior scale disp_mask (q,) mask of the brain, to limit displacements labels_prior (M,r) prior on voxelwise region membership labels_prior_values (M,r) voxelwise label values where prior is defined labels_prior_mask (r,) Mask of voxels where a label prior is defined
Compute posterior mean of mean effect map, conditional on parameters and displacements
Compute posterior log density of elementary displacements at point U, conditional on model parameters
compute log posterior density of model parameters, conditional on hidden parameters. This function is used in compute_log_region_posterior. It should only be used within the Gibbs sampler, and not the SAEM algorithm.
compute log posterior density of region parameters by Rao-Blackwell method, or a stabilized upper bound if stabilize is True.
compute log prior density of model parameters, spatial uncertainty excepted, assuming hidden variables have been initialized
Essentially maintained for debug purposes
MAP estimate of elementary displacements conditional on model parameters
Sample posterior distribution of model parameters, or compute their MAP estimator In: nsimu <int> Number of samples drawn from posterior mean distribution
burnin <int> Number of discarded burn-in samples J (N,) voxel indices where successive mean values are stored verbose <bool> Print some infos during the sampling process proposal <str> ‘prior’, ‘rand_walk’ or ‘fixed’ proposal_mean <float> Used for fixed proposal only proposal_std <float> Used for random walk or fixed proposal mode <str> if mode=’saem’, compute MAP estimates of model parameters.
if mode=’mcmc’, sample their posterior distributionupdate_spatial <bool> when False, enables sampling conditional on spatial parameters
Out: self.m_values (N, nsimu+burnin) successive mean values (if J is not empty) if self.labels_prior is not empty:
self.labels_post (M,r) posterior distribution of region labels
sample log conditional posterior density of region parameters using a Gibbs sampler (assuming all hidden variables have been initialized). Computes posterior mean. if stabilize is True, sampling is conditioned on the parameters, reducing the variance of the estimate, but introducing a positive bias.
Update displacement block using simulated annealing scheme with random-walk kernel
T is a temperature used to compute log posterior density by simulated annealing
T is a temperature used to compute log posterior density by simulated annealing
log density of the inverse gamma distribution with shape a and scale b, at point x, using Stirling’s approximation for a > 100
log density of the gaussian distribution with mean m and variance v at point x