diff --git a/R/kfino.R b/R/kfino.R index 0a20f777c18bd1c38e5c813f15fb2b1fee2e9bf9..5bed5dcf9fbc23d5cdaa3bb6b42c004ce4a43205 100644 --- a/R/kfino.R +++ b/R/kfino.R @@ -102,14 +102,6 @@ #' verbose=TRUE) #' Sys.time() - t0 #' -#' # --- With Optimization on initial parameters - EM method -#' t0 <- Sys.time() -#' resu1b<-kfino_fit(datain=spring1, -#' Tvar="dateNum",Yvar="Poids", -#' doOptim=TRUE,method="EM",param=param1, -#' verbose=TRUE) -#' Sys.time() - t0 -#' #' # --- Without Optimization on initial parameters #' t0 <- Sys.time() #' param2<-list(m0=41, @@ -129,26 +121,6 @@ #' doOptim=FALSE, #' verbose=FALSE) #' Sys.time() - t0 -#' -#' # complex data on merinos2 dataset -#' data(merinos2) -#' -#' t0 <- Sys.time() -#' param3<-list(m0=NULL, -#' mm=NULL, -#' pp=NULL, -#' aa=0.001, -#' expertMin=10, -#' expertMax=45, -#' sigma2_m0=1, -#' sigma2_mm=0.05, -#' sigma2_pp=5, -#' K=2, -#' seqp=seq(0.5,0.7,0.1)) -#' resu3<-kfino_fit(datain=merinos2, -#' Tvar="dateNum",Yvar="Poids", -#' doOptim=TRUE,method="ML",param=param3) -#' Sys.time() - t0 kfino_fit<-function(datain,Tvar,Yvar, param=NULL, doOptim=TRUE,method="ML", diff --git a/R/utils_functions.R b/R/utils_functions.R index 465eb6f2f94a847115c00f360a6bcb89c6a54f2a..2161bfbf41e9b273e02dea9289a304cae49b78ac 100644 --- a/R/utils_functions.R +++ b/R/utils_functions.R @@ -52,7 +52,8 @@ doutlier<-function(y, #' Tvar can be expressed as a proportion of day in seconds #' @param N numeric, length of the numeric vector of Y values #' -#' @details uses the same input parameter list than the main function +#' @details utils_fit is a tool function used in the main \code{kfino_fit} +#' function. It uses the same input parameter list than the main function. #' @return a list #' \describe{ #' \item{prediction}{vector, the prediction of weights} @@ -250,7 +251,9 @@ utils_fit<-function(param,threshold,kappa=10,Y,Tps,N){ #' @param scalingC numeric, scaling constant. To be changed if the function is #' not able to calculate the likelihood because the number of data is large #' -#' @details uses the same input parameter list than the main function +#' @details utils_likelihood is a tool function used in the main +#' \code{kfino_fit} function. It uses the same input parameter list than +#' the main function. #' @return a likelihood #' @keywords internal #' @export @@ -401,7 +404,8 @@ utils_likelihood<-function(param,kappaOpt=7,Y,Tps,N,scalingC){ #' @param scalingC numeric, scaling constant. To be changed if the function is #' not able to calculate the likelihood because the number of data is large #' -#' @details uses the same input parameter list than the main function +#' @details utils_EM is a tool function used in the main \code{kfino_fit} +#' function. It uses the same input parameter list than the main function. #' @return a list: #' \describe{ #' \item{m0}{numeric, optimized m0} diff --git a/man/kfino_fit.Rd b/man/kfino_fit.Rd index b0bc99d8230b1034e3773f8a77e5fbbbaae30c90..1f31a835b92fa5d74705c8c878bdcea2e62b4d71 100644 --- a/man/kfino_fit.Rd +++ b/man/kfino_fit.Rd @@ -132,14 +132,6 @@ resu1<-kfino_fit(datain=spring1, verbose=TRUE) Sys.time() - t0 -# --- With Optimization on initial parameters - EM method -t0 <- Sys.time() -resu1b<-kfino_fit(datain=spring1, - Tvar="dateNum",Yvar="Poids", - doOptim=TRUE,method="EM",param=param1, - verbose=TRUE) -Sys.time() - t0 - # --- Without Optimization on initial parameters t0 <- Sys.time() param2<-list(m0=41, @@ -159,24 +151,4 @@ resu2<-kfino_fit(datain=spring1, doOptim=FALSE, verbose=FALSE) Sys.time() - t0 - -# complex data on merinos2 dataset -data(merinos2) - -t0 <- Sys.time() -param3<-list(m0=NULL, - mm=NULL, - pp=NULL, - aa=0.001, - expertMin=10, - expertMax=45, - sigma2_m0=1, - sigma2_mm=0.05, - sigma2_pp=5, - K=2, - seqp=seq(0.5,0.7,0.1)) -resu3<-kfino_fit(datain=merinos2, - Tvar="dateNum",Yvar="Poids", - doOptim=TRUE,method="ML",param=param3) -Sys.time() - t0 } diff --git a/man/utils_EM.Rd b/man/utils_EM.Rd index 7c19d22259f27bf9f0738e7d571fd83f7589b67f..e163b7bf4b0bd6fb67322d022bd4429a9b48e4f2 100644 --- a/man/utils_EM.Rd +++ b/man/utils_EM.Rd @@ -39,7 +39,8 @@ utils_EM a function to estimate the parameters `m_0` , `mm`, `pp` through an Expectation-Maximization (EM) method } \details{ -uses the same input parameter list than the main function +utils_EM is a tool function used in the main \code{kfino_fit} +function. It uses the same input parameter list than the main function. } \examples{ set.seed(1234) diff --git a/man/utils_fit.Rd b/man/utils_fit.Rd index 4372b67d04c6af9fe4acec49ed7891fa804859f5..96acdcba02c564830010d6f925c0dfe535339669 100644 --- a/man/utils_fit.Rd +++ b/man/utils_fit.Rd @@ -40,7 +40,8 @@ utils_fit a fonction running the kfino algorithm to filter data and detect outliers under the knowledge of all parameters } \details{ -uses the same input parameter list than the main function +utils_fit is a tool function used in the main \code{kfino_fit} +function. It uses the same input parameter list than the main function. } \examples{ set.seed(1234) diff --git a/man/utils_likelihood.Rd b/man/utils_likelihood.Rd index 05bf42e0a4b0df6d81d03ccff998ffba9e5dd182..596156993afb509b29cfa40c1ca7dac86c4cd1f1 100644 --- a/man/utils_likelihood.Rd +++ b/man/utils_likelihood.Rd @@ -33,7 +33,9 @@ utils_likelihood a function to calculate a likelihood on initial parameters optimized by a grid search } \details{ -uses the same input parameter list than the main function +utils_likelihood is a tool function used in the main +\code{kfino_fit} function. It uses the same input parameter list than +the main function. } \examples{ set.seed(1234)