Minimizing expected value using a multivariate normal distribution
Afficher commentaires plus anciens
I am trying to minimise the expected value of this function w.r.t the variable Q :

where f(D) is the probability density function of a multivariate normal distribution,c0 and cu parameters.
This is what I have done so far :
syms X1
syms X2
syms X3
c0 = 1 ;
cu = 1 ;
x = [X1; X2; X3] ;
mu = [3; 5; 7 ] ;
sigma = [4,3,6;3,8,5;6,5,10] ;
s = mvnpdf(x,mu,sigma)
syms Q
syms D
f = (Q-D).*s ;
z = c0.*int(f,D,0,Q) ;
anon_z = matlabFunction(z) ;
g = (D-Q).*s ;
t = cu.*int(g,D,Q,inf) ;
anon_t = matlabFunction(t) ;
tot = @(Q) anon_z(Q) + anon_t(Q) ;
[x fx] = fminsearch(tot,0)
It gives me this errors :
Error in
symengine>@(Q,X1,X2,X3)Q.^2.*exp(conj(X1).*conj(X3).*(3.0./2.0)).*exp(conj(X2).*conj(X3).*(1.0./1.1e1)).*exp(conj(X1).*-3.0).*exp(conj(X2).*(3.0./1.1e1)).*exp(conj(X3).*(2.6e1./1.1e1)).*exp(conj(X1).^2.*(-5.0./4.0)).*exp(conj(X2).^2.*(-1.0./1.1e1)).*exp(conj(X3).^2.*(-2.3e1./4.4e1)).*exp(-8.75688228083863).*(1.0./2.0)
Error in @(Q)anon_z(Q)+anon_t(Q)
Error in fminsearch (line 189)
fv(:,1) = funfcn(x,varargin{:});
Error in multi_3giocatori (line 19)
[x fx] = fminsearch(tot,0)
can you help me fix this?
Réponses (0)
Catégories
En savoir plus sur Operations on Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!