ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 29 May 2018 05:34:09 -0500Are q-additive functions implemented in Sage ? Where ?http://ask.sagemath.org/question/42457/are-q-additive-functions-implemented-in-sage-where/ Hi,
We are interested in q-additive functions and sequences. This objects are for instance described in "Sur certaines suites uniformement equireparties modulo 1" (Jean Coquet).
We couldn't find these objects implemented in sage (but maybe we did not look well enough).
Could you please tell us whether q-additive functions are implemented in sage or not ?
Also, if we do implement something about q-additive functions, in which part of sage would it fit the best.
lbTue, 29 May 2018 05:34:09 -0500http://ask.sagemath.org/question/42457/Distribution of a list of numbershttp://ask.sagemath.org/question/8695/distribution-of-a-list-of-numbers/ Hello!
I'd like to know if there is a Sage function to retrieve a distribution of some experimental data.
I have a 1D list of measured values and I need to obtain a second list containing the distribution of that data, for example, to fit it with some Gaussian or Poisson curve.
Thanks.v_2eFri, 03 Feb 2012 06:03:20 -0600http://ask.sagemath.org/question/8695/how to get a log distribution on the x-axis of a semilogx plot?http://ask.sagemath.org/question/24310/how-to-get-a-log-distribution-on-the-x-axis-of-a-semilogx-plot/I tried to plot some frequency response. In the most simple case this may look like A(w). I can make plots using different statements like plot_semiogx, or plot(...,scale='semilogx') etc, but the results look odd. Apparently the internally generated points on the x-axis lways have a linear distribution. Only forcing an exaggerated number of points (e.g. plot_points=100000) results in a correct graph. I didn't find a better solution. I think the plot command should distribute the x-points in a log-fashion automatically for semilogx and loglog plots, thus I consider this a bug. I'm using sage 6.2 right now. Any ideas how to workaround/fix this?
w = var('w')
A0=1e7
w0=100
A(w)=A0*(1/(1+i*w/w0))
plot_semilogx(abs(A(w)),1,1e7)gg@gSat, 27 Sep 2014 08:32:32 -0500http://ask.sagemath.org/question/24310/Seed - probability distribution functionshttp://ask.sagemath.org/question/10194/seed-probability-distribution-functions/Hello experts!
In a new user of sage.
This is a triple-question for you:
1) Reading the 'Craig Finch Sage Beginners Guide' page 236 I find the next script (about accessing probability distribution functions):
variance = 0.75
gaussian = RealDistribution('gaussian', variance)
gaussian.set_seed(0.0)
random_values = [gaussian.get_random_element() for i in range(1000)]
gaussian_plot = gaussian.plot((-5, 5))
The 1st question is ¿Whats for gaussian.set_seed(0.0)? ¿What does (0.0) seed value minds?
2) ¿What must i write in a script for obtain a normal (gaussian) distribution center in 'C' with variance 'V'?
3) Again, in 'Craig Finch Sage Beginners Guide' page 305 i find:
rng = RealDistribution('uniform', [0,dimension], seed=1)
¿Whats for seed=1 value? ¿What does 1 seed value minds?
Waiting for your answers.
Thaks a lot!!mresimulatorWed, 05 Jun 2013 11:38:47 -0500http://ask.sagemath.org/question/10194/Comparaisons between different linux distributionshttp://ask.sagemath.org/question/10190/comparaisons-between-different-linux-distributions/Have you tested and compared the execution speed of different algorithms on different linux distributions?
Are there a faster linux distributions?
And moroplogoTue, 04 Jun 2013 06:58:16 -0500http://ask.sagemath.org/question/10190/integers following Normal distributionhttp://ask.sagemath.org/question/9646/integers-following-normal-distribution/Hello,
how can I produce positive integers, say in (1,n), which follow the normal distribution
with parameters (m,sigma).
Thanks.HelenFri, 21 Dec 2012 00:55:36 -0600http://ask.sagemath.org/question/9646/Best way to handle probability distributionshttp://ask.sagemath.org/question/9480/best-way-to-handle-probability-distributions/I'm curious to know what people recommend as the best way to handle probability distributions in Sage. Using scipy requires setting up a lambda function when doing a plot, and RealDistribution only accepts one parameter (standard deviation) for the normal distribution when there should be two. Is there a better option?calc314Sun, 28 Oct 2012 17:15:51 -0500http://ask.sagemath.org/question/9480/How do I generate a random number according to the binomial distribution?http://ask.sagemath.org/question/8848/how-do-i-generate-a-random-number-according-to-the-binomial-distribution/I would like to generate a random integer according to the binomial distribution. That is, I would like to generate a Bin(n,p) random value. That's number between 0 and n in which the probability we get the value k is `C(n,k)p^k(1-p)^(n-k)`.
Here is an inefficient method (which requires n calls to `random()` ):
def bin_rv(n,p=0.5):
"""
Generate a binomial random variable with parameters n,p.
"""
return sum( random() < p for _ in range(n))
Is there a better way to do this (already built into Sage, I hope)?
(In Matlab, this can be done via the `binord` function and in R with the `rbinom` function.)Ed ScheinermanMon, 02 Apr 2012 08:50:18 -0500http://ask.sagemath.org/question/8848/Gauss distribution fithttp://ask.sagemath.org/question/8721/gauss-distribution-fit/Hello!
I have a problem with fitting my data set with a Gauss (Normal) distribution.
data = [[90.00, 2.0], [97.40, 5.0], [104.8, 14.0], [112.2, 12.0], [119.6, 11.0], \
[127.0, 6.0], [134.4, 3.0], [141.8, 1.0], [149.2, 2.0], [156.6, 1.0]]
var('sigma mu max x')
model(x) = max*(1/sqrt(2*pi*sigma**2))*exp(-(x-mu)**2/(2*sigma**2))
find_fit(data, model)
gives a result:
[sigma == 1.0, mu == 1.0, max == 1.0]
I tried to use a Python function instead of the symbolic one:
var('sigma mu max x')
def model(x,sigma,mu,max):
return max*(1/(sigma*sqrt(2*pi)))*exp(-(x-mu)**2/(2*sigma**2))
find_fit(data, model, parameters=[sigma, mu, max], variables = [x])
and obtained the very same result:
[sigma == 1.0, mu == 1.0, max == 1.0]
Why does it give me this (obviously, incorrect) result? And what is a way to do it right?
Thanks.v_2eSat, 18 Feb 2012 23:19:04 -0600http://ask.sagemath.org/question/8721/