fitNormDistr-methods: fitNormDistr

Description Usage Arguments Details Value Examples

Description

fit normal distribution to diffusion coefficient caclulated by Dcoef method.

Usage

1
2
fitNormDistr(dcoef,components=NULL,log.transform=F,binwidth=NULL,
             combine.plot=F,output=F,seed=NULL)

Arguments

dcoef

diffusion coefficient calculated from Dcoef().

components

parameter specifying the number of components to fit. If NULL (default), a components analysis is done to determine the most likely components and this number is then used for subsequent analysis.

log.transform

logical indicate if log10 transformation is needed, default F.

binwidth

binwidth for the combined plot. If NULL (default), will automatic assign binwidth.

combine.plot

Logical indicating if all the plot should be combined into one, with same scale (/same axises breaks), same color theme, and same bin size for comparison.

output

Logical indicaring if output file should be generated.

seed

Seed for random number generator. This makes each run easily repeatable. Seed will be automatically assigned if no seed is specified (default). The seed information is stored as an attribute of the returned object. The seed can also be output to a txt file when output=T.

Details

components analysis uses the likelihood ratio test (LRT) to assess the number of mixture components.

Value

proportions

The proportions of mixing components.

mean

The Means of the components.

sd

The Standard Deviations (SD) of components if not log transformed; if log transformed, it is then interpreted as Coefficient of Variation (CV).

loglik

The log likelihood, useful for compare different fitting result, the bigger the better fit.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# compare folders
folder1=system.file("extdata","SWR1",package="smt")
folder2=system.file("extdata","HTZ1",package="smt")
trackll=compareFolder(c(folder1,folder2))
MSD=msd(trackll=trackll)
dcoef=Dcoef(MSD,dt=6,plot=T,output=F)
# fit dcoef
a=fitNormDistr(dcoef,components=NULL,log.transform=F,combine.plot=F,output=F)
# to repeat a
b=fitNormDistr(dcoef,components=NULL,log.transform=F,combine.plot=F,output=F,seed=attr(a,"seed"))
# if a and b are the same
mapply(identical,a[[1]],b[[1]])

sheng-liu/smt documentation built on May 29, 2019, 9:22 p.m.