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)


# 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.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"
)

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

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

export(setCogarch)

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(get.zoo.data)

##export(ql,rql,ml.ql)
##export(rql)
export(adaBayes)
export(rIG, rNIG, rbgamma, rngamma, rstable) ##:: random number generator for Inverse Gaussian
export(limiting.gamma)

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(CarmaNoise) # Estimates the Levy in carma model
export(gmm) # Estimation COGARCH(P,Q) using Method Of Moments
export(cogarchNoise)
export(Diagnostic.Cogarch)


export(qgv)
export(mmfrac)

export(cbind.yuima)

S3method(print, phitest)
S3method(print, qgv)
S3method(print, mmfrac)
S3method(print, yuima.lasso)

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

useDynLib(yuima)


