# tens_gr_square_loss: Calculate square loss term in gradient of objective function In lambdamoses/novoSpaRc: Spatial Reconstruction of Tissues from scRNA-seq Data

## Description

Projected gradient descent is used to numerically solve the optimization problem of finding a probabilistic assignment of cells to locations. The gradient of the loss function has a term L(C_1, C_2) \otimes T. This function calculates that term when L(a,b) = \frac 1 2 (a - b)^2, namely the square loss.

## Usage

 1 tens_gr_square_loss(D_cell, tD_loc, T_tmp) 

## Arguments

 D_cell Graph-based distance matrix between pairs of cells, generated from function calc_graph_dist in this package. tD_loc Transpose of the graph-based distance matrix between pairs of locations generated from function calc_graph_dist in this package. Since the k-nearest neighbor graph is directed, the matrix is not necessarily symmetric. T_tmp A matrix for probabilistic assignment of cells (in rows) to locations (in columns). This matrix will be updated in gradient descent.

## Value

A numeric matrix with cells in rows and locations in columns.

lambdamoses/novoSpaRc documentation built on May 12, 2019, 3:14 p.m.