MultivariateRejectionSampler Class#

class rocketpy.MultivariateRejectionSampler[source]#

Class that performs Multivariate Rejection Sampling (MRS) from MonteCarlo results.

The class currently assumes that all input variables are sampled independently when performing the Monte Carlo Simulation.

__init__(monte_carlo_filepath, mrs_filepath)[source]#

Initializes Multivariate Rejection Sampler (MRS) class

Parameters:
  • monte_carlo_filepath (str) – Filepath prefixes to the files created from a MonteCarlo simulation results and used as input for resampling.

  • mrs_filepath (str) – Filepath prefix to MRS obtained samples. The files created follow the same structure as those created by the MonteCarlo class but now containing the selected sub-samples.

Return type:

None

sample(distribution_dict)[source]#

Performs rejection sampling and saves data

Parameters:

distribution (dict) – Dictionary whose keys contain the name whose distribution changed. The values are tuples or lists with two entries. The first entry is a probability density (mass) function for the old distribution, while the second entry is the probability density function for the new distribution.

Return type:

None