Items tagged with statistics statistics Tagged Items Feed

Hi all,

 

I want to create a (set of) samples from an own distribution. The distribution itself is a normal distribution, but with some 'gaps', as shown below:

plot(exp(-(t-10)^2/(2*(0.5e-1*10)^2))*piecewise(t<9,0,t<9.9,1, t<10.1,0, t<11,1), t = 8.5 .. 11.5)

(It is supposed to represent the distribution of discrete resistor values (e.g. 10 ohms), where not only the values above the tolerance (e.g. 10%) are removed, but also those who can be sold as higher precision resistors (eg. 1%). The mean, lower tolerance and higher tolerance should be variables).

Because of the fact that in order to be able to use the Sample function, the PDF should be twice differentiable, the 'truncation' in the middle is realised using logistic functions.

I am able to create said distribution, and produce a DensityPlot, but when I try to take a (even a single) Sample from a RandomVariable from that distribution, Maple keeps calculating and no sample is produced.

GetDist := (mu, alpha, beta) -> Distribution(PDF = unapply(LotRPDF(t, mu, alpha, beta), t)):
T := GetDist(10, .1, 0.1e-1);
DensityPlot(T);
RandomR := RandomVariable(T):
Sample(RandomR, 1);

Where LotRPDF is the function depicted above, mu is the mean (10), alpha is the maximum tolerance (10%), , beta is the minimum tolerance (1%)

Am i overlooking something simple? Or is there a more fundamental error in my approach? I've added the maple sheet with more details.

RandomVariableSample.mw

 

 

how to call matlab to run k means on the data and

how to show which circle do the row of data belong to?

I have a (251*1) vector for which I need to compute the cumulative sum. I'm currently using :

s:=Statistics[CumulativeSum](prices[1..251,1])

defined under the Statistics package but this method doesn't return an output, even though the argument passed is a vector.

Is there another method I can use?

This should be trivial but I am not able to figure out the right syntax to execute it

The pdf is given by :

f_X(x)={ 1/25 *x, 0<=x<5

             2/5 -x/25, 5<=x<10

             0, otherwise

I have tried to use the "CumulativeDistributiveFunction" so far

Hello

I am trying to do a do loop

X[1] := Statistics:-Sample(Binomial(200, .5), 1);

for i to 10 do X[i+1] := Statistics:-Sample(Binomial(200-X[i], .5), 1) end do;

And it shows error like this

Error, (in rtable/Sum) invalid arguments.

Did I do something wrong in my code?

How to simulate a data which is follow by binomial distribution, n=200, p=0.9.

I know normal can be simulated by following code

random[normald[0, 1]](50)

I'm wondering why the fit routine gives weird results, when telling him to fit

with(Statistics):

X:=Vector[column](3, {1 = 616.3096, 2 = 616.3248, 3 = 616.3342}, datatype = sfloat, storage = rectangular, order = Fortran_order, shape = []);

Y:=Vector[column](3, {1 = 99590., 2 = 127564., 3 = 144223.}, datatype = sfloat, storage = rectangular, order = Fortran_order, shape = []);

g:=Fit(a+b*x+c*x^2,X,Y,x)

It's telling me: Warning, model is not of full rank

If I calculate the coefficients the direct way (well the fit should be exact,because we only have 3 values and 3 parameters) I get:

M:=Matrix(3, 3, {(1, 1) = 1, (1, 2) = 616.3096, (1, 3) = 379837.52305216, (2, 1) = 1, (2, 2) = 616.3248, (2, 3) = 379856.25909504, (3, 1) = 1, (3, 2) = 616.3342, (3, 3) = 379867.84608964}, datatype = anything, storage = rectangular, order = Fortran_order, shape = []);
V:=Vector[column](3, {1 = 99590, 2 = 127564, 3 = 144223}, datatype = anything, storage = rectangular, order = Fortran_order, shape = []);
with(LinearAlgebra):
C:=MatrixVectorMultiply(M^-1,V)

 

Hello people in Mapleprimes,

 

I want to do calculations about an expected value.

For example,

expectedvalueofc.pdf

that is, \int_a^b c d \Omega

 

where, \Omega is a distribution function of c. 

 

But, I don't know whether this equation can be put into worksheet.

Is there no way other than writing this as 

\int_a^b c g(c) dc, 

where g shows a probability density function.

 

Can I use Statistics[ExpectedValue] to calculate expected value with a general distribution function, not specified 

to normal distribution?

 

I hope you will give me some hints.

 

Best wishes.

 

 

 

I want to integrate the following cumulative distribution function with variable bounds but maple returns the integral.

>with(Statistics);

>N := RandomVariable(Normal(0, 1)):

>a := (ln(98.53*(1/95))+(0.1e-1+.5*x^2)*.5)/(x*sqrt(.5))

>y:= CDF(N, a, inert = true);

How do i make maple return a function of x instead of an integral?

Statistics:-Histogram by default choses the vertical axis such that the area under the histogram is 1 (or something like that). In my work, I invariably need to add "frequencyscale=absolute" to get the scale I need. Is there any way to make this the default? Typing this every time gets so old... I have been looking to something analogous to plots:-setoptions but that doesn't seem to exist for Statistics.

M.D.

How do I calculate run of 0s or run of 1s using maple?

Hi Everyone

Is there a built-in way to fit a regression using generalized least squares in Maple ?

 

RandomCompositions:= proc(n::posint, k::posint)
local
C,
Compositions:= [seq(C-~1, C= combinat:-composition(n+k, k))],
Rand:= rand(1..nops(Compositions))
;
()-> Compositions[Rand()]
end proc:

R:= RandomCompositions(9,6):
n:= 2^13:
S:= 'R()' $ n:

 

I want to compile statistics each number in a sequence cannot  occur  over twice.

The sequences that do not fit the rule above must be ommitted.

The statistic is  Fermi-Dirac statistics.

confused the Bose-Einstein condensation and Fermi-Dirac statistics.

But the theory is right.

Hi,

I don't manage to animate a DensityPlot. Here is my program :

> restart;
> with(Statistics): with(plots):
> P := lambda->RandomVariable(Poisson(lambda)):
> animate(DensityPlot,[P(n),range=0..10],n=1..5,frames=5);

And here is the error message :

Plotting error, non-numeric vertex definition

Thanks for any help

RandomCompositions:= proc(n::posint, k::posint)
local
C,
Compositions:= [seq(C-~1, C= combinat:-composition(n+k, k))],
Rand:= rand(1..nops(Compositions))
;
()-> Compositions[Rand()]
end proc:

R:= RandomCompositions(9,6):
n:= 10:
S:= 'R()' $ n;

S := [4, 1, 1, 1, 2, 0], [3, 2, 1, 1, 0, 2], [0, 1, 1, 0, 0, 7], [0, 1, 1, 5, 0, 2], [1, 0, 3, 1, 3, 1],

        [1, 3, 1, 1, 0, 3], [1, 4, 2, 0, 2, 0], [5, 0, 0, 3, 1, 0], [1, 1, 1, 4, 0, 2], [0, 1, 2, 1, 0, 5]

 

[4, 1, 1, 1, 2, 0] , [1, 1, 1, 4, 0, 2]  and [0, 1, 1, 5, 0, 2] , [0, 1, 2, 1, 0, 5]  are same number 

  but different order.

There are two same sequence. I want to  count  as one, and compile statistics the summation, and 

divide by 8.

the result

0=14/8

1=17/8

2=6/8

...

4=2/8

5=2/8

...

 

1 2 3 4 5 6 7 Last Page 1 of 9