Items tagged with statisticsstatistics Tagged Items Feed

Calculate message's bits...

April 19 2016
0 2

>message:=67A;

67A

>P:=convert(message, bytes);

[54, 55, 65]

>with(Bits):

>bitP1:=Split(P1);

[0, 1, 1, 0, 1, 1]

>bitP2:=Split(P2);

[1, 1, 1, 0, 1, 1]

>bitP3:=Split(P3);

[1, 0, 0, 0, 0, 0, 1]

>with(Statistics):

>b1:=Count(bitP1);

6

>b2:=Count(bitP2);

6

>b3:=Count(bitP3);

7

>totalBits=b1+b2+b3;

19

Hi, how i need to modify my command so when i write any message with any lenght, i can get the totalBits directly..

Thank you~=]]

RandomVariable vs Distribution in Sample?...

April 13 2016
0 5

Is there a difference between these two?

with(Statistics):

Sample(Normal(0,1),100)

Sample(RandomVariable(Normal(0, 1)), 100)

Fuzzy c-means clustering...

April 10 2016
2 10

Does Maple have something similar to c-means clusteirng in Matlab?

http://www.mathworks.com/help/fuzzy/fcm.html

How would I go about doing something like this in Maple?

How to plot critical values?...

March 27 2016
0 3

Is there a way to plot critical values of the Pearson Correlation Coefficient r?  See attached worksheet.  Thanks!

Error using NonlinearFit function...

March 20 2016
1 6

Howdy all,

I am trying to fit an exponential and logistical model to a set of population data i've been given using the NonlinearFit function in the statistics toolbox. When try to find the fit for the exponential function I get an error saying "SVD of estimated Jacobian could not be computed". Furthermore, when I display the regression over the set of data points all it shows is a horizontal line. I'm not sure how to go about fixing this. My data set is only 17 points and my input function is about as simple as it gets.

When I run the program to solve for logisitcal model I do not get the error but the displayed plot still shows just a horizontal line dispite the function being non-linear.

So far I have...

regE := NonlinearFit(a*exp(b*x),year,population,x)

regLog := NonlinearFit(a/(1+b*exp(-c*x)),year,population,x)

expon := plot((regE), x = 1850..2020):

logi := plot((regLog), x = 1850..2020):

display({data,logi,expon});

I have not tried using optimization yet but I will soon although I'm not sure if it will improve my results since my undertanding is that they both use the same process to estimate the parameters.

Anyways, Thanks for the help in advance!!

EDIT: Here is the data I am using.

year := [1850,1860,1870,1880,1890,1900,1910,1920,1930,1940,1950,1960,1970,1980,1990,2000,2010]:

population :=[4668,9070,17375,27985,37249,63786,115693,186667,359328,528961,806701,1243158,1741912,2049527,2818199,3400578,4092459]:

How to get back 'Hello'? ...

March 07 2016
1 5

Hi, may I know how I should write the commands after I convert my 'Hello' to 34 and 27 by using the commands below..

Hope someone can help me, thanks a lot..=]] Have a nice day~

message:=’Hello’;

>Hello

plaintext:=convert(message,bytes);

>[72, 101, 108, 108, 111]

P:=numtheory[cfrac](plaintext);

>9418838187/130799212

M1:=numer(P);

>9418838187

M2:=denom(P);

>130799212

with(Bits):

bitM1:=Split(M1);

>[1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1]

bitM2:=Split(M2);

>[0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1]

with(Statistics):

Count(bitM1);

>34

Count(bitM2);

>27

[72, 101, 108, 108, 111]

Random points in a for cycle...

February 16 2016
0 4

I have use a ''for cycle'' in order to get a series of points. I would like to save those points in a vector in order to use it for the ''PolynomialFit'' comand. The problem is that the points that I save are sort randomly. How can I take the value of the vector A in the right sequence? in the underline string you can plot the walue of A over t (which is not sorted). I can not use the sort command as I used for t even for A because the points are not increasing.

This is my code:

restart;

Atot := 0:

for ii from 0 by 0.01 to 2 do

PtotFkt := ii->  ii^2 :

Ptot := PtotFkt(ii):

Atot := Atot+0.01*Ptot:

A[ii] := Atot: #Save points in a Table

t[ii] := ii: #Save point in a table

end do;

AV := convert(A, list): #conversion from table to list
nops(AV);  #number of points

timme := convert(t, list): #conversion from table to list
nops(timme); #number of points

with(Statistics); #PolynomialFit

