Welcome Analytica users,
I hope you have had a great start to 2015! In this issue we have MAC Curve generator in the spotlight, advice on how to tame your numbers and some career opportunities at Lumina. Enjoy this issue and please send your ideas and comments. Your feedback is always welcome.
Marie Kjargaard, Newsletter Editor
TIPS & TRICKS: Numbers Gone Rogue
There's a race of men who don't fit in, a race that can't stay still; So they break the hearts of kith and kin and they roam the world at will. -Robert Service
Lurking in the depths of your models lie a special family of number values waiting for an opportunity to emerge. Scoffing at the conformity of more respectable numbers, these nihilistic rogues refuse to quantify anything. You may have seen them on Wanted posters or after attempting to divide by zero. They are known by various aliases. In Analytica we call them Null, NaN, and INF. To tame them, you must first understand how they think.
Null is the shy one of the group. He'd rather just not exist, if possible. Array-reducing functions just ignore him:
Sum([1, 2, Null, 4]) → 7
Average([1, 2, Null, 3]) → 6/3 → 2
Null is a no-show when it comes to any kind of graph; you will see blank space in instead. The only way to get any action from him is to let him stand alone as a separate term. In this case he will propagate:
1 + 2 + Null + 3 → Null.
The ability to not exist is very useful sometimes. When performing regressions, you can use Null for missing values.
NaN stands for "Not a Number" although technically he is really a number, just undefined. He will appear when you invoke imaginary numbers or try to mix numbers with text values. (Analytica supports complex numbers but default settings stick with real numbers only.)
Sqrt(-1) → NaN
Sin('Gooseberry') → NaN
NaN likes to propagate if he can:
Sum([1, 2, NaN, 3 ]) → NAN
but you can ignore him using an optional parameter in array-reducing functions:
Sum([1, 2, NaN, 3], IgnoreNaN:True) → 6
INF likes to talk big but he's not the theoretically infinite ideal he imagines himself to be. He's just larger than the largest floating point. He appears upon division by zero.
1/0 → INF
1/INF → 0
Sometimes he has to yield to NaN, although he hates this rule!
0*INF → NaN.
0/0 → NaN.
For more on these rogues, see Chapter 11 of the User Guide (page 146) and the Analytica Wiki.