objFunc: Objective function of optimization model

Description Usage Arguments Value Examples

View source: R/objFunc.R

Description

This function returns the objective function value of given data.

Usage

1
objFunc(Y, A, alpha, beta)

Arguments

Y

Y is cluster-level data, a list of matrix.

A

A is dynamic gene regulatory network, a list of matrix.

alpha

alpha is tuning parameter in optimization model.

beta

beta is tuning parameter in optimization model.

Value

'of' is the objective function value of given data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (Y, A, alpha, beta)
{
    N <- length(Y)
    of <- 0
    for (i in c(1:(N - 1))) {
        of <- of + norm(A[[i]] %*% Y[[i]] - Y[[i + 1]] + Y[[i]],
            type = "F")^2/2 + alpha * norm(A[[i]], type = "1")
    }
    for (i in c(1:(N - 2))) {
        of <- of + beta * norm(A[[i + 1]] - A[[i]], type = "1")
    }
    return(of)
  }

xzheng-ac/scPADGRN documentation built on July 26, 2020, 12:41 a.m.