Re: arithenco Help
- From: "Garry Higgins" <mathworks.20.seker@xxxxxxxx>
- Date: Thu, 23 Apr 2009 15:40:17 +0000 (UTC)
"Roger Stafford" <ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx> wrote in message <gsnsdo$8ml$1@xxxxxxxxxxxxxxxxxx>...
"Garry Higgins" <mathworks.20.seker@xxxxxxxx> wrote in message <gsn4ri$ebi$1@xxxxxxxxxxxxxxxxxx>...
Sorry. I should have specified why I felt 'counts' was not right. If I procede with that value and try and pass it to 'arithenco' it fails with an error saying: "The symbol counts parameter must be a vector or positive finite integers." and doesn't return anything.
At the moment the data in my A array is random. This is going to be used as part of a bigger system that I don't have the data sets for yet. Shouldn't 'arithenco' still work but without any compression gains?
You pose a mystery here, Garry, but you have the means of checking to see if arithenco's error message is telling you the truth. You can check directly on 'counts' with something like
all(counts==round(counts) & counts>0)
to see if all elements of 'counts' are positive integers and
any(size(counts)==1)
to see if it is actually a vector and not a matrix.
If both checks indicate that 'counts' is truly a vector of positive integers, then something is possibly haywire with 'arithenco'. If not, then something mysterious is going on in 'histc' or 'unique'. 'histc' is supposed to give out only non-negative integer counts, but the way you are using it with 'unique', all counts should in fact be positive. There should be no zero bin counts in this case.
In other words, Garry, you need to conduct some detective work to narrow down the source of difficulty here. Your description of A as having 7500 values between 0 and .9998 suggests that perhaps at least two of them differ only by a single least bit in their significands. If so, it is conceivable that 'unique' regards them as different and 'histc' considers them to be equal. If so, you could receive a zero value in one or more of the bin count values. Another possibility is that 'arithenco' is not really set up to deal with sequences of symbols that are closely-spaced fractional values. The only example I see in its documentation is with sequences of +1 and -1 values. Perhaps its error message actually refers to the 'seq' argument, not the 'counts' argument. It is a common failing of error messages to give the wrong reason for a detected error.
If you manage to boil your problem down to something very simple and reproducible, it would be time to consult with members of Mathworks' support team, but you need to have some very specific examples that they can easily repeat.
Roger Stafford
I tried the two tests about and both came back true (1).
You might be right about it having to do with the number of significant numbers in the array. Strangely, I accidentally discovered that if I quantize A and then pass the quantized A with the original 'counts' to arithenco it works perfectly.
Regarding the array having repeated numbers even though it's made up of random numbers, this might be because I made this array out of a much larger one. I was running into memory problems with the bigger array so just copied some of it to a new one. I thought getting a simplified version working first would be easier :) If it helps I can upload the .mat file somewhere.
I've since decided on A = rand(32, 256*10); would be an accurate example for the final product. This might complicate things so we can probably ignore it for the minute.
If it is a limitation in histc, does anyone know of another way I could populate the 'counts' vector? Here's a desciption of it from the help file :
"The vector counts represents the source's statistics by listing the number of times each symbol of the source's alphabet occurs in a test data set."
Thanks again for taking the time to help Roger. I really appreciate it.
.
- Follow-Ups:
- Re: arithenco Help
- From: Garry Higgins
- Re: arithenco Help
- References:
- arithenco Help
- From: Garry Higgins
- Re: arithenco Help
- From: Roger Stafford
- Re: arithenco Help
- From: Garry Higgins
- Re: arithenco Help
- From: Roger Stafford
- arithenco Help
- Prev by Date: S-Function - LCC linking problem
- Next by Date: Re: COde help
- Previous by thread: Re: arithenco Help
- Next by thread: Re: arithenco Help
- Index(es):
Relevant Pages
|