How to optimise taxes

2 visualizzazioni (ultimi 30 giorni)
Joao Pereira
Joao Pereira il 6 Gen 2020
Commentato: Joao Pereira il 6 Gen 2020
Hi everyone
I have working on a code which would allow me to look the optimal level of taxes the goverment could apply, so I have created both demand and supply functions and I have used fmincon but I do not know how can set Government tax= T*Q.
Should I create another function?
This is what I have so far:
function [x, fval, expected_return] = effportfolio(fun, Sigma, mu, mu_p_0, initial_guess, optimisation_options)
%EFFPORTFOLIO solves for the efficient portfolio
%optimisation_options
if nargin<6
optimisation_options=[];
end
%% constraints
Aeq = [mu' ; ones(1,length(mu))];
beq = [mu_p_0;1];
%% Minimisation
if strcmp(fun, 'quadprog')
[x, fval] = quadprog(Sigma, [], [], [], Aeq, beq) ;
else
[x, fval] = fmincon(@effportobj, initial_guess, [], [], Aeq, beq, [], [], [], optimisation_options, Sigma) ;
end
expected_return = x'*mu;
end
function z = effportobj(x, Sigma)
z = x'*Sigma*x;
end
function fun = myfun2
fun{1} = @(P) 1*Q+10+T;
fun{2} = @(P) -3*Q+90;
end
Thank you very much
  1 Commento
Joao Pereira
Joao Pereira il 6 Gen 2020
I have also find this example which I think it may be
https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.mathworks.com%2Fhelp%2Foptim%2Fug%2Fexample-nonlinear-constrained-minimization.html%3Ffbclid%3DIwAR0yYyblrh29WZ9HcUwnH0l68qsyp5rF1fRAiZcBtDW4eVd2t0TTrGytOuo&h=AT249AnzXCK9gaJYHhNeD0A2_3uTNILsHWjcjuog7SpK5EO9HUjSFH38YFT0s6H40pg3c395KjFsTH57folQs_Mgbq0UFMBkyJOkbMA433GUG-bW0nFNRxtWv1Lv9d-PKJcXDg

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by