MATLAB Answers

How can I treat a aleatory variable in Matlab?

2 views (last 30 days)
Mattia Michael  Margoni Bastian
Answered: Niraj Gadakari on 28 Sep 2017
I have the following basic optimal reinsurance model
min(x+ P(min(max(L-x,0),VaR-x))
subject to 0<=x<=VaR
where P(.) is a function that calculates the premium (a so called premium principle), L is a random number (a vector of values), VaR is a scalar and x is the priority of a limited stop-loss reinsurance (the variable I am looking for, a scalar). Now, I wish to apply the expected value premium principle, which is defined as:
where omega is the safety loading ( a scalar) and X is a random variable.
So, if I apply this premium principle to the optimization problem I come up with:
subject to 0<=x<=VaR
How can I implement the random variable in Matlab?
My idea was the following:
e = random('gamma',45,8,1,1000); % random distribution
L=sort(e); % sort the distribution to find VaR, a quantile
for j=1:20000
Is this simulation reasonable? Or are there other possibilities?
Thank you.

Answers (1)

Niraj Gadakari
Niraj Gadakari on 28 Sep 2017
I believe you can use the random function to implement a random variable in MATLAB.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!