medil.models.NeuroCausalFactorAnalysis.sample

NeuroCausalFactorAnalysis.sample(sample_size: int, include_latent: bool = False) numpy.typing.NDArray[source]

Sample observations from a fitted NeuroCausalFactorAnalysis model.

Parameters:
  • sample_size (int) – Number of samples to generate.

  • include_latent (bool, optional) – If True, also return the latent codes z drawn from the prior. Note: z has shape (sample_size, num_latent * latent_width).

Returns:

  • sample (ndarray of shape (sample_size, num_meas))

  • latent_sample (ndarray of shape (sample_size, latent_dim), only if include_latent=True)