Clear Filters
Clear Filters

Can't manage to set up an optimization problem in Matlab 2021b from Excel

4 views (last 30 days)
Hi, I will use silly data to explain my problem. I would like to estimate the parameters (mu and sigma in my example) of a statistical distribution with simulations (bootstrap). Let assume that I have the vector x of the observed data, sampled from a distribution with unknown population parameters mu and sigma:
mu = 50;
sigma = 1;
N = 100;
x = norminv(rand(N,1),mu,sigma) % my observations vector – simulated only for only for exemplification purpose
I would like to estimate the population parameters by simulating nSimul = 1000 extractions from the same distribution (in this case normal distribution) where the initial parameters are set equals to mu0and sigma0 by minimizing the sum of the absolute difference between or the sum of the squared difference between the observed vector and the simulated vector.
To explain myself better, in Excel I did like this:
I know that for the normal distribution it does not make sense, BUT I am interested in a more complicated statistical distribution and the main issue I am not able to overcome is the optimization problem setting with matlab, i.e. how to:
Minimize the sum of absolute differences between observations and the simulated vector by changing the parameters mu and sigma, starting from mu0 and sigma0, subject to a constraint (es. non negativity for the variance).

Answers (1)

Cris LaPierre
Cris LaPierre on 24 Dec 2021
I would look into problem based optimization with MATLAB (requires Optimization Toolbox).
Here's a link to a quick-start "cheat sheet.
For more detailed help, see the related documentation.

Categories

Find more on Problem-Based Optimization Setup in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!