About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • Last update: 5 years ago
  • Total downloads: 53
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Hin Kwan Wong
See full specifications

scripts default iconCummulative (dim 2) products across all permutations of distinct column-indices (Scripts) Publisher's description

CUMmulative PRODucts across All Permutations of Distinct Column-Indices

CUMmulative PRODucts across All Permutations of Distinct Column-Indices
This function returns the cumulative sum over products of column elements
with all permutations of unique and distinct column-indices.
The sum excludes automatically products containing elements with common
column index values. In addition, any user specified index values in
ignoredInd are excluded. (As all permutations of columns are summed, the
permutation of the columns of the input array is not important.)

For example, cumprodapdci([a,b],[1 7]) for vectors a and b is the sum of
sum(a.*b) minus all contributions of a(2)b(2), a(3)b(3) and the user
specified ignoredInd of 1 and 7, i.e. all products involving the elements
a(1),a(7),b(1) and b(7) are not included in the sum.

Example application:
For a vector K represnting the input values of a multinomial expansion of (K(1)+K(2)+K(3))^n, the result can be expressed as: sum(sum(...sum(K)*K)*K)...)

Alternatively, one can build up the expansion with product elements. For example, when n=4, the result is equal to the sum of all forms of:
+4*(sum of all forms of a*b^3)
+6*(sum of all forms of a^2*b^2)
+12*(all combinations of the form a*b*c^2.)
see http://www.wolframalpha.com/input/?i=expan...%2Bb%2Bc%29%5E4

Hence, if one is interested at all contributions of the form a^2*b^4 for n=6 for example, the answer is given as the multinomial coefficient 6!/2!/4! * sum of all combinations of the form a^2*b^4.

This can be performed by using this routine of cumproduei([K.^2,K^4]), where K is [a;b;c;d+...] as in the problem of (a+b+c+d+e+...)^6.
If one wants to ignore contributions containing terms K(3)=c and K(5)=e, one may use cumproduei([K.^2,K^4],[3,5]).

It is important to note that the result requires normalisation with the multinomial coefficient M, and the correction factor 1/prod(DoFs!). The implementation of M is available on file exchange from other authors.
E.g. 6156-multinomial, wheras the correction factor is described as follows:
If there are common column vector with common power, such is the case when n = 4 and one would like to sum all instances of the form a*b*c^2. The result should be normalised by multiplying the result with M/(products of factorials of DoF). M is the multinomial coefficient as mentioned before, and the degree of freedom refers to the number of variables with a common power. In this example, the common order is a & b and there are 2 of them. For a more complicated case, for example, a*b*c^4*d^4*e^6*f^6*g^6, the normalisation factor should be M/2!2!3!=M/24. Here, the multinomial coefficient M=(6+6+6+4+4+2)!/(6!6!6!4!4!2!).

System Requirements:

MATLAB 7.11 (2010b)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Cummulative (dim 2) products across all permutations of distinct column-indices (Scripts) Tags:

Click on a tag to find related softwares

Is Cummulative (dim 2) products across all permutations of distinct column-indices (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.