Rectifier: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Andy Dingley
Reverted 1 edit by 117.217.130.253 (talk): Unconstructive. (TW)
 
en>Snaily
Rectifiers are inherently non-linear. This limits the applicability of these expressions, which should be made explicitly clear. I assume the source does, somewhere.
Line 1: Line 1:
BMI, or body mass index, is calculated by dividing by fat by height squared. Specifically, it's fat in kilograms divided by height inside meters, squared. If you choose pounds and inches, then it's weight in pounds *703 divided by height inside inches, squared. For example, I am 5'8" tall and weigh 179 pounds. 179*703 = 125837. 5'8" is 68 inches, plus 68^2 = 4624, finally, 125837/4624 = 27.21 plus that's my BMI. If you don't like doing all which calculating, there are many online BMI calculators e.g.<br><br>Now, as for calorie intake, a healthy person should have 2,000 calories for an entire day of eating. Surprisingly, that's easy to do without starving oneself. Many people over eat, when they would be full on a quarter of what is consumed. If you eat correct part models and make healthy snack options it ought to be easy!<br><br>So my friend's BMR is 1969 calories a day. With this info and her doctor's recommendation, we've choose to go for 1400-1500 calories consumed a day plus 50-60 minutes of surprisingly small exercise a day. According to the goal calculator a reduction of 400-500 calories a day from the BMR might result in regarding 1 pound of fat lose per week, that is perfect.<br><br>The BMI index is broken down into four main categories. Each category is represents a level of morbidity plus mortality information or wellness risk. If the [http://safedietplansforwomen.com/bmi-calculator bmi calculator women] reads lower than 18.5 you're considered underweight, if it reads between 18.5 to 25 you're at an optimal weight; when the bmi calculator reads 25 to 30 a are overweight, when it reads 30 or above than you may be considered fat (over 40 morbidly obese). Patients that score above a 30 are a major concern of the health profession. Studies have shown that being obese can have an impact on your health. These same studies show how weight is shortening our average life span.<br><br>A person having a big frame and/or a great deal of muscle is flagged by Body Mass Index as being overweight--even whenever he has low body fat. This was true for disgraced cyclist Lance Armstrong at one point in his athletic profession.<br><br>There were 4 others which had type 2 diabetes plus 1 with kind 1 diabetes. After a month, the one with kind 1 diabetes was able to drop his insulin from 70 units right down to 5 units a day. With the 4 others, they were able to get off all of their medication and have a general blood glucose level meaning which they were healed.<br><br>There are a lot of free premade diet programs and tools which allow you to create a diet program on the internet. I found the six sites indexed above to have the greatest free tools and programs online. All of these websites contain the tools plus diet programs themselves thus we never have to click through hyperlinks. I found Spark People to be the ideal free online diet from all websites I viewed. The site has everything you can need inside a diet plus every aspect is created to work with one another. So, go ahead, go and visit all these websites for yourself, and choose that is right for we. All which you want to bring is a small will force and you are able to mark one resolution, fat loss, off a New Year's goals for superior!
The '''Box–Muller transform''' (by [[George E. P. Box|George Edward Pelham Box]] and Mervin Edgar Muller 1958)<ref>[http://projecteuclid.org/DPubS/Repository/1.0/Disseminate?view=body&id=pdf_1&handle=euclid.aoms/1177706645 G. E. P. Box and Mervin E. Muller, ''A Note on the Generation of Random Normal Deviates'', The Annals of Mathematical Statistics (1958), Vol. 29, No. 2 pp. 610&ndash;611]</ref> is a [[pseudo-random number sampling]] method for generating pairs of [[statistical independence|independent]], standard, [[normal distribution|normally distributed]] (zero [[expected value|expectation]], unit [[variance]]) [[random number]]s, given a source of [[Uniform distribution (continuous)|uniformly distributed]] random numbers.
 
It is commonly expressed in two forms. The basic form as given by Box and Muller takes two samples from the uniform distribution on the interval <nowiki>(0,&nbsp;1]</nowiki> and maps them to two standard, normally distributed samples.  The polar form takes two samples from a different interval, [&minus;1,&nbsp;+1], and maps them to two normally distributed samples without the use of sine or cosine functions.
 
The Box–Muller transform was developed as a more computationally efficient alternative to the [[inverse transform sampling method]].<ref>Kloeden and Platen, ''Numerical Solutions of Stochastic Differential Equations'', pp.&nbsp;11&ndash;12</ref> The [[Ziggurat algorithm]] gives an even more efficient method{{Citation needed|date=September 2011}}.
 
== Basic form ==
Suppose ''U''<sub>1</sub> and ''U''<sub>2</sub> are independent [[random variable]]s that are [[uniform distribution (continuous)|uniformly distributed]] in the [[Interval (mathematics)|interval]] <nowiki>(0,&nbsp;1]</nowiki>. Let
 
:<math>Z_0 = R \cos(\Theta) =\sqrt{-2 \ln U_1} \cos(2 \pi U_2)\,</math>
 
and
 
:<math>Z_1 = R \sin(\Theta) = \sqrt{-2 \ln U_1} \sin(2 \pi U_2).\,</math>
 
Then ''Z''<sub>0</sub> and ''Z''<sub>1</sub> are [[statistical independence|independent]] random variables with a [[standard normal distribution]].
 
The derivation<ref>Sheldon Ross, ''A First Course in Probability'', (2002), pp.&nbsp;279&ndash;81</ref> is based on the fact that, in a two-dimensional Cartesian system where X and Y coordinates are described by two independent and normally distributed random variables, the random variables for ''R''<sup>2</sup> and Θ (shown above) in the corresponding polar coordinates are also independent and can be expressed as
 
:<math>R^2 = -2\cdot\ln U_1\,</math>
 
and
 
:<math>\Theta = 2\pi U_2. \,</math>
 
Because ''R''<sup>2</sup> is the square of the norm of the standard [[bivariate normal]] variable (X, Y), it has the [[chi-squared distribution]] with two degrees of freedom. In the special case of two degrees of freedom, the chi-squared distribution coincides with the [[exponential distribution]], and the equation for ''R''<sup>2</sup> above is a simple way of generating the required exponential variate.
 
== Polar form ==
{{main|Marsaglia polar method}}
[[Image:BoxMullerTransformUsingPolarCoordinates.png|thumb|400px|Two uniformly distributed values, ''u'' and ''v'' are used to produce the value ''s''&nbsp;=&nbsp;''R''<sup>2</sup>, which is likewise uniformly distributed. The definitions of the sine and cosine are then applied to the basic form of the Box–Muller transform in order to avoid using trigonometric functions.]] The polar form was first proposed by J. Bell<ref>[http://portal.acm.org/citation.cfm?doid=363397.363547 J. Bell: 'Algorithm 334: Normal random deviates', Communications of the ACM, vol. 11, No. 7. 1968]</ref> and then modified by R. Knop.<ref>[http://portal.acm.org/citation.cfm?doid=362946.362996 R. Knopp: 'Remark on algorithm 334 &#91;G5&#93;: normal random deviates', Communications of the ACM, vol. 12, No. 5. 1969]</ref> While several different versions of the polar method have been described, the version of R. Knop will be described here because it is the most widely used, in part due to its inclusion in [[Numerical Recipes]].
 
Given ''u'' and ''v'', independent and uniformly distributed in the closed interval [&minus;1,&nbsp;+1], set ''s''&nbsp;=&nbsp;''R''<sup>2</sup>&nbsp;=&nbsp;''u''<sup>2</sup>&nbsp;+&nbsp;''v''<sup>2</sup>. (Clearly {{nobr|<math>\scriptstyle R = \sqrt{s}</math>.)}}  If ''s''&nbsp;=&nbsp;0 or ''s''&nbsp;≥&nbsp;1, throw ''u'' and ''v'' away and try another pair (''u'',&nbsp;''v''). Because ''u'' and ''v'' are uniformly distributed and because only points within the unit circle have been admitted, the values of ''s'' will be uniformly distributed in the open interval (0,&nbsp;1), too. The latter can be seen by calculating the cumulative distribution function for ''s'' in the interval (0,&nbsp;1).  This is the area of a circle with radius <math>\scriptstyle \sqrt{s}</math>, divided by <math>\scriptstyle\pi</math>. From this we find the probability density function to have the constant value 1 on the interval (0,&nbsp;1). Equally so, the angle θ divided by <math>\scriptstyle 2 \pi</math> is uniformly distributed in the interval [0,&nbsp;1) and independent of ''s''.
 
We now identify the value of ''s'' with that of ''U''<sub>1</sub> and <math>\scriptstyle \theta/(2 \pi)</math> with that of ''U''<sub>2</sub> in the basic form.  As shown in the figure, the values of <math>\scriptstyle \cos \theta = \cos 2 \pi U_2</math> and <math>\scriptstyle \sin \theta = \sin 2 \pi U_2</math> in the basic form can be replaced with the ratios <math>\scriptstyle\cos \theta = u/R = u/\sqrt{s}</math> and <math>\scriptstyle\sin \theta = v/R = v/\sqrt{s}</math>, respectively.  The advantage is that calculating the trigonometric functions directly can be avoided.  This is helpful when trigonometric functions are more expensive to compute than the single division that replaces each one.
 
Just as the basic form produces two standard normal deviates, so does this alternate calculation.
 
:<math>z_0 = \sqrt{-2 \ln U_1} \cos(2 \pi U_2) = \sqrt{-2 \ln s} \left(\frac{u}{\sqrt{s}}\right) = u \cdot \sqrt{\frac{-2 \ln s}{s}}</math>
 
and
 
:<math>z_1 = \sqrt{-2 \ln U_1} \sin(2 \pi U_2) = \sqrt{-2 \ln s}\left( \frac{v}{\sqrt{s}}\right) = v \cdot \sqrt{\frac{-2 \ln s}{s}}.</math>
 
==Contrasting the two forms==
 
The polar method differs from the basic method in that it is a type of [[rejection sampling]].  It throws away some generated random numbers, but it is typically faster than the basic method because it is simpler to compute (provided that the random number generator is relatively fast) and is more numerically robust.<ref name="Carter">[ftp://ftp.taygeta.com/pub/publications/randnum.tar.Z Everett F. Carter, Jr., ''The Generation and Application of Random Numbers'', Forth Dimensions (1994), Vol. 16, No. 1 & 2.]</ref> It avoids the use of trigonometric functions, which are comparatively expensive in many computing environments{{Citation needed|date=September 2011}}.  It throws away 1&nbsp;&minus;&nbsp;π/4&nbsp;≈&nbsp;21.46% of the total input uniformly distributed random number pairs generated, i.e. throws away 4/π&nbsp;&minus;&nbsp;1&nbsp;≈&nbsp;27.32% uniformly distributed random number pairs per [[normal distribution|Gaussian]] random number pair generated, requiring 4/π&nbsp;≈&nbsp;1.2732 input random numbers per output random number.
 
The basic form requires two multiplications, 1/2 logarithm, 1/2 square root, and one trigonometric function for each normal variate.<ref>Note that the evaluation of 2''&pi;U''<sub>1</sub> is counted as a single multiplication because the value of 2''&pi;'' can be computed in advance and used repeatedly.</ref> On some processors, the cosine and sine of the same argument can be calculated in parallel using a single instruction. Notably for Intel-based machines, one can use the fsincos assembler instruction or the expi instruction (usually available from C as an [[intrinsic function]]), to calculate complex
 
: <math>\mathrm{exp}(iz) = e^{i z} = \cos(z) + i \sin(z), \, </math>
 
and just separate the real and imaginary parts.
 
The polar form requires 3/2 multiplications, 1/2 logarithm, 1/2 square root, and 1/2 division for each normal variate. The effect is to replace one multiplication and one trigonometric function with a single division.
 
==See also==
* [[Inverse transform sampling]]
* [[Marsaglia polar method]], similar transform to Box-Muller, which uses Cartesian coordinates, instead of polar coordinates
 
==References==
<!--do not reduce font sizes, the Wiki style sheets control presentation-->
<references/>
 
==External links==
* [http://mathworld.wolfram.com/Box-MullerTransformation.html Box–Muller Transform on MathWorld]
 
{{DEFAULTSORT:Box-Muller Transform}}
[[Category:Transforms]]
[[Category:Non-uniform random numbers]]

Revision as of 18:12, 25 January 2014

The Box–Muller transform (by George Edward Pelham Box and Mervin Edgar Muller 1958)[1] is a pseudo-random number sampling method for generating pairs of independent, standard, normally distributed (zero expectation, unit variance) random numbers, given a source of uniformly distributed random numbers.

It is commonly expressed in two forms. The basic form as given by Box and Muller takes two samples from the uniform distribution on the interval (0, 1] and maps them to two standard, normally distributed samples. The polar form takes two samples from a different interval, [−1, +1], and maps them to two normally distributed samples without the use of sine or cosine functions.

The Box–Muller transform was developed as a more computationally efficient alternative to the inverse transform sampling method.[2] The Ziggurat algorithm gives an even more efficient methodPotter or Ceramic Artist Truman Bedell from Rexton, has interests which include ceramics, best property developers in singapore developers in singapore and scrabble. Was especially enthused after visiting Alejandro de Humboldt National Park..

Basic form

Suppose U1 and U2 are independent random variables that are uniformly distributed in the interval (0, 1]. Let

and

Then Z0 and Z1 are independent random variables with a standard normal distribution.

The derivation[3] is based on the fact that, in a two-dimensional Cartesian system where X and Y coordinates are described by two independent and normally distributed random variables, the random variables for R2 and Θ (shown above) in the corresponding polar coordinates are also independent and can be expressed as

and

Because R2 is the square of the norm of the standard bivariate normal variable (X, Y), it has the chi-squared distribution with two degrees of freedom. In the special case of two degrees of freedom, the chi-squared distribution coincides with the exponential distribution, and the equation for R2 above is a simple way of generating the required exponential variate.

Polar form

Mining Engineer (Excluding Oil ) Truman from Alma, loves to spend time knotting, largest property developers in singapore developers in singapore and stamp collecting. Recently had a family visit to Urnes Stave Church.

Two uniformly distributed values, u and v are used to produce the value s = R2, which is likewise uniformly distributed. The definitions of the sine and cosine are then applied to the basic form of the Box–Muller transform in order to avoid using trigonometric functions.

The polar form was first proposed by J. Bell[4] and then modified by R. Knop.[5] While several different versions of the polar method have been described, the version of R. Knop will be described here because it is the most widely used, in part due to its inclusion in Numerical Recipes.

Given u and v, independent and uniformly distributed in the closed interval [−1, +1], set s = R2 = u2 + v2. (Clearly Template:Nobr If s = 0 or s ≥ 1, throw u and v away and try another pair (uv). Because u and v are uniformly distributed and because only points within the unit circle have been admitted, the values of s will be uniformly distributed in the open interval (0, 1), too. The latter can be seen by calculating the cumulative distribution function for s in the interval (0, 1). This is the area of a circle with radius , divided by . From this we find the probability density function to have the constant value 1 on the interval (0, 1). Equally so, the angle θ divided by is uniformly distributed in the interval [0, 1) and independent of s.

We now identify the value of s with that of U1 and with that of U2 in the basic form. As shown in the figure, the values of and in the basic form can be replaced with the ratios and , respectively. The advantage is that calculating the trigonometric functions directly can be avoided. This is helpful when trigonometric functions are more expensive to compute than the single division that replaces each one.

Just as the basic form produces two standard normal deviates, so does this alternate calculation.

and

Contrasting the two forms

The polar method differs from the basic method in that it is a type of rejection sampling. It throws away some generated random numbers, but it is typically faster than the basic method because it is simpler to compute (provided that the random number generator is relatively fast) and is more numerically robust.[6] It avoids the use of trigonometric functions, which are comparatively expensive in many computing environmentsPotter or Ceramic Artist Truman Bedell from Rexton, has interests which include ceramics, best property developers in singapore developers in singapore and scrabble. Was especially enthused after visiting Alejandro de Humboldt National Park.. It throws away 1 − π/4 ≈ 21.46% of the total input uniformly distributed random number pairs generated, i.e. throws away 4/π − 1 ≈ 27.32% uniformly distributed random number pairs per Gaussian random number pair generated, requiring 4/π ≈ 1.2732 input random numbers per output random number.

The basic form requires two multiplications, 1/2 logarithm, 1/2 square root, and one trigonometric function for each normal variate.[7] On some processors, the cosine and sine of the same argument can be calculated in parallel using a single instruction. Notably for Intel-based machines, one can use the fsincos assembler instruction or the expi instruction (usually available from C as an intrinsic function), to calculate complex

and just separate the real and imaginary parts.

The polar form requires 3/2 multiplications, 1/2 logarithm, 1/2 square root, and 1/2 division for each normal variate. The effect is to replace one multiplication and one trigonometric function with a single division.

See also

References

External links