Dear R-helpers,
I'm looking for a quick way to calculate triple integrals.
I have tried something like this example:
f <- function(x,y,z) dnorm(x)*dnorm(y)*dnorm(z)
llim <- -Inf
ulim <- Inf
integrate(function(z)
{
sapply(z,function(z)
{
integrate(function(y)
{
sapply(y, functio
On Aug 30, 2015, at 8:41 AM, Shant Ch via R-help wrote:
> Thank you very much to all for all your responses.
>
> @Dr. Winsemius, E[f(X)] >=f(E(X)) if f is convex. Now we know |x| is convex
> function, so clearly in this scenario if we compute the expectation of the
> ((X1+X2+X3)/3-X4) and then
X4 is being subtracted, not added.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.
On Aug 29, 2015, at 11:35 AM, Shant Ch via R-help wrote:
> Hello Dr. Berry,
>
> I know the theoretical side but note we are not talking about expectation of
> sums rather expectation of ABSOLUTE value of the function
> (X1/3+X2/3+X3/3-X4), i.e. E|X1/3+X2/3+X3/3-X4| , I don't think this can
>
On 8/29/2015 4:00 PM, Charles C. Berry wrote:
On Sat, 29 Aug 2015, Shant Ch wrote:
Hello Dr. Berry,
I know the theoretical side but note we are not talking about
expectation of sums rather expectation of ABSOLUTE value of the
function (X1/3+X2/3+X3/3-X4), i.e. E|X1/3+X2/3+X3/3-X4| , I don'
Hello Dr. Berry,
I know the theoretical side but note we are not talking about expectation of
sums rather expectation of ABSOLUTE value of the function (X1/3+X2/3+X3/3-X4),
i.e. E|X1/3+X2/3+X3/3-X4| , I don't think this can be handled for log
normal distribution by integrals by hand.
Shant
Well, it's trivial to simulate, and for n=25, for example, I get
a mean of 6.875. Depending on your needs, you can choose a much larger
sample to make it more precise, or, as Chuck suggested, try numerical
integration.
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not kn
On Sat, 29 Aug 2015, Shant Ch wrote:
Hello Dr. Berry,
I know the theoretical side but note we are not talking about
expectation of sums rather expectation of ABSOLUTE value of the function
(X1/3+X2/3+X3/3-X4), i.e. E|X1/3+X2/3+X3/3-X4| , I don't think this
can be handled for log normal distr
On Fri, 28 Aug 2015, Shant Ch via R-help wrote:
Hello all,
For a study I want to find E|X1/3+X2/3+X3/3-X4| for variables following
lognormal distribution. To get the value we need to use four integrals.
So far, so good.
This is the code which I is used
fx<-function(x){
dln
Hello all,
For a study I want to find E|X1/3+X2/3+X3/3-X4| for variables following
lognormal distribution. To get the value we need to use four integrals. This is
the code which I is used
fx<-function(x){
dlnorm(x,meanlog=2.185,sdlog=0.562)
}
U31<-integrate(function(y1) { sap
10 matches
Mail list logo