MATLAB: How to make a probability distribution that is composed of several normal distributions added and subtracted together

composition of distributionsdistributiongaussian mixture distributionMATLABnormal distributionprobability density functionprobability distributionsStatistics and Machine Learning Toolbox

I'd like to simulate picking values from a multidimensional mixture of distributions both added and subtracted together. I've looked into the gmdistribution, but this will only allow positive mixing proportions- I'd like something that will allow me to start with a basic normal distribution, and make certain areas of it more likely and certain areas less likely.
Is there any way to do this? If so, what is the best way?

Best Answer

A lot depends on exactly what you mean by “subtracted”, but here are a few thoughts.
In general, you can decrease the probability in certain regions by giving lower probability to the mixture distribution components including those regions and higher probability to the components that do not include them.
For example, suppose you wanted a normal(0,1) distribution but you wanted to exclude 15% of the scores in the tails, z>1 (i.e., you want to “subtract” these scores because they would sometimes be missed, e.g., due to limitations in the measuring instruments). You could achieve that by assigning a 85% mixture proportion to the normal(0,1) and a 15% mixture proportion to a truncated normal(0,1), with truncation boundaries -1 and +1. I’m sure you could do this with MATLAB built-ins, but I would do it like this with these routines at (shameless plug) GitHub.
myDist = Mixture(.85,Normal(0,1),.15,TruncatedX(Normal(0,1),-1,1));
myDist.PlotDens; % See attached plot of PDF/CDF
Depending on exactly what you want to add and subtract, it might be pretty complicated to get the desired overall result, but maybe this gives you a way to get started.