import("methods")

##importFrom("stats", "end", "time", "start")
importFrom("graphics", "plot")
import("zoo")
importFrom(stats, confint)
import("stats4")
import("expm")
import("mvtnorm")
import("cubature")

importFrom(utils, toLatex)

importFrom("graphics", "lines")
importFrom("stats", "qchisq")
importFrom("utils", "relist")

#08/07/2016
#exportPattern("^[[:alpha:]]+") # NEVER DO THIS AGAIN PLEASE!
importFrom(Rcpp, evalCpp)

# 03/07/2015
importFrom(stats, time)
importFrom(stats, ts)
importFrom(stats, rnorm)
importFrom(stats, na.omit)
importFrom(stats, dgamma)
importFrom(stats, optimHess)
importFrom(stats, filter)
importFrom(utils, tail)
importFrom(utils, head)
importFrom(stats, acf)
importFrom(stats, fft)
importFrom(stats, rexp)
importFrom(stats, approx)
importFrom(stats, arima0)
importFrom(stats, frequency)
importFrom(stats, D)
importFrom(stats, integrate)
importFrom(stats, rpois)
importFrom(stats, runif)
importFrom(stats, optim)
importFrom(stats, optimize)
importFrom(stats, deltat)
importFrom(stats, pchisq)
importFrom(stats, symnum)
importFrom(stats, rchisq)
importFrom(stats, rgamma)
importFrom(stats, diffinv)
importFrom(stats, pnorm)
importFrom(stats, approxfun)
importFrom(stats, qnorm)
importFrom(stats, rbinom)
importFrom(stats, constrOptim)
importFrom(stats, dnorm)
importFrom(stats, deriv)
importFrom(graphics, points)
importFrom(stats, end)
importFrom(stats, start)
importFrom(utils, str)
importFrom(stats, sd)


exportClasses("yuima",
"yuima.data",
"yuima.law",
"yuima.sampling",
"yuima.characteristic",
"yuima.model",
"model.parameter",
"yuima.carma",
"carma.info",
"yuima.carma.qmle",
"yuima.poisson",
"yuima.qmle",
"yuima.CP.qmle",
"cogarch.info",
"yuima.cogarch",
"yuima.Map",
"info.Map",
"param.Map",
"yuima.multimodel",
"param.Integral",
"variable.Integral",
"Integrand",
"Integral.sde",
"yuima.Integral",
"info.Ppr",
"yuima.Ppr",
"yuima.Hawkes"
)

exportMethods(
"dim",
"length",
## "start",
"plot",
## "time",
## "end",
"simulate",
"cce",
"llag",
"poisson.random.sampling",
"get.zoo.data",
"initialize",
##              "ql",
##              "rql",
##              "ml.ql",
"adaBayes",
"lseBayes",
"limiting.gamma",
"getF",
"getf",
"getxinit",
"gete",
"simFunctional",
"F0",
"Fnorm",
"asymptotic_term",
"cbind.yuima",
"rand",
"dens",
"cdf",
"quant",
"char"
#"rbind.yuima"
)

## function which we want to expose to the user
## all other functions are used internally by the
## package
export(ybook)
export(setYuima)
export(setModel) ## builds sde model
export(setData)
export(setSampling)
export(setCharacteristic)
export(setCarma)
export(setPoisson)
export(setPpr)
export(setHawkes)
export(dconst)
export(rconst)
export(setLaw)
export(setCogarch)
export(setMap)
#export(setMultiModel)
export(setIntegral)

export(dim)
export(length)
#export(start)
export(plot)
#export(time)
#export(end)

export(simulate) # simulates couple of processes
export(subsampling)
export(cce)
export(llag)
export(poisson.random.sampling)
export(noisy.sampling)
export(mpv)
export(bns.test)
export(hyavar) # asymptotic variance estimator for the Hayashi-Yoshida estimator
export(lmm) # Oct. 10, 2015: local methods of moment estimator
export(mllag) # Oct. 10, 2015: multiple lead-lag detector

export(get.zoo.data)

##export(ql,rql,ml.ql)
##export(rql)
export(adaBayes)
export(lseBayes)
export(rIG, rNIG, rbgamma, rvgamma, rstable,rpts,rnts, rGIG, rGH) ## random number generators in rng.R
export(dIG, dNIG, dbgamma, dvgamma, dGIG, dGH) ## pdfs in rng.R
export(limiting.gamma)
export(lambdaFromData)


export(setFunctional)
export(getF)
export(getf)
export(getxinit)
export(gete)

export(simFunctional)
export(F0)
export(Fnorm)
export(asymptotic_term)

##export(LSE)
export(lse)

export(qmle)
export(quasilogl)
export(phi.test)
export(lasso)
export(CPoint)
export(qmleR)
export(qmleL)

export(Intensity.PPR)


export(CarmaNoise) # Estimates the Levy in carma model
export(gmm) # Estimation COGARCH(P,Q) using Method Of Moments
export(cogarchNoise)
export(Diagnostic.Cogarch)
export(Diagnostic.Carma)

# Methods
export(rand)# random number generator of a Levy process specified by user
export(dens)
export(cdf)
export(quant)
export(char)


export(qgv)
export(mmfrac)

export(cbind.yuima)
#export(rbind.yuima)
S3method(print, phitest)
S3method(print, qgv)
S3method(print, mmfrac)
S3method(print, yuima.lasso)
S3method(print, yuima.llag) # Oct. 10, 2015
S3method(print, yuima.mllag) # Oct. 10, 2015
S3method(print, yuima.specv) # Oct. 10, 2015


S3method(toLatex, yuima)
S3method(toLatex, yuima.model)
S3method(toLatex, yuima.carma)
S3method(toLatex, yuima.cogarch)
S3method(rbind, yuima.model)

S3method(plot, yuima.llag) # Oct. 10, 2015
S3method(plot, yuima.mllag) # Oct. 10, 2015

useDynLib(yuima)


