Create the Monte Carlo simulation data.
method: The simulation method.
distribution: The error distribution method.
fixed_error: The fixed value to use when distribution is set to `fixed'.
The method can either be set to back calculation (Monte Carlo) or direct (bootstrapping), the choice of which determines the simulation type. If the values or parameters are calculated rather than minimised, this option will have no effect. Errors should only be propagated via Monte Carlo simulations if errors have been measured.
For error analysis, the method should be set to back calculation which will result in proper Monte Carlo simulations. The data used for each simulation is back calculated from the minimised model parameters and is randomised using Gaussian noise where the standard deviation is from the original error set. When the method is set to back calculation, this function should only be called after the model is fully minimised.
The simulation type can be changed by setting the method to direct. This will result in bootstrapping simulations which cannot be used in error analysis (and which are no longer Monte Carlo simulations). However, these simulations are required for certain model selection techniques (see the documentation for the model selection user function for details), and can be used for other purposes. Rather than the data being back calculated from the fitted model parameters, the data is generated by taking the original data and randomising using Gaussian noise with the standard deviations set to the original error set.
The errors generated per simulation can either be generated indidual per datapoint and drawn from a gauss distrubtion described by the standard deviation of the indidual point, or it can be generated from a overall gauss distribution described by the standard deviation of the goodness of fit, where SD_fit = sqrt(chi2/(N-p)). The last possibility is to supply a fixed value of the standard deviation, from which gauss distribution to draw errors from.
For proper error analysis using Monte Carlo simulations, a sequence of function calls is required for running the various simulation components. The steps necessary for implementing Monte Carlo simulations are:
Monte Carlo simulations can be turned on or off using functions within this class. Once the function for setting up simulations has been called, simulations will be turned on. The effect of having simulations turned on is that the functions used for minimisation (grid search, minimise, etc) or calculation will only affect the simulation parameters and not the model parameters. By subsequently turning simulations off using the appropriate function, the functions used in minimisation will affect the model parameters and not the simulation parameters.
An example for model-free analysis using the prompt UI mode which includes only the functions required for implementing the above steps is:
[numbers=none] relax> minimise.grid_search(inc=11) # Step 2.
[numbers=none] relax> minimise.execute('newton') # Step 2.
[numbers=none] relax> monte_carlo.setup(number=500) # Step 3.
[numbers=none] relax> monte_carlo.create_data(method='back_calc') # Step 4.
[numbers=none] relax> monte_carlo.initial_values() # Step 5.
[numbers=none] relax> minimise.execute('newton') # Step 6.
[numbers=none] relax> eliminate() # Step 7.
[numbers=none] relax> monte_carlo.error_analysis() # Step 8.
An example for reduced spectral density mapping is:
[numbers=none] relax> minimise.calculate() # Step 2.
[numbers=none] relax> monte_carlo.setup(number=500) # Step 3.
[numbers=none] relax> monte_carlo.create_data(method='back_calc') # Step 4.
[numbers=none] relax> minimise.calculate() # Step 6.
[numbers=none] relax> monte_carlo.error_analysis() # Step 8.