sesameeg
.Particle¶
- class sesameeg.Particle(n_verts, lam, dip_mom_std=None, prior_locs=None, fixed_ori=False, hyper_q=False)[source]¶
Particle class for SESAME, used to store a single particle of an empirical pdf.
- Parameters:
- Attributes:
- compute_loglikelihood_unit(r_data, lead_field, noise_std=None)[source]¶
Evaluates the logarithm of the marginal likelihood in the present particle.
- Parameters:
- r_data
ndarray
offloat
, shape (n_sens, n_ist) The real part of the data; n_sens is the number of sensors and n_ist is the number of time-points or of frequencies.
- lead_field
ndarray
offloat
, shape (n_sens x n_comp*n_verts) The leadfield matrix. (n_comp = 1, if fixed orientation, 3, if free orientation)
- noise_std
float
The standard deviation of the noise distribution.
- r_data
- Returns:
- loglikelihood_unit
float
The logarithm of the likelihood function in the present particle.
- loglikelihood_unit
- evol_n_dips(n_verts, r_data, lead_field, max_n_dips, lklh_exp, noise_std, lam, q_birth=0.3333333333333333, q_death=0.05)[source]¶
- Perform a Reversible Jump Markov Chain Monte Carlo step in order
to explore the “number of sources” component of the state space. Recall that we are working in a variable dimension model.
- Parameters:
- n_verts
int
The number of the points in the given brain discretization.
- r_data
ndarray
offloat
, shape (n_sens, n_ist) The real part of the data; n_sens is the number of sensors and n_ist is the number of time-points or of frequencies.
- lead_field
ndarray
offloat
, shape (n_sens x n_comp*n_verts) The leadfield matrix. (n_comp = 1, if fixed orientation, 3, if free orientation)
- max_n_dips
int
The maximum number of dipoles allowed in a particle.
- lklh_exp
float
This number represents a point in the sequence of artificial distributions used in SESAME.
- noise_std
float
The standard deviation of the noise distribution.
- lam
float
Parameter of the Poisson probability distribution used for determining the number of dipoles in the particle.
- q_birth
float
Probability of proposing to add a dipole. We recommend to use the default value q_birth = 1/3.
- q_death
float
Probability of proposing to remove a dipole. We recommend to use the default value q_death = 1/20.
- n_verts
- Returns:
- selfinstance of
Particle
The possibly modified particle instance.
- selfinstance of
- evol_single_loc(dip_idx, neigh, neigh_p, r_data, lead_field, lklh_exp, noise_std, lam)[source]¶
- Perform a Markov Chain Monte Carlo step in order to explore the
dipole location component of the state space. The dipole is allowed to move only to a restricted set of brain points, called “neighbours”, with a probability that depends on the point.
- Parameters:
- dip_idx
int
index of the Particle.dipoles array.
- neigh
ndarray
ofint
The neighbours of each point in the brain discretization.
- neigh_p
ndarray
offloat
The neighbours’ probabilities.
- r_data
ndarray
offloat
, shape (n_sens, n_ist) The real part of the data; n_sens is the number of sensors and n_ist is the number of time-points or of frequencies.
- lead_field
ndarray
offloat
, shape (n_sens x n_comp*n_verts) The leadfield matrix. (n_comp = 1, if fixed orientation, 3, if free orientation)
- lklh_exp
float
This number represents a point in the sequence of artificial distributions used in SESAME.
- noise_std
float
The standard deviation of the noise distribution.
- lam
float
Parameter of the Poisson probability distribution used for determining the number of dipoles in the particle.
- dip_idx
- Returns:
- selfinstance of
Particle
The possibly modified particle instance.
- selfinstance of