help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: std in NDArrays


From: Jonathan Stickel
Subject: Re: std in NDArrays
Date: Wed, 25 Aug 2004 09:18:21 -0700
User-agent: Mozilla Thunderbird 0.7.3 (X11/20040803)

Great, that's what I expected. Since they are m-files, I see the cvs versions can be downloaded and put in my octave path:

http://www.octave.org/cgi-bin/viewcvs.cgi/*checkout*/octave/scripts/statistics/base/std.m
http://www.octave.org/cgi-bin/viewcvs.cgi/*checkout*/octave/scripts/general/repmat.m

Now I can do:

octave:13> A=rand(2,2,2)
A =

ans(:,:,1) =

     0.26272     0.39118
     0.60306     0.94343

ans(:,:,2) =

     0.51463    0.080546
     0.28459     0.46533

octave:14> std(A,0,3)

ans =

     0.17813     0.21965
     0.22519     0.33807

Does this work for you Hugo?

Jonathan


David Bateman wrote:
repmat and std in the octave CVS have both been converted to work with
NDArrays..... John, can we have a release?

D.

According to Jonathan Stickel <address@hidden> (on 08/25/04):

I was going to suggest the use of nanstd in the latest octave-forge:


octave:13> help nanstd
nanstd is the user-defined function from the file
/usr/share/octave/2.1.57/site/m/octave-forge/statistics/nanstd.m

v = nanstd(X [, opt [, dim]]);
nanstd is identical to the std function except that NaN values are
ignored.  If all values are NaN, the std is returned as NaN. If there
is only a single non-NaN value, the std is returned as 0.

       0:  normalizes with N-1 [default]
provides the square root of best unbiased estimator of the variance
       1:  normalizes with N,
this provides the square root of the second moment around the mean

See also: nanmin, nanmax, nansum, nanmedian, nanmean


However, I get an error that repmat can only make 2D matrices. Is there an update to repmat that will soon be available?

Jonathan


Hugo Neto wrote:

Dear All,

I'm facing another problem with the std (Standard Deviation) function. Because i have a three dimensional array and i would like to do a std in it along the 3º dimension.

For instance in Matlab:

realstate=std(state,0,3);        % std deviation along dimension 3

This will store in realstate variable the standard deviation on the 3º dimension

In Octave i reach the following statement:

"error: invalid conversion of NDArray to Matrix"

I guess that this function is not yet implemented with NDArray option in 2.1.57 Octave version. Do you know that?

Any solution to surpass this problem?

Thanks a lot,

Regards,

H.Neto



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]