Preprocessing: private API

Functions

PortfolioOptimisers.is_missing_value — Function
is_missing_value(x) -> Bool

Return true when x counts as a missing observation in price-level data.

A price table marks an absent observation with missing or with NaN. unify_gaps writes every absence as NaN, but a PricesResult that a caller builds by hand can still hold missing, so this function accepts both.

Algorithm

  1. Return true when x is missing.
  2. Return true when x is a Number and isnan(x) holds. The type test comes first because isnan has no method for a value that is not a number, such as a String.
  3. Return false otherwise.

Arguments

  • x: The value to test.

Returns

  • flag::Bool: true when x is missing or a NaN number. An infinite number is not missing.

Related

source