Learn R Programming

pomodoro (version 3.8.0)

MLM_Model: Multinominal Logistic Model

Description

Multinominal Logistic Model

Usage

MLM_Model(Data, xvar, yvar)

Arguments

Data

The name of the Dataset.

xvar

X variables.

yvar

Y variable.

Value

The output from MLM_Model.

Details

Multi-nominal model is the generalized form of generalized logistic model and can be define as $$\pi_{i}^{h} = P(y_{i}^{h} = 1 | \bold{x}_{\bold{i}}^{h})$$ where \(h\) presents the class labels ("1-of-h") on the basis of an input vector \(x_j\), in our case \(x_j\) is loan types ("Formal Loan", "Informal Loan", "Both Loan", and "No Loan"). Furthermore,

\(y_{i}^h = 1\)if the weight w of \(x_j\) corresponds to belong a class and \(y_{i}^h=0\) otherwise. For \(i\) \(\in\) \(1,\ldots,h\) and the weight vectors w^i corresponds to class \(i\).

We set \({\bold{{w}}^{h}} = 0\) and the parameters to be learned are the weight vectors w^i for \(i\) \(\in\) \(1,\ldots,h-1\) . And the class probabilities must satisfy $$\sum_{i=1}^{h} P(y_{i}^{h} = 1 | \bold{x}_{\bold{i}}^{h}, \bold{w}) = 1.$$

Examples

Run this code
# NOT RUN {
yvar <- c("Loan.Type")
sample_data <- sample_data[c(1:750),]
xvar <- c("sex", "married", "age", "havejob", "educ", "political.afl",
"rural", "region", "fin.intermdiaries", "fin.knowldge", "income")
BchMk.MLM <- MLM_Model(sample_data, c(xvar, "networth"), yvar )
BchMk.MLM$finalModel
BchMk.MLM$Roc$auc
# }

Run the code above in your browser using DataLab