Learn R Programming

Oscope (version 1.2.0)

SineOptim: Function for searching optimal phase shift

Description

Function for searching optimal phase shift

Usage

SineOptim(Pairdata)

Arguments

Pairdata
a sample-by-2 matrix indicating the rescaled expression of two genes/isoforms. all values should be bettwen [-1, 1].

Value

Output provides the optimal phi (shift) and its corresponding epsilon^2 (value) of the sine model. epsilon_g1,g2^2 = sum_s [X_g1,s^2+X^2_g2,s -2X_g1,sX_g2,s cos(phi_g1,g2)-sin^2(phi_g1,g2)]^2

Examples

Run this code
aa <- sin(seq(0,1,.1))
bb <- sin(seq(0.5,1.5,.1))
SineOptim(cbind(aa,bb))

Run the code above in your browser using DataLab