cost: Calculate the cost

Description Usage Arguments Value Author(s) Examples

View source: R/cost.R

Description

A function to calculate the cost of the objective function

Usage

1
cost(W,init_list,lambda=0.2)

Arguments

W

The matrix to be factorized

init_list

A list containing the updated results in this iteration

lambda

A parameter to set the relative weight of the sparsity constraint

Value

A number indicating the total cost of the objective function

Author(s)

Xiaoyao Yin

Examples

1
2
3
4
5
6
7
W <- simu_data_generation()
init_list <- initialization(W,k=5,l=4)
update_L_list <- update_L(W,init_list)
update_B_list <- update_B(W,update_L_list)
update_R_list <- update_R(W,update_B_list)
update_C_list <- update_C(W,update_R_list,lambda=0.2,rho=1.1)
temp_cost <- cost(W,init_list,lambda=0.2)

OSNMTF documentation built on Dec. 1, 2019, 1:22 a.m.