[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [newbie] constructing a discrete dataset
From: |
Juan Pablo Carbajal |
Subject: |
Re: [newbie] constructing a discrete dataset |
Date: |
Wed, 29 Jan 2014 17:21:36 +0100 |
On Wed, Jan 29, 2014 at 5:07 PM, Jean Dubois <address@hidden> wrote:
> I'd like to generate every possible combination a b c d e f for three
> possible values (1, 2, 3) of each variable
> Something which starts like this:
> 1 1 1 1 1 1
> 1 1 1 1 1 2
> 1 1 1 1 1 3
> 1 1 1 1 2 1
> 1 1 1 1 2 2
> 1 1 1 1 2 3
> 1 1 1 1 3 1
> 1 1 1 1 3 2
> 1 1 1 1 3 3
> 1 1 1 2 1 1
> 1 1 1 2 1 2
> 1 1 1 2 1 3
> 1 1 1 2 2 1
> 1 1 1 2 2 2
> 1 1 1 2 2 3
> 1 1 1 2 3 1
> 1 1 1 2 3 2
> 1 1 1 2 3 3
> .
> .
> .
> Can anyone here suggest how this is best done in octave in a time
> efficient manner (I suppose nested for-loops are a bad idea)?
>
> thanks in advance
> jean
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
Check for the "combnk" function in the statistics package. You can
also see if the function marbles-in-bins (marinbin) does what you need
http://agora.octave.org/snippet/WOoN/
The idea is stolen from Jordi's solution to the coefficients of the
multinomial expansion.
Also have in mind the function "partint" in the miscellaneous package.
- [newbie] constructing a discrete dataset, Jean Dubois, 2014/01/29
- Re: [newbie] constructing a discrete dataset,
Juan Pablo Carbajal <=
- Re: [newbie] constructing a discrete dataset, Jean Dubois, 2014/01/29
- Re: [newbie] constructing a discrete dataset, c., 2014/01/29
- Re: [newbie] constructing a discrete dataset, Jean Dubois, 2014/01/29
- Re: [newbie] constructing a discrete dataset, Carlo de Falco, 2014/01/29
- Re: [newbie] constructing a discrete dataset, Jean Dubois, 2014/01/29
- Re: [newbie] constructing a discrete dataset, c., 2014/01/29
- Re: [newbie] constructing a discrete dataset, Jean Dubois, 2014/01/29
- Re: [newbie] constructing a discrete dataset, Jean Dubois, 2014/01/30
- Re: [newbie] constructing a discrete dataset, Juan Pablo Carbajal, 2014/01/30
Re: [newbie] constructing a discrete dataset, c., 2014/01/29