PhenSmoothWin: Complementary function for "testDataset" that allows soft...

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/PhenSmoothWin.R

Description

Running this function allows a range of windowing on the analysis method. The bandwidth and sharpness of the window are controlled by two parameters l and k respectively.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
PhenSmoothWin(
  testDatasetObj,
  l = 4:5,
  k = 1:2,
  min.obs   = 50,
  criteria  = 'AICc',
  method    = 'enet',
  threshold = 10 ^ -18,
  plot      = FALSE
)

Arguments

testDatasetObj

the output of testDataset function

l

a positive vector of at least one value for the bandwidth parameter. The function searches for the best window among these values. For example, l=1:10 searches for the optimal windows in the radius of 10 (20 units since the l is symmetric).

k

a positive vector of at least one value for the shape parameter. The function searches for the optimal sharpness among these values.

min.obs

the minimum number of observations that must be included in the window. The default is 50

criteria

select among 'AICc', 'BIC', 'GCV' and 'Cp' for the penalized change point selection criteria. The default is 'AICc'

method

select between 'enet' and 'alasso' for the lasso and adaptive-lasso respectively in the penalized change point detection algorithm. The default is 'enet'

threshold

a single value. The threshold for the weighting function that pushes the weights to zero. Default is 10^-18

plot

logical flag. Setting to TRUE shows some plots. Data must be sorted on Batch to get neat plots.

Value

finalk

The optimal value for k

finall

The optimal value for l

finalModel

a list of the single element that contains the final model

model.l

a list that contains all models for the different values of l

model.k

a list that contains all models for the different values of k

x

a data frame that contains the explanatory variables (data)

y

response data

t

batch data that is converted to UNIX time stamp

k

similar to the input parameter k

l

similar to the input parameter l

min.obs

similar to the input parameter min.obs

mutInd

The index of the mutant animals

threshold

similar to the input parameter threshold

plot

similar to the input parameter plot

Note

*** Hard windowing can be achieved by fixing "l"" to the bandwidth of interest and setting "k" to a big value such as 20.

Author(s)

Hamed Haselimashhadi <[email protected]>

See Also

testDataset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
    set.seed(123456)
    par(ask=FALSE)
    # Mixed Model framework
    file    <- system.file("extdata", "test1.csv", package = "PhenStat")
    csvFile <- read.csv(file, na.strings = '-')
    data    <- csvFile[order(as.Date(csvFile$Assay.Date)), ]
    test    <- PhenList(dataset = data,
                        testGenotype = "Sparc/Sparc",
                        outputMessages = FALSE)
    result <- testDataset(test,
                          depVariable = "Lean.Mass",
                          outputMessages = FALSE)
    SofWinresult = PhenSmoothWin(
      testDatasetObj = result,
      plot = TRUE,
      l = 10,
      k = 5
    )
    SofWinresult$finalModel$models[[1]]

PhenStat documentation built on Nov. 17, 2017, 1:34 p.m.