use of dblquad with conditions over the domain of the variables.

1 次查看(过去 30 天)
Good afternoon,
I have the following problem,
Imagine you have 2 normal random variables, x and y, independent from each other. I want to calculate the expected value of x, given that (silly example) x*y is above 0.05.
This requires a double integral over the x and y that satisfy the condition. I tried by
Ex=dblquad(@integrand,-10,10,-10,10);
where, inside the function "integrand" I told matlab that if the condition is satisfied x*y>0.05, take the value of z=x*fx*fy, and if not z=[].
But the code does not work because dblquad does not accept empty vectors arising from "integrand".
Would you have any suggestion? A different approach?
Many thanks, Luis.
  2 个评论
Elif
Elif 2013-3-11
Hi there,
The way I see it you should explicit the constraints in the call to dblquad.
Rather than writing -10,10 call another function that captures the x and y's you want to use.
Maybe someone else can point out more about this.
Hope it helps.
Luis
Luis 2013-3-11
编辑:Luis 2013-3-11
Thanks Elif,
You mean I should do something like
dblquad(@integrand,'lowerlimitx',10,'lowerlimity',1)?
The real problem I have is a double integral where two variables are constrained i.e. x\in(4,10) and y\in(0,1). But there is another constraint because x must also be such that V(x,y)>0 as well as y itself. Does it make sense?

请先登录,再进行评论。

回答(1 个)

Elif
Elif 2013-3-11
编辑:Elif 2013-3-11
Ok, so clearly the outer variable depends on the inner variable and viceversa.
I think dblquad is unable in this case to obtain a solution.
You might want to consider a change of variable.

类别

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