# NAMESPACE file for PerformanceAnalytics

importFrom("utils", "packageDescription")
importFrom("stats", "sd")

importFrom("zoo", "rollapply")

# export all functions/variables that don't start with a .
# exportPattern("^[^\\.]")


export(
    ActivePremium,
    AdjustedSharpeRatio,
    apply.fromstart,
    apply.rolling,
    AppraisalRatio,
    AverageDrawdown,
    BernardoLedoitRatio,
    BetaCoKurtosis,
    BetaCoSkewness,
    BetaCoVariance,
    BurkeRatio,
    CalculateReturns,
    CalmarRatio,
    CAPM.alpha,
    CAPM.beta,
    CAPM.beta.bear,
    CAPM.beta.bull,
    CAPM.CML,
    CAPM.CML.slope,
    CAPM.epsilon,
    CAPM.jensenAlpha,
    CAPM.RiskPremium,
    CAPM.SML.slope,
    CDD,
    checkData,
    clean.boudt,
    CoKurtosis,
#    CoKurtosisMatrix, #export after co-moments paper is done
    CoSkewness,
#    CoSkewnessMatrix, #export after co-moments paper is done
    CoVariance,
    DownsideDeviation,
    DownsideFrequency,
    DownsidePotential,
    DRatio,
    Drawdowns,
    DrawdownDeviation,
    ES,
    ETL,
    CVaR,
    DrawdownPeak,
    findDrawdowns,
    FamaBeta,
    Frequency,
    InformationRatio,
    Kappa,
    KellyRatio,
    kurtosis,
    M2Sortino,
    maxDrawdown,
    MartinRatio,
    MeanAbsoluteDeviation,
    mean.geometric,
    mean.LCL,
    mean.stderr,
    mean.UCL,
    MSquared,
    MSquaredExcess,
    NetSelectivity,
    Omega,
    OmegaExcessReturn,
    OmegaSharpeRatio,
#    pfolioReturn,
    PainIndex,
    PainRatio,
    ProspectRatio,
    Return.annualized,
    Return.calculate,
    Return.centered,
    Return.clean,
    Return.cumulative,
    Return.excess,
    Return.Geltner,
    Return.portfolio,
    Return.rebalancing,
    Return.read,
    Return.relative,
    sd.annualized,
    sd.multiperiod,
    Selectivity,
    SemiDeviation,
    SemiVariance,
    SharpeRatio,
    SharpeRatio.annualized,
    SharpeRatio.modified,
    skewness,
    SkewnessKurtosisRatio,
    SmoothingIndex,
    sortDrawdowns,
    SortinoRatio,
    SpecificRisk,
    StdDev,
    StdDev.annualized,
    SterlingRatio,
    SystematicRisk,
#    style.fit,
#    style.QPfit,
    TimingRatio,
    TotalRisk,
    TrackingError,
    TreynorRatio,
    UpDownRatios,
    UPR,
    UpsideFrequency,
    UpsidePotentialRatio,
    UpsideRisk,
    VaR,
    VolatilitySkewness
)

## Tables
export(
    table.AnnualizedReturns,
    table.Arbitrary,
    table.Autocorrelation,
    table.CalendarReturns,
    table.CAPM,
    table.CaptureRatios,
    table.Correlation,
    table.Distributions,
    table.DownsideRisk,
    table.DownsideRiskRatio,
    table.Drawdowns,
    table.DrawdownsRatio,
    table.HigherMoments,
    table.InformationRatio,
    table.Returns,
    table.SpecificRisk,
    table.Stats,
    table.TrailingPeriods,
    table.TrailingPeriodsRel,
    table.UpDownRatios,
    table.Variability
)

## Charts
export(
    chart.ACF,
    chart.ACFplus,
    chart.Bar,
    charts.Bar,
    chart.BarVaR,
    charts.BarVaR,
    chart.Boxplot,
    chart.CaptureRatios,
    chart.Correlation,
#    chart.Correlation.color,
    chart.CumReturns,
    chart.Drawdown,
    chart.ECDF,
    chart.Events,
    chart.Histogram,
    chart.QQPlot,
    chart.Regression,
    chart.RelativePerformance,
    chart.RiskReturnScatter,
    chart.RollingCorrelation,
    chart.RollingMean,
    chart.RollingPerformance,
    chart.RollingRegression,
    chart.RollingQuantileRegression,
#    chart.RollingStyle,
    chart.Scatter,
    chart.SnailTrail,
    charts.PerformanceSummary,
    charts.RollingPerformance,
    charts.RollingRegression,
    chart.StackedBar,
#    chart.Style,
    chart.TimeSeries,
    chart.VaRSensitivity,
    textplot
)

export(
    allsymbols,
    bluefocus,
    bluemono,
    bond.dates,
    bond.labels,
    closedsymbols,
    cycles.dates,
    dark6equal,
    dark8equal,
    equity.dates,
    equity.labels,
    fillsymbols,
    greenfocus,
    greenmono,
    grey6mono,
    grey8mono,
    legend,
    linesymbols,
    macro.dates,
    macro.labels,
    opensymbols,
    rainbow10equal,
    rainbow12equal,
    rainbow6equal,
    rainbow8equal,
    redfocus,
    redmono,
    rich10equal,
    rich12equal,
    rich6equal,
    rich8equal,
    risk.dates,
    risk.labels,
    set6equal,
    set8equal,
    tim10equal,
    tim12equal,
    tim6equal,
    tim8equal
)

