Thanks to both for explanations. "along dimensions in region" sounds pretty confusing to me. Can that be stated more clearly? Pardon my English.

I guess this is what I wanted.

julia> [std(A[i:i+9]) for i=1:length(A)-9]
91-element Array{Any,1}:
 0.395761
 0.391694
 0.392545
 0.363307
 ⋮
 0.322292
 0.325662
 0.345799

On 2014年10月10日 07:17, Simon Kornblith wrote:
Or alternatively:

|
std(reshape(A,10,div(length(A),10)),1)
|

Simon

On Thursday, October 9, 2014 7:10:11 PM UTC-4, Patrick O'Leary wrote:

    "optionally *along dimensions in region*" (emphasis mine). You are
    attempting to read along the tenth dimension of the array.

    You're trying to split the array into groups of ten elements, it
    sounds like.

    [std(A[10(n-1)+1:10n]) for n in 1:length(A)./10]

    On Thursday, October 9, 2014 5:56:01 PM UTC-5, K leo wrote:

        I am hoping to get the std's of every 10 consecutive elements
        in A.

        std(v[, region])
        Compute the sample standard deviation of a vector or array v,
        optionally
        along dimensions in region. The algorithm returns an estimator
        of the
        generative distribution’s standard deviation under the
        assumption that
        each entry of v is an IID drawn from that generative
        distribution. This
        computation is equivalent to calculating sqrt(sum((v -
        mean(v)).^2) /
        (length(v) - 1)). Note: Julia does not ignore NaN values in the
        computation. For applications requiring the handling of
        missing data,
        the DataArray package is recommended.

        On 2014年10月10日 06:49, Patrick O'Leary wrote:
        > On Thursday, October 9, 2014 5:42:40 PM UTC-5, K leo wrote:
        >
        >     julia> std(A, 10)
        >
        >
        > A only has elements along the first dimension. What behavior
        do you
        > expect here?


Reply via email to