X := Vector(AV, datatype = float);

Y := Vector(sort(timme), datatype = float);

plot(Y, X, style = point, symbol = asterisk, color = blue);

regress := PolynomialFit(10, X, Y, time);

curve1 := plot(regress, time = 0 .. 2);

Problem with a certain distribution...

February 05 2016
1 7

Hi friends! I have a problem with Random Variable. I don't understand why theoretical Mean differs from sample's Mean

restart; with(Statistics);

r := RandomVariable(NegativeBinomial(3, .1));
Mean((3-1)/(3+r-1));

0.1000000000

S := Sample(r, 10000);

d := map(unapply((3-1)/(3+t-1), t), S);

Mean(d);

0.04703520901756091

But !!

For example if p=0.2 then all is well

Generate multivariate distribution ...

January 01 2016
0 3

Hi,

I think similar question has been asked by several people, but I did not find a suitable thread. My question is, suppose I have a probablity distirubtion function like

p(x,y) = exp(-alpha (x+y) ) x^2 y^2 / |x-y|  , alpha>0

x,y goes from - \infty to + \infty. This function is normalizable but unbounded, which makes the rejection algorithm a bit difficult(?).

How to generate samping points from this type of probability distribution function?

Thank you very much!

How to calculate error of calculation?...

December 18 2015
1 0

Hi,

I'm null in statistic. I'm doing a calculation to calculate a set of parameter. By example:

I have to calculate 5 parameters x1,x2,x3,x4,x5 from 7 equations f1,f2,f3,f4,f5,f6,f7. Because it is difficult to calculate directly 5 parameters, I used chisquare to minimize the difference between experimental and theorical data. Then, I can get the results. After that, I used these 5 parameters to back-calculate the data using 7 equations above. My question is about how to calculate the error bar (or standard error) of the back-calculate datato add to the plot.

Thank you  for helping me,

Best regards.

Fit data to sine function off...

December 17 2015
1 23

I tried to fit a sin function to some data using Statistics[Fit] however the result either didn't work properly or worked differently from the way I expected it to work.

a2 is the calculated function from Statistics[Fit] and a3 is some quickly inserted values that provides a more satisfying result.

 (1)

 (2)

Style of errorbars in ErrorPlot...

November 26 2015
1 1

Hello everybody,

I would like to know if there's a possibility to change the style of the errorbars in errorplot. I would espacially like to add short lines at both ends of each errorbar, orthogonal to those, similiar to the looks of errorbars in GNUplot.

Moments of Function...

November 06 2015
1 9

I was wondering if the moments(mean, variance,...) of this function bellow exists even if in approximate form.

f(x) = binomial(x+r-1, x)*((1/2)*b/(1+d*x+(1/2)*b))^r*((d*x+1)/(1+d*x+(1/2)*b))^x/(d*x+1)

Multiple DensityPlot in one figure...

October 20 2015
0 2

Hi,

I want to plot two density functions of norm(1,1) and norm(4,1) in one figure.

But it appears the function DensityPlot can only plot one at a time.

Error in Distribution...

October 17 2015
0 2

Hi,

I have the following input

***

restart;
with( Statistics ):

a:=2;c:=0.3;
g:= exp(-a*x) + c*a*exp(-a*x);
#f := x -> piecewise( x < 0, 0, x>0, g );
f :=x -> piecewise( x < 0, 0, x>0, exp(-a*x) + c*a*exp(-a*x));

norm_factor:=int( f(x), x=0..infinity );
print(norm_factor);

randomize():
F := Distribution( PDF = 1/norm_factor*f ):
X := RandomVariable( F ):

N := 20;
S := convert( Sample(X,N), list );

print(cc,S[1]);

***

The code works. However, if I comment out

f :=x -> piecewise( x < 0, 0, x>0, exp(-a*x) + c*a*exp(-a*x));

, then use

f := x -> piecewise( x < 0, 0, x>0, g );

i.e.

f := x -> piecewise( x < 0, 0, x>0, g );
#f :=x -> piecewise( x < 0, 0, x>0, exp(-a*x) + c*a*exp(-a*x));

It is said "

Error, (in Statistics:-Sample) unable to construct the envelopes for _R, try to specify the initial range"

The norm_factors are actually the same for both inputs. What is the reason for the error message?  Suppose I still want to use something like

f := x -> piecewise( x < 0, 0, x>0, g );

,how to fix the problem?

Thank you very much

 1 2 3 4 5 6 7 Last Page 1 of 10
﻿