Description Usage Arguments Value References Examples
Performs goodnessoffit test through Khmaladze matringale transformation
1  KhmaladzeTrans(X, Modified = FALSE, strDist, bGraph = FALSE, nNum = 10)

X 
a random sample of n observations 
Modified 
a logical value which specifies whether or not to use the modeifed version of the test: False calls the original version while True calls the modified version. 
strDist 
the name of the null distribution for the hypothesis test: Normal, Cauchy, or Logistic. Other distributions such as Gumbel, Weibull and Frechet will be available in later versions. 
bGraph 
a logical value which specifies whether or not to get the graph of the objective function of the martingale transformation. 
nNum 
the number of ticks on each segmented interval when drawing the graph of the objective function. The default is 10. Bigger value will result in a smoother graph. 
A list of the following values:
When Modified is False, opt.x is the value of x where the optimum of the objective function  which is also the test statistic  occurs.
When Modified is True, opt.x is the vector of the value of x's where the infimum and supremum of U_{n} occur.
When Modified is False, test.stat is the test statistic obtained through Khmaladze martingale transformation.
When Modified is True, test.stat is the vector of the supremum of U_{n}, the infimum of U_{n}, and the difference of them.
a data frame which includes the information of the objective function.
a ggplot object which includes the graph of the objective function.
a list of segmented intervals over which the graph of the objective function is defined.
the point estimate for the location parameter mu
the point estimate for the scale parameter sigma
[1] Khmaladze, E.V., Koul, H.L. (2004). Martingale transforms goodnessoffit tests in regression models. Ann. Statist., 32. 9951034
[2] E.V. Khmaladze, H.L. Koul (2009). Goodnessoffit problem for errors in nonparametric regression: distribution free approach. Ann. Statist., 37(6A) 31653185.
[3] Kim, Jiwoong (2020). Implementation of a goodnessoffit test through Khmaladze martingale transformation. Comp. Stat., 35(4): 19932017
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66  ####################
n = 10
X = rnorm(n, 1,3) # Generate a random sample of n observations from N(1,3)
strDist = "Normal"
Modified=FALSE
lResult = KhmaladzeTrans(X, Modified, strDist, bGraph=TRUE, nNum=10)
KMT_OptimalX = lResult$opt.x
KMT_TestStat = lResult$test.stat
KMT_DM = lResult$graph.data
KMT_Graph = lResult$graph
#### Draw the graph of the objective function
KMT_Graph
KMT_Intervals = lResult$intervals
KMT_Muhat = lResult$mu
KMT_Sigmahat = lResult$sigma
#####################
#####################
n = 10
X = rlogis(n, 1,2) # Generate a random sample of n observations from the logistic distribution
strDist = "Logistic"
Modified=TRUE
lResult = KhmaladzeTrans(X, Modified, strDist, bGraph=TRUE, nNum=10)
KMT_Optimal_Positive_X = lResult$opt.x[1]
KMT_Optimal_Negative_X = lResult$opt.x[2]
KMT_Postive_TestStat = lResult$test.stat[1]
KMT_Negative_TestStat = lResult$test.stat[2]
KMT_TestStat = lResult$test.stat[3]
KMT_DM = lResult$graph.data
KMT_Graph = lResult$graph
#### Draw the graph of the objective function
KMT_Graph
KMT_Intervals = lResult$intervals
KMT_Muhat = lResult$mu
KMT_Sigmahat = lResult$sigma
#####################
#####################
n = 10
X = rcauchy(n, 0,1) # Generate a random sample of n observations from Cauchy distribution
strDist = "Cauchy"
Modified=FALSE
lResult = KhmaladzeTrans(X, Modified, strDist, bGraph=TRUE, nNum=10)
KMT_OptimalX = lResult$opt.x
KMT_TestStat = lResult$test.stat
KMT_DM = lResult$graph.data
KMT_Graph = lResult$graph
#### Draw the graph of the objective function
KMT_Graph
KMT_Intervals = lResult$intervals
KMT_Muhat = lResult$mu
KMT_Sigmahat = lResult$sigma
#####################

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.