How to find the maximum of mu by solving eqn
1 次查看(过去 30 天)
显示 更早的评论
Hi, Can anyone please help me how to do this? Find the maximum of mu by solving eqn. Thank you so much.
sigma = 1;
syms mu
n = 5;
lambda = 1;
U = normrnd(0,1,n,1);
V = normrnd(0,1,n,1);
W = (lambda/sqrt(1+lambda^2))*abs(U) + (1/sqrt(1+lambda^2))*V
W_bar = sum(W)/n
eqn = (W_bar - mu)/sigma == lambda*sum(normpdf(lambda*(W-mu)/sigma)/normcdf(lambda*(W-mu)/sigma));
sol = solve(eqn,mu)
0 个评论
采纳的回答
Reza Bonyadi
2017-10-25
I think you are after
eqn = ((W_bar - mu)/sigma) - lambda*sum(normpdf(lambda*(W-mu)/sigma)./normcdf(lambda*(W-mu)/sigma))
rather than
eqn = ((W_bar - mu)/sigma) - lambda*sum(normpdf(lambda*(W-mu)/sigma)/normcdf(lambda*(W-mu)/sigma));
and then solve(eqn==0,mu). Note that the first equation returns a unique value while the second is actually a vector.
Does that make sense?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!