MATLAB Answers

Pankaj
0

Generating truncated Normal random and pdf using makedist with fixed sigma.

Asked by Pankaj
on 22 Feb 2016
I am finding it difficult to even describe my doubt may be someone get a clue from the code. I want to generate Truncated Normal Random number from a distribution, for that purpose I have to define a pd . I can define mu and sigma for a pd, but what if I only want to define sigma only and want to provide mu as input every time. The following is not working for me:
MU{1} = 0.015;
MU{2} = 0.0001;
SIGMA{1} = 0.0001;
SIGMA{2} = 0.00005;
pd{1} = @(x) makedist('Normal', 'mu', x, 'sigma', SIGMA{1});
pd{2} = @(x) makedist('Normal', 'mu', x, 'sigma', SIGMA{2});
jumpRandX{1} = random(pd{1}, MU{1},[200, 1]);
jumpRandX{2} = random(pd{2}, MU{2},[200, 1]);

  0 Comments

Sign in to comment.

0 Answers