フィルターのクリア

Numerical Double Integral in Matlab

4 ビュー (過去 30 日間)
Prerna Mishra
Prerna Mishra 2022 年 9 月 22 日
コメント済み: Walter Roberson 2022 年 9 月 23 日
I have to do the following integration in matlab
b is log normally distributed and I have a vector of 100 random number for b call b_rand.
a is a vector of numbers that denotes a Markovian transition probability matrix
[0.1680 0.4098 1.0000 2.4400 5.9537]
I wrote the code as follows, but I am not confident I am doing the right thing. Could someone help?
inner_term = W_t./b
outer_term = a
final_term = inner_term.*outer_term
integral = mean(mean(outer_term)
  8 件のコメント
Torsten
Torsten 2022 年 9 月 23 日
編集済み: Torsten 2022 年 9 月 23 日
If I have a sufficiently long vector of log normally distributed random variables, it is possible to use the trapeziod rule, i.e say if I have a vector of 100 variables with the lbounds being the lowest and highest value in the vector.
Sorry, but this is nonsense. How does the fact that the values for b are generated from a lognormal distribution influence the integral ? b is the independent, not the dependent variable. If you use the trapezoidal rule, you will get the same value as if you use a uniform grid between b_l and b_h.
And how can you Markovian transition probability matrix have values greater than 1 ?
Walter Roberson
Walter Roberson 2022 年 9 月 23 日
you will not get the same value, but for a sufficiently dense random sample the value will approach what you would get with a comparably dense uniform grid.

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

回答 (1 件)

Chunru
Chunru 2022 年 9 月 23 日
It seems that the integration is separatable into two 1-D integrations:
inner_term = W_t./b
outer_term = a
final_term = inner_term.*outer_term
integral = trapz(b, inner_term) * trapz(a, outer_term)
  1 件のコメント
Prerna Mishra
Prerna Mishra 2022 年 9 月 23 日
It is separable, yes. I will try it out this way.

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

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by