# Items tagged with distributiondistribution Tagged Items Feed

### Fill a distribution plot...

May 14 2016
0 10

with(Statistics):
X := RandomVariable(Normal(0, 1))

DensityPlot(X,filled=true)

I don't know why the plot doesn't produce a shaded plot.

### Why does Mean fail with it?...

May 14 2016
1 8

Below is a custom distribution created based on a function that takes a parameter.

It is possible to create the custom distribution e.g. as D1 and then use it afterwards to find e.g. Mean, but it is not possible to call Mean directly with the creation of the distribution in the call.

Why is that ?

### How to choose a random point...

May 06 2016
0 46

of a (concrete/general) triangle, making use of Maple tools in an efficient way?  Mathematica applies the barycentric coordinates and the Dirichlet distribution to this end. More generally, how to efficiently choose a random point in a given bounded region?

### 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)

### How to generate a normal distribution around given...

April 11 2016
1 18

How to generate a random normal distribution of points around the point [3,15] for example?

### Maple package in "tar.gz" format...

January 06 2016
0 3

Dear all

http://cpc.cs.qub.ac.uk/summaries/AEQP_v1_0.html

The distribution format is  "tar.gz", but I don't know what to with this format, that how should I load this package into Maple library. I have window 8.1.

### 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

### How to compute PDF?...

July 12 2015
2 1

I am trying to find the pdf of the inverse of a random variable X, that represents a distribution I defined. I currently have :

with(Statistics):
T:=Distribution(PDF=(x->piecewise(0<x and x<1,1/4,3<x and x<5,3/8,0)));
X:=RandomVariable(T);
PDF(X,u);
CDF(X,u);
Y:=1/X;
T1:=RandomVariable(Y);

but this seems to be incorrect as I get a message saying T1:=RandomVariable(Y) is being passed a wrong argument.

What is the right way to obtain the pdf of 1/X?

### Generating sampling points with a known distribut...

July 04 2015
0 5

Hi,

Suppose I have a probability distribution function f(x). I would like to generate points in a

(1) given interval, can be up to infinity

(2) number of points

(3) satisfy the known probability distribution function f(x)

(4) possible other specifications

Is there any build-in option in maple I could use? Or I have to write something manually?

Thank you very much!

### compute the cdf of a piecewise probability distrib...

April 01 2015
1 1

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

### Best fit a normal distribution to a set of data...

March 23 2015
0 2

If I have some data, how would I determine the best normal distribution fit?

### binomial data simulation...

March 09 2015
0 1

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)

### posterior plot animation...

February 15 2015
0 4

Greetings, seeking an expert to animate a plot.

see worksheet.posterior_graphs_(encapsulted)_1D.mw

before they play each other, each have a law (a normal distribution) plot-output 6.

after DD defeats CC, and a numerical integration is performed the new laws are given by plot-output 18.

as you can see, the laws of DD and CC are closer together.

if the calc was repeated (DD defeats CC again), the laws would be closer again.

so what i require is an animation of the new laws from game 1 to (say) game 6 (DD defeats CC every time). seeing the red and blue distributions merging would be ideal.

as an aside I heard maples FFT could simplify the complicated integration. any suggestions?

cheers

### Expected Value of a function...

January 08 2015
0 2

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.

### Why doesn't the integral evaluate?...

November 29 2014
0 4

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?

 1 2 3 4 Page 1 of 4
﻿