t3_scuo.random: Generate Randomized SCUO Index

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Generate randomized SCUO indices in log normal distribution, but provided original unchanged SCUO order.

Usage

1
2
  scuo.random(SCUO, phi.Obs = NULL, meanlog = .CF.PARAM$phi.meanlog,
              sdlog = .CF.PARAM$phi.sdlog)

Arguments

SCUO

SCUO index returned from calc_scuo_values().

phi.Obs

optional object of format phi.Obs.

meanlog

mean of log normal distribution.

sdlog

std of log normal distribution.

Details

This function takes SCUO indices (outputs of calc_scuo_values()) computes the rank of them, generates log normal random variables, and replaces SCUO indices by those variables in the same rank orders. Typically, these random variables are used to replace expression values when either no expression is observed or for the purpose of model validation.

If phi.Obs is provided, the mean and std of log(phi.Obs) are used for log normal random variables. Otherwise, menalog and sdlog are used.

The default meanlog and sdlog was estimated from yassour dataset.

Value

A vector of log normal random variables is returned.

Author(s)

Wei-Chen Chen wccsnow@gmail.com.

References

https://github.com/snoweye/cubfits/

See Also

calc_scuo_values(), yassour.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
suppressMessages(library(cubfits, quietly = TRUE))

### example dataset.
y.scuo <- convert.y.to.scuo(ex.train$y)
SCUO <- calc_scuo_values(y.scuo)$SCUO
plotprxy(ex.train$phi.Obs, SCUO)

### yassour dataset.
GM <- apply(yassour[, -1], 1, function(x) exp(mean(log(x[x != 0]))))
phi.Obs <- GM / sum(GM) * 15000
mean(log(phi.Obs))
sd(log(phi.Obs))
ret <- scuo.random(SCUO, meanlog = -0.441473, sdlog = 1.393285)
plotprxy(ret, SCUO)

## End(Not run)

cubfits documentation built on Nov. 8, 2021, 1:07 a.m.