How to solve for upper limit of integral?

1 次查看(过去 30 天)
I am supposed to find the 75th percentile under a distribution. I have the function F defined below. I tried typing in values between 0 and 1 (n) to find the 75th percentile (when g=.75) and I came upon .6745 for n. This is a very unscientific way to solve it. Maybe my calculus skills are poor but can someone tell me how to solve for n mathematically?
Basically I have to solve the integral of (1/sqrt(2*pi))*exp((-x^2)/2) = .75, from -infinity to "n" Lower limit is infinity - how do I solve upper limit "n"? Again it may be really easy and I may be spacing out on my basic calculus and Matlab skills.
syms x
f=(1/sqrt(2*pi))*exp((-x^2)/2)
y=int(f,x,-inf,.6745)
g=double(y)

采纳的回答

John D'Errico
John D'Errico 2015-2-23
The really quick quick answer is norminv, if you have the stats toolbox. The slightly longer answer is erfcinv, which just requires you to transform the problem slightly.

更多回答(2 个)

AJ
AJ 2015-2-23
Thanks John!
x = norminv([0.00 0.75],0,1)
returns just the answer I was looking for!

muhammad Fahad
muhammad Fahad 2023-3-21
write matlab code for this
  1 个评论
Steven Lord
Steven Lord 2023-3-21
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by