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

1 次查看(过去 30 天)
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).

回答(1 个)

Cris LaPierre
Cris LaPierre 2021-12-24
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.

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by