R/DPMMclus.R

#' DPGMMclus S3 Method
#'
#' Nonparametric Bayesian Dirichlet-Gaussian clustering of daily clearness index distributions. It can be also used to perform any
#' data clustering of class matrix other than irradiance data of class SIRData.
#'
#' @usage DPGMMclus(obj, n.iter, n.burn)
#'
#' @param obj object of class SIRData (see \code{\link{SIR_Data}}) or a matrix object containing the clearness index distributions.
#' @param n.iter numeric(1) represents the number of iterations
#' @param n.burn numeric(1) represents the number of burn-in iterations (ignored iterations)
#'
#' @return an object of clusData class containing:
#' \item{cl_seq}{numeric vector represents the class sequence.}
#' \item{like_par}{list0object represents the parameters of each class. 1st element is the mean (numeric vector), 5th element is the precision matrix
#' (inverse of the co-variance matrix) of the class.}
#' \item{lik_con_par}{numeric(1), represents the inferred concentration parameter alf.}
#' \item{Con_par_sam_seq}{numeric vector, represents the posterior distribution of alf.}
#' \item{seq_cl_num}{numeric vector, represents the distribution of the class numbers.}
#' \item{bet_seq}{numeric vector, represents the destribution of the beta parametrer of the precision matrix.}
#' \item{like_cl}{numeric vector, represents the number of elements of each class.}
#' \item{calc_time}{numeric(1) represents the computing time consumed.}
#'
#' @author Azeddine Frimane \email{Azeddine.frimane@@uit.ac.ma; Azeddine.frimane@@yahoo.com}
#'
#' @examples
#'
#' # The example and data below are just to give an idea of how the script works and not to judge the performance of the method.
#'
#' data("SIRData_obj")
#'
#' newClustering <- DPGMMclus(SIRData_obj, n.iter = 1000, n.burn = 500)
#' # for class ploting see clPlot function.
#'
#' @export
#============================================================================================
DPGMMclus <- function(obj, n.iter, n.burn) {

  UseMethod("DPGMMclus", obj)
}
#============================================================================================
#' @export
#============================================================================================
DPGMMclus.SIRData <- function(obj, n.iter = 1000, n.burn = 500) {
                             
  ClusDirGauss(meas = obj$matrixCI, n_iter = n.iter, n_burn = n.burn) 
}
#============================================================================================
#' @export
#============================================================================================
DPGMMclus.default <- function(obj, n.iter = 1000, n.burn = 500) {

  ClusDirGauss(meas = obj, n_iter = n.iter, n_burn = n.burn)
}
#=========================================== Fin ===============================================
frimane/SolarClusGnr documentation built on May 8, 2019, 8:58 p.m.