Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.7K 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 5 years ago
POSTED BY: Jim Baldwin
Posted 5 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