Learn R Programming

BaTFLED3D (version 0.2.11)

lower_bnd_CP: Calculate the lower bound of the log likelihood for a trained CP model

Description

Calculate the lower bound of the log likelihood for a trained CP model

Usage

lower_bnd_CP(m, d)

Arguments

m

object of the class CP_model

d

object of the class input_data

Value

Returns a numerical value (should be negative)

Examples

Run this code
# NOT RUN {
data.params <- get_data_params(c('decomp=CP'))
toy <- mk_toy(data.params)
train.data <- input_data$new(mode1.X=toy$mode1.X[,-1],
                             mode2.X=toy$mode2.X[,-1],
                             mode3.X=toy$mode3.X[,-1],
                             resp=toy$resp)
model.params <- get_model_params(c('decomp=CP'))
toy.model <- mk_model(train.data, model.params)
toy.model$rand_init(model.params)

train(d=train.data, m=toy.model, new.iter=1, params=model.params)

lower_bnd_CP(toy.model, train.data)
# }

Run the code above in your browser using DataLab