mml_rand_str_adaptive: MML random Markov blanket models using adaptive code approach

Description Usage Arguments Value

View source: R/mml_rand_str_adaptive.R

Description

This function takes a list of given random Markov blanket models and calculates the mml score of the target under each Markov blanket model. The output is a weighted average over all message lengths.

Usage

1
2
3
mml_rand_str_adaptive(data, vars, arities, sampleSize, varCnt, targetIndex,
  logProbTarget, cachedPXGivenT, probsMtx, strList, mbIndices, weights,
  cachedPXGivenY, cachInd, alpha, statingPara, debug = FALSE)

Arguments

data

A dataset whost variables are in numeric/integer format. Any categorical variables must be converted into numeric/integer first.

vars

A vector of all variables in data, in the same order as the column names of data.

arities

A vector of variable arities in data, in the same order as the column names of data.

sampleSize

The sample size. That is, the number of rows of data.

varCnt

This parameter is for mml_cpt. As explained by argument name. It is obtained by getting the detailed information of the given data using the function count_occurance().

targetIndex

The target node's index in vars, whose Markov blanket we are interested in.

logProbTarget

Log of the probability of the target.

cachedPXGivenT

cachedPXGivenT

probsMtx

probsMtx

strList

A list of random (or all) Markov blanket models (structures) to go through. Each structure is stored in a matrix format.

mbIndices

The indices of potential Markov blanket variables.

weights

A vector of weights for random Markov blanket models.

cachedPXGivenY

cachedPXGivenY

cachInd

cachInd

alpha

A vector of concentration parameters for a Dirichlet distribution. Range is from zeor to positive infinity, length is equal to the arity of the target variable.

statingPara

If TRUE MML estimate of the parameters are also stated with extra 0.5log(pi*e/6) per parameter, otherwise 0.

debug

A boolean argument to show the detailed Markov blanket inclusion steps based on each mml score.

Value

The function outputs the weighted average message length over all given structures. Noticing it is the probabilies over all models are averaged then use this averaged probability to calculate the averaged message length, not to average the message lengths directly. This is done by the function msg_len_ave() function.


kelvinyangli/mbmml documentation built on June 29, 2020, 3:12 a.m.