plotting the probit model

11 ビュー (過去 30 日間)
Deokjae Jeong
Deokjae Jeong 2017 年 1 月 7 日
コメント済み: Star Strider 2017 年 1 月 8 日
I tried to plot the probit function as below.
I wrote a code which does not work. y above is equivalent to p below. t above is equivalent to z below. (please ignore i)
i
syms x p z a b
p=(1/sqrt(2*pi))*(int(exp(-(z^2)/2),z,-inf,a+b*x))
a=3.9833
b=0.04846
p=subs(p)
plot(x,p)
The result says that
i
p =
0.50000000000000003123668917430668*erf(0.034266394616300093032464917787601*x + 2.8166184415003747539458833475722) + 0.50000000000000003123668917430668
Error using plot
Non-numeric data is not supported in 'Line'
I have not heard of 'erf', and I searched it.

採用された回答

Star Strider
Star Strider 2017 年 1 月 7 日
Try this:
syms x p z a b
a = sym(3.9833);
b = sym(0.04846);
p = (1/sqrt(2*pi))*(int(exp(-(z^2)/2),z,-inf,a+b*x));
figure(1)
fplot(x,p, [-10 10])
grid
You can also use ezplot if you don’t have fplot, but with ezplot, you have to limit the y-axis with:
set(gca, 'Ylim',[0.9997 0.9999])
  2 件のコメント
Deokjae Jeong
Deokjae Jeong 2017 年 1 月 8 日
Thank you so much ! It works greatly.
Star Strider
Star Strider 2017 年 1 月 8 日
My pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by