S3method(textplot, default)
S3method(textplot, character)
S3method(textplot, data.frame)
S3method(textplot, matrix)

# # Export These
# ActivePremium
# apply.fromstart
# apply.rolling
# BetaCoKurtosis
# BetaCoSkewness
# BetaCoVariance
# CalculateReturns
# CalmarRatio
# CAPM.alpha
# CAPM.beta
# CAPM.beta.bear
# CAPM.beta.bull
# CAPM.CML
# CAPM.CML.slope
# CAPM.RiskPremium
# CAPM.SML.slope
# chart.ACF
# chart.ACFplus
# chart.Bar
# chart.BarVaR
# chart.Boxplot
# chart.CaptureRatios
# chart.Correlation
# chart.Correlation.color
# chart.CumReturns
# chart.Drawdown
# chart.ECDF
# chart.Histogram
# chart.QQPlot
# chart.Regression
# chart.RelativePerformance
# chart.RiskReturnScatter
# chart.RollingCorrelation
# chart.RollingMean
# chart.RollingPerformance
# chart.RollingRegression
# chart.RollingStyle
# chart.Scatter
# chart.SnailTrail
# charts.PerformanceSummary
# charts.RollingPerformance
# charts.RollingRegression
# chart.StackedBar
# chart.Style
# chart.TimeSeries
# chart.VaRSensitivity
# checkData
# clean.boudt
# CoKurtosis
# CoKurtosisMatrix
# CoSkewness
# CoSkewnessMatrix
# CoVariance
# DownsideDeviation
# Drawdowns
# ES
# findDrawdowns
# InformationRatio
# KellyRatio
# kurtosis
# maxDrawdown
# mean.geometric
# mean.LCL
# mean.stderr
# mean.UCL
# modifiedVaR
# modSharpe
# multivariate_mean
# Omega
# pfolioReturn
# Return.annualized
# Return.calculate
# Return.centered
# Return.clean
# Return.cumulative
# Return.excess
# Return.Geltner
# Return.portfolio
# Return.portfolio.multiweight
# Return.read
# Return.relative
# sd.annualized
# sd.multiperiod
# SemiDeviation
# SemiVariance
# SharpeRatio
# SharpeRatio.annualized
# SharpeRatio.modified
# skewness
# SmoothingIndex
# sortDrawdowns
# SortinoRatio
# SterlingRatio
# style.fit
# style.QPfit
# table.AnnualizedReturns
# table.Arbitrary
# table.Autocorrelation
# table.CalendarReturns
# table.CAPM
# table.CaptureRatios
# table.Correlation
# table.DownsideRisk
# table.Drawdowns
# table.HigherMoments
# table.MonthlyReturns
# table.Returns
# table.UpDownRatios
# textplot
# TimingRatio
# TrackingError
# TreynorRatio
# UpDownRatios
# UPR
# UpsidePotentialRatio
# VaR

# # graphics stuff to export
# allsymbols
# bluefocus
# bluemono
# bond.dates
# bond.labels
# closedsymbols
# cycles.dates
# dark6equal
# dark8equal
# equity.dates
# equity.labels
# fillsymbols
# greenfocus
# greenmono
# grey6mono
# grey8mono
# legend
# linesymbols
# macro.dates
# macro.labels
# opensymbols
# rainbow10equal
# rainbow12equal
# rainbow6equal
# rainbow8equal
# redfocus
# redmono
# rich10equal
# rich12equal
# rich6equal
# rich8equal
# risk.dates
# risk.labels
# set6equal
# set8equal
# tim10equal
# tim12equal
# tim6equal
# tim8equal

# # internal/obsolete functions, do not export
# centeredcomoment
# centeredmoment
# checkDataMatrix
# checkDataVector
# checkDataZoo
# derIpower
# derportm2
# derportm3
# derportm4
# download.RiskFree
# download.SP500PriceReturns
# ES.CornishFisher
# ES.CornishFisher.portfolio
# ES.Gaussian
# ES.Gaussian.portfolio
# ES.historical.portfolio
# GES.MM
# GVaR.MM
# Ipower
# kernel
# kurtosis.MM
# mES.MM
# modifiedVaR
# multivariate_mean
# mVaR.MM
# M3.MM
# M4.MM
# portm2
# portm3
# portm4
# Portmean
# Portsd
# precision
# pvalJB
# operES.CornishFisher
# operES.CornishFisher.portfolio
# skewness.MM
# SR.GES.MM
# SR.GVaR.MM
# SR.mES.MM
# SR.mVaR.MM
# SR.StdDev.MM
# statsTable
# std
# StdDev.annualized
# StdDev.MM
# textplot.character
# textplot.data.frame
# textplot.default
# textplot.matrix
# timing.ratio
# VaR.Beyond
# VaR.CornishFisher
# VaR.CornishFisher.portfolio
# VaR.Gaussian
# VaR.Gaussian.portfolio
# VaR.historical.portfolio
# VaR.kernel.portfolio
# VaR.Marginal
# VaR.mean
# VaR.traditional
