On Fri, 2 May 2008, Christopher Barker wrote:
> Why not just scale to -pi to pi right there?
Dunno, Chris. As I wrote to Anne (including a couple of files and the
resulting plot), it's been almost three decades since I dealt with the math
underlying distribution functions.
> Which is why you
On Fri, 2 May 2008, Anne Archibald wrote:
> It's better not to work point-by-point, appending things, when working
> with numpy. Ideally you could find a formula which just produced the right
> curve, and then you'd apply it to the input vector and get the output
> vector all at once.
Anne,
T
On Fri, 2 May 2008, Christopher Barker wrote:
> this could use some serious vectorization/numpyification! Poke around the
> scipy Wiki and whatever other tutorials you can find -- you'll be glad you
> did. A hint:
>
> When you are writing a loop like:
>>for i in xL:
>> x.append(xL
On Fri, 2 May 2008, Angus McMorland wrote:
> How about multiplying two Boltzmann terms together, ala:
>
> f(x) = 1/(1+exp(-(x-flex1)/tau1)) * 1/(1+exp((x-flex2)/tau2))
> You'll find if your two flexion points get too close together, the peak
> will drop below the maximum for each individual curve
When I last visited I was given excellent advice about Gaussian and other
bell-shaped curves. Upon further reflection I realized that the Gaussian
curves will not do; the curve does need to have y=0.0 at each end.
I tried to apply a Beta distribution, but I cannot correlate the alpha and
bet
On Mon, 28 Apr 2008, Hoyt Koepke wrote:
> A Gaussian fit to data x should fit exactly as well as data fit to ax, a >
> 0, just with a variance a^2 times the original. The only way this would
> not be true is if:
Hoyt,
This is what I expected, too.
> 1. You are not fitting the variance, but o
AFter the extensive input from folks here last week, and my examination of
alternatives, I accepted the visual appearance of Gaussian curves in our
model. As I check the plots for data errors I find a behavior change when
the x-axis length is 14 rather than 100, and I do not understand why.
On Fri, 25 Apr 2008, Charles R Harris wrote:
> You can use something like f(x) = (1-x**2)**2 , which has inflection
> points and vanishes at +/- 1. Any of the B-splines will also do the trick.
Chuck,
Thank you. I need to make some time to understand the B-splines to use
them appropriately. Un
On Fri, 25 Apr 2008, Bruce Southey wrote:
> Just use a truncated distribution as these are well known:
> http://en.wikipedia.org/wiki/Truncated_distribution
> http://en.wikipedia.org/wiki/Truncated_normal_distribution
Bruce,
I considered the truncated normal distribution, but having the tails
On Fri, 25 Apr 2008, Robert Kern wrote:
> In that case, you need to search the literature of your field for precise
> details on how to construct the curve that you want.
Robert,
Considering how few of us work in this subject area there's not much in
the way of resources.
Regardless, for
On Fri, 25 Apr 2008, David Huard wrote:
> Other suggestions for bounded bell-shaped functions that reach zero on a
> finite interval:
>
> - Beta distribution: http://en.wikipedia.org/wiki/Beta_distribution
> - Cubic B-splines:http://www.ibiblio.org/e-notes/Splines/Basis.htm
Thanks, David. I'm
On Thu, 24 Apr 2008, Keith Goodman wrote:
> A Gaussian never reaches zero.
Keith,
I know, and that's why I need to find another way to draw these curves.
While mathematically any 'y' value < 0.2 (the default) is equivalent to
zero, the curves must reach zero in the figures.
Briefly, this
Thanks to several of you I produced test code using the normal density
function, and it does not do what we need. Neither does the Gaussian
function using fwhm that I've tried. The latter comes closer, but the ends
do not reach y=0 when the inflection point is y=0.5.
So, let me ask the colle
On Thu, 24 Apr 2008, Robert Kern wrote:
> No, it's not! scale is the standard deviation of the Normal distribution,
> not half the FWHM!
OK. Thanks for clearing up my mis-understanding.
Rich
--
Richard B. Shepard, Ph.D. | IntegrityCredibility
Applied Ecosystem Ser
On Thu, 24 Apr 2008, Zachary Pincus wrote:
> I assume you 'from numpy import *'? This is why it works -- because that
> import causes the python built-in exp() to be replaced (in the current
> namespace) by numpy.exp().
The equivalent (I think): import numpy as nx.
Rich
--
Richard B. Shepar
On Thu, 24 Apr 2008, Zachary Pincus wrote:
> Python's built in pow() and exp() functions can't handle numpy arrays, and
> thus try (and fail) to convert arrays to scalar values. You want to use
> numpy.exp and numpy.power (or just the ** operator), to do these
> operations to numpy arrays elementw
On Thu, 24 Apr 2008, Joris De Ridder wrote:
> Scale is half the width between the inflection points, mind the factor of
> 2.
Joris,
So, half of the full width at half the maximum height. Thank you.
Rich
--
Richard B. Shepard, Ph.D. | IntegrityCredibility
Applied
On Thu, 24 Apr 2008, Keith Goodman wrote:
> norm = 1 / (scale * sqrt(2 * pi))
> y = norm * exp(-power((x - loc), 2) / (2 * scale**2))
Hmm-m-m. I don't understand the source of the error:
y = norm * exp(-pow((x - loc), 2) / (2 * scale**2))
TypeError: only length-1 arrays can be converted to
On Thu, 24 Apr 2008, Zachary Pincus wrote:
> The only remaining mystery is how 'loc' and 'scale' -- the parameters of
> numpy.random.normal -- map to 'mean' and 'standard deviation', which is
> how a normal distribution is usually parameterized. Fortunately, the
> documentation reveals this:
>
> >
On Thu, 24 Apr 2008, Keith Goodman wrote:
> It's random.normal(loc, scale). But that will give you random x values
> drawn from the normal distribution, not y values at your x. So you'll have
> to code your own normal, which will probably look something like
Keith,
I overlooked that, thanks.
Rereading "Guide to NumPy" once again, I saw what I had missed all the
previous times: the normal() distribution function (Chapter 10, page 173).
I have several questions on using it in my application.
The syntax is normal(loc=0.0, scale=1.0, size=None), but I've not seen
what those represen
On Fri, 11 Apr 2008, Keith Goodman wrote:
> Here's the formula:
Thanks, Keith. While I had read that page before I had not followed the
link to the FWMH page, and that provided the insight I needed. It's all
working now.
Rich
--
Richard B. Shepard, Ph.D. | Integrity
I see in the NumPy Book that there are functions to allow generation of
beta, binomial, and poisson curves, but I don't see one for normal curves.
Is there such a function?
Currently I'm using code (I forget from where) that creates a Gaussian
distribution, but the tails do not reach zero (w
On Wed, 9 Apr 2008, Rich Shepard wrote:
> ... and I'm wondering if there's a way within NumPy to multiply these
> values by 100 and limit the precision to 4 significant digits
Got it all worked out. All resolved.
Rich
___
Numpy-di
I'm using linalg.eig() and it works exactly as intended. The values of
the principal eigenvector are presented as real numbers (e.g.,
0.159317312615085), and I'm wondering if there's a way within NumPy to
multiply these values by 100 and limit the precision to 4 significant digits
(e.g., 15.93).
25 matches
Mail list logo