API
Documentation for QuasiCopua.jl's functions.
Index
QuasiCopula.AR_modelQuasiCopula.CS_modelQuasiCopula.VC_modelQuasiCopula.fit!QuasiCopula.get_CIQuasiCopula.logl
Functions
QuasiCopula.fit! — Functionfit!(gcm::GLMCopulaARModel, solver=Ipopt.IpoptSolver)Fit an GLMCopulaARModel object by MLE using a nonlinear programming solver. This is for Poisson and Bernoulli base distributions with no additional base distribution parameters than the mean. Start point should be provided in gcm.β, gcm.ρ, gcm.σ2.
Arguments
gcm: AGLMCopulaARModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level=3, max_iter = 100, tol = 10^-6, limited_memory_max_history = 20, hessian_approximation = "limited-memory"))
fit!(gcm::GLMCopulaCSModel, solver=Ipopt.IpoptSolver)Fit an GLMCopulaCSModel object by MLE using a nonlinear programming solver. This is for Poisson and Bernoulli base distributions with no additional base distribution parameters than the mean. Start point should be provided in gcm.β, gcm.ρ, gcm.σ2.
Arguments
gcm: AGLMCopulaCSModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level=3, max_iter = 100, tol = 10^-6, limited_memory_max_history = 20, hessian_approximation = "limited-memory"))
fit!(gcm::Union{GaussianCopulaARModel, GaussianCopulaCSModel}, solver=Ipopt.IpoptSolver)Fit a GaussianCopulaARModel or GaussianCopulaCSModel object by MLE using a nonlinear programming solver. Start point should be provided in gcm.β, gcm.τ, gcm.ρ, gcm.σ2.
Arguments
gcm: AGaussianCopulaARModelorGaussianCopulaCSModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level=3, max_iter = 100, tol = 10^-6, limited_memory_max_history = 20, hessian_approximation = "limited-memory"))
fit!(gcm::Union{GLMCopulaVCModel, Poisson_Bernoulli_VCModel}, solver=Ipopt.IpoptSolver(print_level=5))Fit a GLMCopulaVCModel or Poisson_Bernoulli_VCModel model object by MLE using a nonlinear programming solver. This is for Poisson and Bernoulli base distributions or a mixture of the two with no additional base distribution parameters than the mean. Start point should be provided in gcm.β, gcm.θ.
Arguments
gcm: AGLMCopulaVCModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level=3, max_iter = 100, tol = 10^-6, limited_memory_max_history = 20, hessian_approximation = "limited-memory"))
fit!(gcm::NBCopulaVCModel, solver=Ipopt.IpoptSolver)Fit an NBCopulaVCModel object by block MLE using a nonlinear programming solver. Start point should be provided in gcm.β, gcm.θ, gcm.r. In our block updates, we fit 15 iterations of gcm.β, gcm.θ using IPOPT, followed by 10 iterations of Newton on nuisance parameter gcm.r. Convergence is declared when difference of successive loglikelihood is less than tol.
Arguments
gcm: ANBCopulaVCModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level = 0, max_iter = 15, limited_memory_max_history = 20, warm_start_init_point = "yes", mu_strategy = "adaptive", hessian_approximation = "limited-memory"))
Optional Arguments
tol: Convergence tolerance for the max block iter updates (defaulttol = 1e-6).maxBlockIter: Number of maximum block iterations to updategcm.β,gcm.θandgcm.r(defaultmaxBlockIter = 10).
fit!(gcm::NBCopulaARModel, solver=Ipopt.IpoptSolver)Fit an NBCopulaARModel object by block MLE using a nonlinear programming solver. Start point should be provided in gcm.β, gcm.ρ, gcm.σ2, gcm.r. In our block updates, we fit 15 iterations of gcm.β, gcm.ρ, gcm.σ2 using IPOPT, followed by 10 iterations of Newton on nuisance parameter gcm.r. Convergence is declared when difference of successive loglikelihood is less than tol.
Arguments
gcm: ANBCopulaARModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level = 0, max_iter = 15, limited_memory_max_history = 20, warm_start_init_point = "yes", mu_strategy = "adaptive", hessian_approximation = "limited-memory"))
Optional Arguments
tol: Convergence tolerance for the max block iter updates (defaulttol = 1e-6).maxBlockIter: Number of maximum block iterations to updategcm.β,gcm.θandgcm.r(defaultmaxBlockIter = 10).
fit!(gcm::NBCopulaCSModel, solver=Ipopt.IpoptSolver)Fit an NBCopulaCSModel object by block MLE using a nonlinear programming solver. Start point should be provided in gcm.β, gcm.ρ, gcm.σ2, gcm.r. In our block updates, we fit 15 iterations of gcm.β, gcm.ρ, gcm.σ2 using IPOPT, followed by 10 iterations of Newton on nuisance parameter gcm.r. Convergence is declared when difference of successive loglikelihood is less than tol.
Arguments
gcm: ANBCopulaCSModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level = 0, max_iter = 15, limited_memory_max_history = 20, warm_start_init_point = "yes", mu_strategy = "adaptive", hessian_approximation = "limited-memory"))
Optional Arguments
tol: Convergence tolerance for the max block iter updates (defaulttol = 1e-6).maxBlockIter: Number of maximum block iterations to updategcm.β,gcm.θandgcm.r(defaultmaxBlockIter = 10).
fit_quasi!(gcm::GaussianCopulaVCModel, solver=Ipopt.IpoptSolver)Fit an GaussianCopulaVCModel object by MLE using a nonlinear programming solver. Start point should be provided in gcm.β, gcm.θ, gcm.τ this is for Normal base.
Arguments
gcm: AGaussianCopulaVCModelmodel object.solver: Specified solver to use. By default we use IPOPT with 100 quas-newton iterations with convergence tolerance 10^-6. (defaultsolver = Ipopt.IpoptSolver(print_level=3, max_iter = 100, tol = 10^-6, limited_memory_max_history = 20, warm_start_init_point="yes", hessian_approximation = "limited-memory"))
QuasiCopula.logl — Functionlogl(gcm)Get the loglikelihood at the given parameters in gcm, at the optimal solution.
Arguments
gcm: One ofGaussianCopulaVCModel,GaussianCopulaARModel,GaussianCopulaCSModel,GLMCopulaVCModel,GLMCopulaARModel,GLMCopulaCSModel,NBCopulaVCModel,NBCopulaARModel,NBCopulaCSModelorPoisson_Bernoulli_VCModelmodel objects.
QuasiCopula.get_CI — Functionget_CI(gcm)Get the confidence interval of all parameters, at the optimal solution.
Arguments
gcm: One ofGaussianCopulaVCModel,GaussianCopulaARModel,GaussianCopulaCSModel,GLMCopulaVCModel,GLMCopulaARModel,GLMCopulaCSModel,NBCopulaVCModel,NBCopulaARModel,NBCopulaCSModelorPoisson_Bernoulli_VCModelmodel objects.
Models
QuasiCopula.AR_model — FunctionAR_model(df, y, grouping, d, link; penalized = penalized)Form the autoregressive (AR(1)) model for intercept only regression with the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance parameter for the AR(1) structured covariance. One can put true (e.g.penalized = true) to add this penalty for numerical stability (defaultpenalized = false).
AR_model(df, y, grouping, covariates, d, link; penalized = penalized)Form the autoregressive (AR(1)) model for regression with the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.covariates: Covariate names of interest as a vector ofSymbols. Each variable name must be present indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance parameter for the AR(1) structured covariance. One can put true (e.g.penalized = true) to add this penalty for numerical stability (defaultpenalized = false).
QuasiCopula.CS_model — FunctionCS_model(df, y, grouping, d, link)Form the compound symmetric (CS) model for intercept only regression with the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance parameter for the CS structured covariance. One can turn this option on by specifyingpenalized = trueto add this penalty for numerical stability. (defaultpenalized = false).
CS_model(df, y, grouping, covariates, d, link; penalized = penalized)Form the compound symmetric (CS) model for regression with the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.covariates: Covariate names of interest as a vector ofSymbols. Each variable name must be present indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance parameter for the CS structured covariance. One can turn this option on by specifyingpenalized = trueto add this penalty for numerical stability. (defaultpenalized = false).
QuasiCopula.VC_model — FunctionVC_model(df, y, grouping, d, link)Form the variance component model (VCM) for intercept only regression with a random intercept covariance matrix and the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance components vector. One can put true (e.g.penalized = true) to add this penalty for numerical stability (defaultpenalized = false).
VC_model(df, y, grouping, covariates, d, link)Form the variance component model (VCM) for regression with a random intercept covariance matrix and the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.covariates: Covariate names of interest as a vector ofSymbols. Each variable name must be present indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance components vector. One can put true (e.g.penalized = true) to add this penalty for numerical stability (defaultpenalized = false).
VC_model(df, y, grouping, covariates, V, d, link)Form the variance component model (VCM) for intercept only regression with the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.V: Vector of Vector of Positive Semi-Definite (PSD) Covariance Matrices.Vis of length n, where n is the number of groups/clusters. Each element ofVis also aVector, but of length m. Here m is the number of variance components. Each element ofVis aVectorof di x di PSD covariance matrices under the VCM framework, where d_i is the cluster size of the ith cluster, which may vary for each cluster of observations i in [1, n]. Each of these dimensions must match that specified indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance components vector. One can put true (e.g.penalized = true) to add this penalty for numerical stability (defaultpenalized = false).
VC_model(df, y, grouping, covariates, V, d, link)Form the variance component model (VCM) for regression with the specified base distribution (d) and link function (link).
Arguments
df: A namedDataFramey: Ouctcome variable name of interest, specified as aSymbol. This variable name must be present indf.grouping: Grouping or Clustering variable name of interest, specified as aSymbol. This variable name must be present indf.covariates: Covariate names of interest as a vector ofSymbols. Each variable name must be present indf.V: Vector of Vector of Positive Semi-Definite (PSD) Covariance Matrices.Vis of length n, where n is the number of groups/clusters. Each element ofVis also aVector, but of length m. Here m is the number of variance components. Each element ofVis aVectorof di x di PSD covariance matrices under the VCM framework, where d_i is the cluster size of the ith cluster, which may vary for each cluster of observations i in [1, n]. Each of these dimensions must match that specified indf.d: BaseDistributionof outcome fromDistributions.jl.link: CanonicalLinkfunction of the base distribution specified ind, fromGLM.jl.
Optional Arguments
penalized: Boolean to specify whether or not to add an L2 Ridge penalty on the variance components vector. One can put true (e.g.penalized = true) to add this penalty for numerical stability (defaultpenalized = false).