If you don't care about your bin size, and the values are sorted by z  
value, a straightforward way is:

$n = 57; # or whatever

$bounds = $z->(0:-1:$n);
$box_z = ($bounds->(1:-1) + $bounds->(0:-2))/2;
$box_freq = $n/($bounds->(1:-1) - $bounds->(0:-2));






On Jun 30, 2009, at 8:29 AM, Hernán De Angelis wrote:

> Thanks, I will think about that.
>
>
> Hernán
>
>
> 2009/6/30 Chris Marshall <[email protected]>:
>> If you sort the (z,r) data by z you can use the
>> histogram counts to calculate ranges of index values
>> corresponding to each bin.  range() or other indexing
>> operation can select the sets to calculate your
>> desired stats.
>>
>> --Chris
>>
>> Hernán De Angelis wrote:
>>>
>>> Dear PDL'ers,
>>>
>>> I am stuck with an apparently simple problem and hoped that  
>>> someone in
>>> this list might have a clue.
>>>
>>> I have approx. 130000 pairs of data, z and r,  which represent
>>> observations of some function r  at some coordinate z.
>>> A sample of the data looks like this:
>>>
>>> z      r
>>>
>>>  3311  311.817
>>>  3346  249.333
>>>  3238  353.368
>>>  3279  367.020
>>>  3347  324.405
>>>  3448  274.632
>>>  3161  310.469
>>>  3204  358.739
>>> ...... ......
>>>
>>> These observations come from a three dimensional space, and  
>>> therefore
>>> there exists more than one r value for each value of the  
>>> coordinate z.
>>> What I want to do is to estimate a gross distribution of r values
>>> versus z. Simple as it seems I am having troubles to set up a PDL  
>>> code
>>> to compute it.
>>>
>>
>>
>
>
>
> -- 
>
> Hernán De Angelis
> Linux user # 397217
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to