Kurtosis needs range >= 4 was: Skewness and Kurtosis functions doesn't accept

Hello,

I am trying to use Kurtosis and skewness with range = a variable that i get from parameters or optimization.

in both cases, it gives an error saying it should be greater than zero and not null.

is that supposed to happen ?

I attached screenshots.optimize param

Regards,

You interpreted the error message wrong. It is not about variable, it is about the VALUE of variable that you are passing. You are passing invalid range. It must be positive but also more than that.

For Kurtosis as 4th order moment the range must be >= 4. Consult Wikipedia for basics on Kurtosis:

The same way, Skewness as 3rd order moment, needs range >= 3.

1 Like

Thank you Thomas,

I tried what you said but i found the following:

  1. The problem was only in kurtosis, skewness function worked without error (despite giving correct values or not) even with 1!
mas=Param("skew range",1,1,10);
skew=Skewness(C,mas,False);
  1. Kurtosis doesn't work even with values >4 unless i hardcode it in the function

here is a screenshot
TinyTake28-09-2019-04-53-52_637052793007471429

Regards,

It does work with Param too. It didn't work for you because Param* are cached. So it is still used the old param default, min, max, step settings of before.

Change to

mak = Param("Kurtosis range", 5, 5, 10, 1);

and then click APPLY button of formula editor but not Save button.

Apply button updates and saves while Save button only saves.

1 Like

Oh, wonderful !

would've spent days without noting the caching property, thank you very much!

Always, I mean ALWAYS, you should use APPLY INDICATOR button.

Apply Indicator button SAVES the code.

But Apply Indicator does MORE than just save. It performs number of book-keeping stuff that is REQUIRED for things like parameters to be updated when they were changed.

3 Likes