Imputation

scalation.modeling.Imputation
trait Imputation

The Imputation trait specifies an imputation operation called impute to be defined by the objects implementing it, i.e., ImputeRegression - impute missing values using SimpleRegression ImputeForward - impute missing values using previous values and slopes ImputeBackward - impute missing values using subsequent values and slopes ImputeMean - impute missing values usind the filtered mean ImputeNormal - impute missing values using the median of Normal random variates ImputeMovingAvg - impute missing values using the moving average ImputeNormalWin - impute missing values using the median of Normal random variates for a window

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ImputeForward
object ImputeMean
object ImputeNormal
Show all

Members list

Value members

Abstract methods

def imputeAt(x: VectorD, i: Int): Double

Impute a value for vector x at index i. Does not modify the vector.

Impute a value for vector x at index i. Does not modify the vector.

Value parameters

i

the index position for which to impute a value

x

the vector with missing values

Attributes

Concrete methods

def findLastMissing(x: VectorD, i_: Int): (Int, Double)

Return the index of last missing value in vector x from index i and the new imputed value.

Return the index of last missing value in vector x from index i and the new imputed value.

Value parameters

i_

the starting index to look for missing value

x

the vector with missing values

Attributes

def findMissing(x: VectorD, i: Int): (Int, Double)

Return the index of first missing value in vector x from index i and the new imputed value.

Return the index of first missing value in vector x from index i and the new imputed value.

Value parameters

i

the starting index to look for missing value

x

the vector with missing values

Attributes

def impute(x: VectorD, i: Int): (Int, Double)

Impute a value for the first missing value in vector x from index i. The type (Int, Double) returns (vector index for imputation, imputed value). Does not modify the vector.

Impute a value for the first missing value in vector x from index i. The type (Int, Double) returns (vector index for imputation, imputed value). Does not modify the vector.

Value parameters

i

the starting index to look for missing values

x

the vector with missing values

Attributes

Replace all missing values in matrix x with imputed values. Will change the values in matrix x. Make a copy to preserve values x.copy.

Replace all missing values in matrix x with imputed values. Will change the values in matrix x. Make a copy to preserve values x.copy.

Value parameters

x

the matrix with missing values

Attributes

Replace all missing values in vector x with imputed values. Will change the values in vector x. Make a copy to preserve values x.copy.

Replace all missing values in vector x with imputed values. Will change the values in vector x. Make a copy to preserve values x.copy.

Value parameters

x

the vector with missing values

Attributes

protected def nextVal(x: VectorD, i: Int): Double

Return the next non-missing value in vector x from index i. If none, return missVal.

Return the next non-missing value in vector x from index i. If none, return missVal.

Value parameters

i

the starting index to look for non-missing value

x

the vector to be searched for a non-missing value

Attributes

protected def normalMedian(mu: Double, sig2: Double): Double

Return the median of three normally distributed random numbers.

Return the median of three normally distributed random numbers.

Value parameters

mu

the mean

sig2

the variance

Attributes

protected def prevVal(x: VectorD, i: Int): Double

Return the previous non-missing value in vector x from index i. If none, return missVal.

Return the previous non-missing value in vector x from index i. If none, return missVal.

Value parameters

i

the starting index to look for non-missing value

x

the vector to be searched (backwards) for a non-missing value

Attributes

def setDist(dist_: Int): Unit

Set the distance dist to the new value dist_.

Set the distance dist to the new value dist_.

Value parameters

dist_

the new value for the distance

Attributes

def setMissVal(missVal_: Double): Unit

Set the missing value missVal to the new missing value indicator missVal_.

Set the missing value missVal to the new missing value indicator missVal_.

Value parameters

missVal_

the new missing value indicator

Attributes

Concrete fields

protected val DAMPEN: Double
protected val debug: (String, String) => Unit
protected var dist: Int
protected var missVal: Double
protected val q: Int