Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6203 > unrolled thread

How the GaussianMatrix is calculated in Mathematica?

Started byZiyuan Lin <ziyuang@gmail.com>
First post2011-11-05 09:54 +0000
Last post2011-11-06 10:55 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  How the GaussianMatrix is calculated in Mathematica? Ziyuan Lin <ziyuang@gmail.com> - 2011-11-05 09:54 +0000
    Re: How the GaussianMatrix is calculated in Mathematica? Silvia <wyelen@gmail.com> - 2011-11-06 10:55 +0000

#6203 — How the GaussianMatrix is calculated in Mathematica?

FromZiyuan Lin <ziyuang@gmail.com>
Date2011-11-05 09:54 +0000
SubjectHow the GaussianMatrix is calculated in Mathematica?
Message-ID<j9314l$ac8$1@smc.vnet.net>
GaussianMatrix[1] is something like this:
{{0.00987648, 0.0796275, 0.00987648},
 {0.0796275, 0.641984, 0.0796275}, 
 {0.00987648, 0.0796275, 0.00987648}}

I tried to re-implement it by
MyGaussianMatrix[r_] := 
 Module[{\[Sigma] = r/2, m}, 
  m = N[Table[
     1/(2 \[Pi] \[Sigma]^2) E^(-((x^2 + y^2)/(2 \[Sigma]^2))), {x, -r,
       r}, {y, -r, r}]]; m/(Total[Flatten[m]])]
(* To ensure the sum of all entries is 1 *)

But that is not the case, since MyGaussianMatrix[1] will be
{{0.0113437, 0.0838195, 0.0113437},
 {0.0838195, 0.619347,  0.0838195},
 {0.0113437, 0.0838195, 0.0113437}}

So I wonder the implementation detail of this function.
Thank you~

[toc] | [next] | [standalone]


#6215

FromSilvia <wyelen@gmail.com>
Date2011-11-06 10:55 +0000
Message-ID<j95p2k$m3u$1@smc.vnet.net>
In reply to#6203
according to the help,

With the default option setting Method->"Bessel", GaussianMatrix[r] has elements proportional to Exp[-\[Sigma]^2] BesselI[x,\[Sigma]^2], yielding a kernel with optimal discrete convolution properties.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web