logLikelihood: Compute a loglikelihood ratio test

Description Usage Arguments Value Examples

View source: R/confidence.R

Description

Compute a likelihood ratio test based on the loglikelihoods of the residuals of two different models of the same data.

Usage

1
2
3
4
5
6
7
8
logLikelihood(
  in_1,
  in_2,
  df_1 = NULL,
  df_2 = NULL,
  in_pdf = NULL,
  verbose = FALSE
)

Arguments

in_1

Residuals of model 1 of the input data.

in_2

Residuals of model 2 of the input data.

df_1

Degrees of freedom of the input model 1. If either df_1 or df_2 is NULL, the difference between the degrees of freedom of the two models is assumed to be 1.

df_2

Degrees of freedom of the input model 2. If either df_1 or df_2 is NULL, the difference between the degrees of freedom of the two models is assumed to be 1.

in_pdf

Probability distribution function, passed on to computeLogLik, if NULL a normal distribution is used.

verbose

Verbose if in_verbose=1

Value

A list with entries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 library(BSgenome.Hsapiens.UCSC.hg19)
 data(lymphoma_test)
 data(sigs)
 data(cutoffs)
 word_length <- 3
 temp_list <- create_mutation_catalogue_from_df(
   lymphoma_test_df,this_seqnames.field = "CHROM",
   this_start.field = "POS",this_end.field = "POS",
   this_PID.field = "PID",this_subgroup.field = "SUBGROUP",
   this_refGenome = BSgenome.Hsapiens.UCSC.hg19,
   this_wordLength = word_length)
 lymphoma_catalogue_df <- temp_list$matrix
 lymphoma_PIDs <- colnames(lymphoma_catalogue_df)
 current_sig_df <- AlexCosmicValid_sig_df
 current_sigInd_df <- AlexCosmicValid_sigInd_df
 current_cutoff_vector <- cutoffCosmicValid_rel_df[6, ]
 iniLCDList <- LCD_complex_cutoff(
   in_mutation_catalogue_df = lymphoma_catalogue_df[, 1, drop = FALSE],
   in_signatures_df = current_sig_df,
   in_cutoff_vector = current_cutoff_vector,
   in_method = "relative", in_rescale = TRUE,
   in_sig_ind_df = current_sigInd_df)
 current_sig_df <- AlexCosmicValid_sig_df[, -9]
 current_sigInd_df <- AlexCosmicValid_sigInd_df[-9,]
 current_cutoff_vector <- cutoffCosmicValid_rel_df[6, -9]
 redLCDList <- LCD_complex_cutoff(
   in_mutation_catalogue_df = lymphoma_catalogue_df[, 1, drop = FALSE],
   in_signatures_df = current_sig_df,
   in_cutoff_vector = current_cutoff_vector,
   in_method = "relative", in_rescale = TRUE,
   in_sig_ind_df = current_sigInd_df)
 logLikelihood(iniLCDList, redLCDList)
 

slw287r/yapsa documentation built on June 7, 2020, 12:46 a.m.