Patterns in static

Apophenia

apop_missing_data.c File Reference

Defines

Functions


Detailed Description

Some missing data handlers.


Define Documentation

#define Switch_back
Value:
apop_data *real_data = ml_model->parameters;   \
    apop_model *actual_base = ml_model->more; \
    actual_base->parameters = d;

Function Documentation

apop_data* apop_data_listwise_delete ( apop_data d,
char  inplace 
)

If there is an NaN anywhere in the row of data (including the matrix, the vector, and the weights) then delete the row from the data set.

The function returns a new data set with the NaNs removed, so the original data set is left unmolested. You may want to apop_data_free the original immediately after this function.

  • If every row has an NaN, then this returns NULL.
  • If there is text, it gets pruned as well.
  • If inplace = 'y', then I'll free each element of the input data set and refill it with the pruned elements. Again, I'll take up (up to) twice the size of the data set in memory during the function. If every row has an NaN, then your apop_data set will have a lot of NULL elements.
  • This function uses the Designated initializers syntax for inputs.
Parameters:
d The data, with NaNs
inplace If 'y', clear out the pointer-to-apop_data that you sent in and refill with the pruned data. If 'n', leave the set alone and return a new data set.
Returns:
A (potentially shorter) copy of the data set, without NaNs. If inplace=='y', redundant with the input.
apop_model* apop_ml_imputation ( apop_data d,
apop_model mvn 
)

Impute the most likely data points to replace NaNs in the data, and insert them into the given data. That is, the data set is modified in place.

Parameters:
d The data set. It comes in with NaNs and leaves entirely filled in.
mvn A parametrized apop_model from which you expect the data was derived. if NULL, then I'll use the Multivariate Normal that best fits the data after listwise deletion.
Returns:
An estimated apop_ml_imputation_model. Also, the data input will be filled in and ready to use.

SourceForge.net Logo

Autogenerated by doxygen on 23 Nov 2009.