normcdf and norminv for symbolic function

I've to compute a particular density function and to get it I wanted to differentiate its Cdf. The Cdf depends on the function normcdf and norminf but Matlab returns Errors on multiple stuff! I suppose the problem is on the normcdf and norminv function but I tried different way to handle the problem unsuccessfully
syms x
cond = x>0 & x<=1;
assume(cond)
Cdf= normcdf(-(k-sqrt(1-rho)*norminv(x))/sqrt(rho)); % k and rho are constants I've previously defined in my code
density= diff(Cdf,x);

 採用された回答

Torsten
Torsten 2018 年 3 月 29 日
編集済み: Torsten 2018 年 3 月 29 日

0 投票

fun = -(k-sqrt(1-rho)*norminv(x))/sqrt(rho);
density = 1/sqrt(2*pi)*exp(-fun^2/2)*diff(fun,x)
Best wishes
Torsten.

3 件のコメント

Virginie Marchionni
Virginie Marchionni 2018 年 3 月 29 日
It returns the following errors
  1. Error using symengineUnable to prove 'x < 0 | 1 < x' literally. Use 'isAlways' to test the statement mathematically.
  2. Error in sym/subsindex (line 832) X = find(mupadmex('symobj::logical',A.s,9)) - 1;
  3. Error in sym/privsubsasgn (line 1107) L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
  4. Error in sym/subsasgn (line 944) C = privsubsasgn(L,R,inds{:});
  5. Error in norminv (line 57)p(p < 0 | 1 < p) = NaN;
I've imposed at the beginning the following condition on x
syms x
cond = x>0 & x<=1;
assume(cond)
Torsten
Torsten 2018 年 3 月 29 日
And what happens if you remove this condition ?
Virginie Marchionni
Virginie Marchionni 2018 年 3 月 29 日
The same errors

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMeasurements and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by