Learn R Programming

MoTBFs

Development version of the MoTBFs package

The aim of the MoTBFs package is to provide a free and accessible implementation of algorithms for learning MoTBFs from data. The package implements learning algorithms for univariate, conditional, and joint MoTBF densities, explained in the Mixtures of Truncated Basis Functions vignette. By extension, functionality is also provided for learning MoTBF-based Bayesian networks by leveraging functionality from the bnlearn package. Furthermore, the MoTBFs package also provides methods for integrating prior domain knowledge in the learning process, thus also supporting data sparse domains. An extensive example included in the Workflow of MoTBFs pacakge vignette illustrates the main functionality of the package.

New functionalities are included to the MoTBFs package, including the implementation of the variable elimination algorithm for inference, and the adaptation of the Chow-Liu algorithm to MoTBF densities to learn the structure of TAN models.

Copy Link

Version

Install

install.packages('MoTBFs')

Monthly Downloads

408

Version

2.0

License

GPL-3

Maintainer

Ana D. Maldonado

Last Published

August 21st, 2026

Functions in MoTBFs (2.0)

goodnessMoTBFBN

BIC of a hybrid BN
integralMTE

Integrating MTEs
findConditional

Find Fitted Conditional MoTBFs
getMotbfDim

Extract Dimension of MoTBFs
expectedValueMOP

Expected Value of an MoP Density Function
evalJointFunction

Evaluation of joint MoTBFs
ecoli

Data set Ecoli: Protein Localization Sites
getStructure

Hybrid Bayesian Network structure learning
getNonNormalisedRandomMoTBF

Ramdom MoTBF
expectedValueMTE

Expected Value of an MTE Density Function
integralMoTBF

Integrating MoTBFs
mte.learning

Fitting mixtures of truncated exponentials.
is.observed

Observed Node
motbf_type

Type of MoTBF
nVariables

Number of Variables in a Joint Function
motbf2grain

Export discrete motbf to grain format
marginal.jointmotbf

Marginalization of MoTBFs
mop.learning

Fitting mixtures of polynomials
is.motbf

Check MoTBF Classes and Subclasses
jointmotbf.fit

Joint MoTBF density learning
integralJointMoTBF

Integration with MoTBFs
integralMOP

Integration of MOPs
is.root

Root nodes
marginalJointMoTBF

Marginalization of MoTBFs
motbf.cv

Cross-validation for MoTBFs
learnMoTBFpriorInformation

Incorporating prior knowledge in the estimation process
jointmotbf.learning

Joint MoTBF density learning
is.discrete

Check discreteness of a node
integrate.motbf

Integrating MoTBFs
newRangePriorData

Redefining the Domain
query

Conditional probability queries
printConditional

Summary of conditional MoTBF densities
probDiscreteVariable

Probability distribution of discrete variables
r.data.frame

Initialize Data Frame
preprocessedData

Data cleaning
motbf.fit

Learning hybrid BNs with MoTBFs
motbf2bnlearn

Export discrete motbf to bnlearn format
plotConditional

Plot Conditional Functions
predict.motbf_fit

Predict from an MoTBF Bayesian Network
plot.motbf

Plots for 'motbf' objects
variableElimination

Exact inference
variableSelection

Variable selection for MoTBFs
rescale_data

Scale data
rescaledFunctions

Rescaling MoTBF functions
subsetData

Dataset subsetting
print.motbf

Print object of class motbf print method for class "motbf".
sample_motbfs

Generate Samples From an MoTBF Bayesian network
rnormMultiv

Multivariate Normal sampling
summary.motbf

Summarize an "motbf" object by describing its main features.
univMoTBF

Fitting MoTBFs
thyroid

Data set Thyroid Disease (thyroid0387)
BICMoTBF

Computing the BIC score of an MoTBF function
BICMultiFunctions

BIC score for multiple functions
LearningHC

Score-based hybrid Bayesian Network structure learning
coef.jointmotbf

Coefficients of a "jointmotbf" object
clean

Remove Objects from Memory
UpperBoundLogLikelihood

Upper bound of the loglikelihood
MOPTAN

Fitting MoTBFs TAN models
asMOPString

Parameters to MOP String
MoTBF-Distribution

Random generation for MoTBF distributions
asMTEString

Converting MTEs to strings
derivMTE

Derivating MTEs
coercion-motbf

Coerce MOTBF Objects to Character or Function
coef.motbf

Extract the coefficients of an MoTBF
coef.mte

Extracting the coefficients of an MTE
confusionMatrix

Confusion Matrix
derivMoTBF

Derivating MoTBFs
coef.mop

Extract coefficients from MOPs
conditionalmotbf.learning

Learning conditional MoTBF densities
derivMOP

Derivative of a MOP
eval.motbf

Evaluation of MoTBFs
getChildParentsFromGraph

Get the list of relations in a graph
discreteStatesFromBN

Get the states of all discrete nodes from a MoTFB-BN
generateNormalPriorData

Prior data generation
dataMining

Data pre-processing utilities
dimensionFunction

Dimension of MoTBFs
getDAG

Retrieve DAG from BN
getCoefficients

Get the coefficients
get_approx_posterior

Approximate inference
getMotbfVar

Extract Variables of MoTBFs