Skip to main content
deleted 218 characters in body
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76

Apologies for stating my problem poorly in the first instance, thank you for the help in narrowing down the issue.

Problem

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} f_{\sigma}\left ( z \right ) \sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

where

$$ f_{\sigma}\left ( z \right ) = \left\{\begin{matrix} 2\sqrt{z+\frac{3}{8}+\sigma^{2}}, & z > -\frac{3}{8}-\sigma^{2}\\ 0, & z \leq -\frac{3}{8}-\sigma^{2} \end{matrix}\right. $$

which gives the equation in the reference below:

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 Piecewise[{{2 Sqrt[z + 3/8 + sig^2]*sig^2],z > -3/8 - sig^2}},0.]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]
 
Integrate[func[zNIntegrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

EditUpdate

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I getA suggestion is to replace the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:infinite sum with an upper limit of ~50 as it converges quickly. This does allow Mathematica to now evaluate the integral.

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

Problem

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} f_{\sigma}\left ( z \right ) \sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

where

$$ f_{\sigma}\left ( z \right ) = \left\{\begin{matrix} 2\sqrt{z+\frac{3}{8}+\sigma^{2}}, & z > -\frac{3}{8}-\sigma^{2}\\ 0, & z \leq -\frac{3}{8}-\sigma^{2} \end{matrix}\right. $$

which gives the equation in the reference below:

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]
 
Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

Apologies for stating my problem poorly in the first instance, thank you for the help in narrowing down the issue.

Problem

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} f_{\sigma}\left ( z \right ) \sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

where

$$ f_{\sigma}\left ( z \right ) = \left\{\begin{matrix} 2\sqrt{z+\frac{3}{8}+\sigma^{2}}, & z > -\frac{3}{8}-\sigma^{2}\\ 0, & z \leq -\frac{3}{8}-\sigma^{2} \end{matrix}\right. $$

which gives the equation in the reference below:

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica won't evaluate it:

func[z_, y_, sig_] := 
 Piecewise[{{2 Sqrt[z + 3/8 + sig^2],z > -3/8 - sig^2}},0.]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]
NIntegrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Update

A suggestion is to replace the infinite sum with an upper limit of ~50 as it converges quickly. This does allow Mathematica to now evaluate the integral.

clarified the problem better
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76

Update

For values of $z \leq -(\frac{3}{8} + \sigma^{2})$, the forward transform is defined as zero, so the integral is zero. I managed to miss this rather fundamental piece of information first time round, so thanks to @acl for pointing it out.

Problem

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} f_{\sigma}\left ( z \right ) \sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

where

$$ f_{\sigma}\left ( z \right ) = \left\{\begin{matrix} 2\sqrt{z+\frac{3}{8}+\sigma^{2}}, & z > -\frac{3}{8}-\sigma^{2}\\ 0, & z \leq -\frac{3}{8}-\sigma^{2} \end{matrix}\right. $$

which gives the equation in the reference below:

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]

Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

Update

For values of $z \leq -(\frac{3}{8} + \sigma^{2})$, the forward transform is defined as zero, so the integral is zero. I managed to miss this rather fundamental piece of information first time round, so thanks to @acl for pointing it out.

Problem

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]

Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

Problem

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} f_{\sigma}\left ( z \right ) \sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

where

$$ f_{\sigma}\left ( z \right ) = \left\{\begin{matrix} 2\sqrt{z+\frac{3}{8}+\sigma^{2}}, & z > -\frac{3}{8}-\sigma^{2}\\ 0, & z \leq -\frac{3}{8}-\sigma^{2} \end{matrix}\right. $$

which gives the equation in the reference below:

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]

Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

Tweeted twitter.com/#!/StackMma/status/482524896577474560
added 271 characters in body
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76

Update

For values of $z \leq -(\frac{3}{8} + \sigma^{2})$, the forward transform is defined as zero, so the integral is zero. I managed to miss this rather fundamental piece of information first time round, so thanks to @acl for pointing it out.

Problem

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]

Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]

Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

Update

For values of $z \leq -(\frac{3}{8} + \sigma^{2})$, the forward transform is defined as zero, so the integral is zero. I managed to miss this rather fundamental piece of information first time round, so thanks to @acl for pointing it out.

Problem

I'm trying to integrate, for a given value of $y$ and $\sigma$, the function

$$ \int_{-\infty}^{+\infty} 2\sqrt{z+\frac{3}{8}+\sigma ^{2}}\sum_{k=0}^{\infty}\left ( \frac{y^{k}\mathrm{e}^{-y}}{k!\sqrt{2\pi \sigma^{2}}} \mathrm{e}^{-\frac{\left ( z-k \right )^{2}}{2\sigma^{2}}} \right ) \mathrm{d}z $$

For those interested, it's for the exact unbiased inverse of the generalized Anscombe Transform, as given in this paper: http://dx.doi.org/10.1109/TIP.2012.2202675.

In the reference, the values of the above function are tabulated, presumably in Matlab, for $\sigma \in \left \{ 0.01,...,50 \right \}$ and $y \in \left \{0,...,200 \right \}$. The authors have made this table available for download, but I want to do it myself.

However, I can't get it to work - Mathematica just won't evaluate it:

func[z_, y_, sig_] := 
 2 Sqrt[z + 3/8 + sig^2]*
  Sum[((y^k )* Exp[-y])/(k! * Sqrt[2 \[Pi] sig^2]) * 
    Exp[-((z - k)^2) / (2 sig^2)], {k, 0, Infinity}]

Integrate[func[z, 5, 2], {z, -Infinity, Infinity}]

Have I made a mistake somewhere? Or misunderstood the integral/problem as given?

Edit

If I try NIntegrate, for example,

NIntegrate[
 2 Sqrt[z + 3/8 + 2^2]*
  Sum[((5^k )* Exp[-5])/(k! * Sqrt[2 \[Pi] 2^2]) * 
    Exp[-((z - k)^2) / (2 2^2)], {k, 0, Infinity}], 
    {z, -Infinity, Infinity}] 

I get the warning

NIntegrate::inumr: "The integrand ... has evaluated to non-numerical values for all sampling points in the region with boundaries {{-[Infinity],0.}}"

Whilst if I try NSum, I'm warned:

NSum::nsnum: "Summand (or its derivative) ... is not numerical at point k = 15."

added 412 characters in body
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76
Loading
added a link to the author's tabulated version
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76
Loading
edited tags
Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751
Loading
small clarification
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76
Loading
Source Link
dr.blochwave
  • 8.8k
  • 3
  • 43
  • 76
Loading