var, sttdev Streaming Evaluators.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

var, sttdev Streaming Evaluators.

Nazerke S
Hi,

I have got a question about Streaming Expression evaluators.
I would like to calculate mean, standard deviation and variance of the
given array.

For example, the following code works for the mean:
               let(arr=array(1,3,3), m=mean(a))

Also, I want to compute variance and standard deviation as well i.e.:
             let(echo="m,v,sd", arr=array(1,3,3), m=mean(a), v=var(a),
sd=stddev(a))

It seems the var(), stddev() evaluator functions are not implemented as
separate functions??

__Nazerke
Reply | Threaded
Open this post in threaded view
|

Re: var, sttdev Streaming Evaluators.

Joel Bernstein
They currently are not. You can use describe() to get these values and
getValue() if you want to use a specific value.

 let(arr=array(1,3,3), m=describe(a), s=getValue(m, stdev))

It makes sense to add these on there own as well.



Joel Bernstein
http://joelsolr.blogspot.com/


On Wed, Apr 10, 2019 at 11:13 AM Nazerke S <[hidden email]> wrote:

> Hi,
>
> I have got a question about Streaming Expression evaluators.
> I would like to calculate mean, standard deviation and variance of the
> given array.
>
> For example, the following code works for the mean:
>                let(arr=array(1,3,3), m=mean(a))
>
> Also, I want to compute variance and standard deviation as well i.e.:
>              let(echo="m,v,sd", arr=array(1,3,3), m=mean(a), v=var(a),
> sd=stddev(a))
>
> It seems the var(), stddev() evaluator functions are not implemented as
> separate functions??
>
> __Nazerke
>