Message Boards Message Boards

0
|
6108 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Problem with sums of random variables

Dear Wolfram Team:

Good night.

I am trying for some days to do an apparently "trivial" statistical calculation. In short, I am trying to compute the expected value of a sum of random variables.

The result should be something like this:

enter image description here

Source: Pierre Gy (2004 II) ; Chemometrics and Intelligent Laboratory Systems 74 (2004) 25–38 "Sampling of discrete materials II. Quantitative approach—sampling of zero-dimensional objects"

The failed calculation is attached as a Wolfram notebook.

Thank you in advance for your help.

Attachments:
5 Replies
Posted 3 years ago

You might consider asking this question at CrossValidated to obtain the estimation formulas and then back here for implementation with Mathematica.

You also seem to be assuming subject matter knowledge that not everyone will have. For example, you use "weights" that are actual weights (tons? pounds?) of "broken material". What is "broken material"? There's also mention of "grade a of component A".

It also seems you want to estimate parameters from a sample as opposed to determining parameters from a specified set of distributions (which would involve functions like Expectation or Moment).

POSTED BY: Jim Baldwin

Here are the specifics:

1) Yes, all the X[i] should follow the same distribution, as the problem is related to the equiprobable sampling of a (very) big population of solid particles.

2) The list of operations I would wish to do is the following:

  • i) the sum of particles N[i] in a batch of any broken material. N[i] is a random variable because they can be randomly selected from the big set.
    Ntot = Sum [N[i]]

Question: how many particles are collected in the sample, if the sampling follows some simple distribution (like the binomial one)? Answer in terms of mean and variance.

  • ii) the weighted sum (2 nd step): the total weight of particles in a sample
    W = Sum [w[i]*N[i]]

Question: the same as above, now given as the average weight collected in the sample (and variance)

  • iii) a ratio of 2 weighted sums (2 nd step), where ai is the total content of of a certain chemical or physical component (i.e. w[i] is the total weight of each particle, A[i] is just the weight of the component of interest)

    a = Sum [A[i]*N[i]] / Sum [w[i]*N[i]]
    

Question: this is the mean and variance of the "grade" a of the component A in the sample, i.e:

       mean[a] = mean [ A/ W]  
       variance [a] = variance [A/ W]

   Where : 

       A = Sum [A[i]  N[i]]   &&  W = Sum [w[i] N[i]]

The ratio of 2 sums is expected to be a difficult calculation, but just the one sum should be simple, yet I am stuck in the first step.

Posted 3 years ago

Would you include more specifics about what you want to do. For example, are all of the $X_m$ from the same distribution? Are you interested in the distribution of the sums or just the ability to determine moments of the sum? Is it for the moments of a general $N$ (which means you would also need to make something specific about the individual distributions - as some distributions don't have finite moments).

For example, suppose all distributions were ChiSquare distributions with a common parameter $\nu$:

dist[i_] := ChiSquareDistribution[\[Nu]]
Sum[a[i] Mean[dist[i]], {i, 1, n}]

$$\sum _{i=1}^n \nu a(i)$$

POSTED BY: Jim Baldwin

Thank you.

Just replace the X[i] [Distributed] dist with the pattern:

"wrong definition"->  Xi[x_,imax_]:=Table[x[i], {i, imax}] \[Distributed] dist

"new definition"-> distXi[x_,imax_]:=Table[x[i] \[Distributed] dist, {i, imax}]

Now the example is running OK if I assign a value to imax, for example, imax=3.

However, now I see that the problem is in running sums, not expectations: the result can turn very "ugly" if imax is a very big number.

It is a way to evaluate sums without explicit, numeric iterators? I don't want to have kilometric expressions for big imax values, specially for more complicated distributions or for more complicated functions than expectations, like variances.

I think you're not using Expectation correctly. I could be wrong though, but from what I see in the documentation, your second argument is not of the required types. It's supposed to be basically x \[Distributed] dist where x is a symbolic variable, not a table of symbolic values.

Edit. My bad, the syntax {x,y,z,...}\[Distributed] dist exists but it's for multivariate distributions. Maybe the syntax {Subscript[x, 1] \[Distributed] Subscript[dist, 1], Subscript[x, 2] \[Distributed] Subscript[dist, 2], \[Ellipsis]} is what you want, but I'm not sure how you would write this with a formal number of parameters.

Edit#2. That being said even X[x, imax] can't be called without imax being defined. Table[x[i], {i,imax}] would return the error 'Table: iterator {i,imax} does not have appropriate bounds'.

POSTED BY: Lucien Grondin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract