Professional Documents
Culture Documents
The green and purple lines represent the first and second individual
component of the mixture model. The red line represents the entire mixture
model and the blue line represents the ksdensity of the sampled values from
the yellow dots on the x-axis.
It is clear from the above plot that the ksdensity function used to estimate the
target distribution is quite sufficient. At the peak of the first distribution there is
a slight error and towards the second peak the ksdensity estimates veers
away from the target distribution. However, considering only 10000 samples
were used, this is a fair estimate of the mixture model. It should be noted that
if less samples were used, then the estimate of the distribution would not be
as efficient, which is evident when the number of samples is changed to 1000.
The speed of this sampling technique is still considerably fast when
generating 1000 to 10000 samples, which was an unexpected result. All in all,
sampling from this mixture model is quite efficient and easy to implement
which was an unexpected result. It will be interesting to compare this method
to rejection sampling or importance sampling later on in the report.