{
  "_id": "6a1ed4f0b401979e7340e40e",
  "Package": "qfratio",
  "Type": "Package",
  "Title": "Moments and Distributions of Ratios of Quadratic Forms Using\nRecursion",
  "Version": "1.1.1.9000",
  "Date": "2026-05-20",
  "Authors@R": "c(person(\"Junya\", \"Watanabe\",\nemail = \"Junya.Watanabe@vetmeduni.ac.at\",\nrole = c(\"aut\", \"cre\", \"cph\"),\ncomment = c(ORCID = \"0000-0002-9810-5286\")),\nperson(\"Patrick\", \"Alken\", role = \"cph\",\ncomment = \"Author of bundled C codes from GSL\"),\nperson(\"Brian\", \"Gough\", role = \"cph\",\ncomment = \"Author of bundled C codes from GSL\"),\nperson(\"Pavel\", \"Holoborodko\", role = \"cph\",\ncomment = \"Author of bundled C codes from GSL\"),\nperson(\"Gerard\", \"Jungman\", role = \"cph\",\ncomment = \"Author of bundled C codes from GSL\"),\nperson(\"Reid\", \"Priedhorsky\", role = \"cph\",\ncomment = \"Author of bundled C codes from GSL\"),\nperson(\"Free Software Foundation, Inc.\", role = \"cph\",\ncomment = \"Copyright holder of some bundled scripts\"))",
  "Description": "Evaluates moments of ratios (and products) of quadratic\nforms in normal variables, specifically using recursive\nalgorithms developed by Bao and Kan (2013)\n<doi:10.1016/j.jmva.2013.03.002> and Hillier et al. (2014)\n<doi:10.1017/S0266466613000364>. Also provides distribution,\nquantile, and probability density functions of simple ratios of\nquadratic forms in normal variables with several algorithms.\nOriginally developed as a supplement to Watanabe (2023)\n<doi:10.1007/s00285-023-01930-8> for evaluating average\nevolvability measures in evolutionary quantitative genetics,\nbut can be used for a broader class of statistics. Generating\nfunctions for these moments are also closely related to the\ntop-order zonal and invariant polynomials of matrix arguments.",
  "License": "GPL (>= 3)",
  "URL": "https://github.com/watanabe-j/qfratio",
  "BugReports": "https://github.com/watanabe-j/qfratio/issues",
  "Encoding": "UTF-8",
  "Roxygen": "list(markdown = TRUE)",
  "RoxygenNote": "7.3.3",
  "Config/testthat/edition": "3",
  "VignetteBuilder": "knitr, rmarkdown",
  "Repository": "https://watanabe-j.r-universe.dev",
  "Date/Publication": "2026-05-20 08:10:37 UTC",
  "RemoteUrl": "https://github.com/watanabe-j/qfratio",
  "RemoteRef": "HEAD",
  "RemoteSha": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-05-20 11:16:08 UTC",
    "User": "root"
  },
  "Author": "Junya Watanabe [aut, cre, cph] (ORCID:\n<https://orcid.org/0000-0002-9810-5286>),\nPatrick Alken [cph] (Author of bundled C codes from GSL),\nBrian Gough [cph] (Author of bundled C codes from GSL),\nPavel Holoborodko [cph] (Author of bundled C codes from GSL),\nGerard Jungman [cph] (Author of bundled C codes from GSL),\nReid Priedhorsky [cph] (Author of bundled C codes from GSL),\nFree Software Foundation, Inc. [cph] (Copyright holder of some bundled\nscripts)",
  "Maintainer": "Junya Watanabe <Junya.Watanabe@vetmeduni.ac.at>",
  "MD5sum": "af169ddc1ee3589e7ef4ba585f2be48f",
  "_user": "watanabe-j",
  "_type": "src",
  "_file": "qfratio_1.1.1.9000.tar.gz",
  "_fileid": "393e0ac3052a9138fbb226009b4ec25f39ec8dca32ba6eb865c30115279df09e",
  "_filesize": 1390510,
  "_sha256": "393e0ac3052a9138fbb226009b4ec25f39ec8dca32ba6eb865c30115279df09e",
  "_created": "2026-05-20T11:16:08.000Z",
  "_published": "2026-06-02T13:04:48.854Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 79076728301,
      "time": 284,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7108588430"
    },
    {
      "job": 79076728082,
      "time": 282,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7108587860"
    },
    {
      "job": 79076729004,
      "time": 268,
      "config": "linux-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7108583242"
    },
    {
      "job": 79076729003,
      "time": 365,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7108615506"
    },
    {
      "job": 79076729079,
      "time": 238,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7108573434"
    },
    {
      "job": 79076728993,
      "time": 562,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7108679311"
    },
    {
      "job": 79076728852,
      "time": 202,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7108562933"
    },
    {
      "job": 79076728516,
      "time": 881,
      "config": "macos-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": ""
    },
    {
      "job": 79076727610,
      "time": 404,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7108493586"
    },
    {
      "job": 79076727431,
      "time": 202,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7358450933"
    },
    {
      "job": 79076728237,
      "time": 367,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7108616092"
    },
    {
      "job": 79076729031,
      "time": 383,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7108621806"
    },
    {
      "job": 79076728779,
      "time": 309,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7108596689"
    }
  ],
  "_buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/watanabe-j/qfratio",
  "_commit": {
    "id": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
    "author": "Junya Watanabe <Junya.Watanabe@uab.cat>",
    "committer": "Junya Watanabe <Junya.Watanabe@uab.cat>",
    "message": "Update contact\n",
    "time": 1779264637
  },
  "_maintainer": {
    "name": "Junya Watanabe",
    "email": "junya.watanabe@vetmeduni.ac.at",
    "login": "watanabe-j",
    "description": "",
    "uuid": 26689590,
    "orcid": "0000-0002-9810-5286"
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "RcppEigen",
      "role": "LinkingTo"
    },
    {
      "package": "Rcpp",
      "role": "Imports"
    },
    {
      "package": "MASS",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "mvtnorm",
      "role": "Suggests"
    },
    {
      "package": "CompQuadForm",
      "role": "Suggests"
    },
    {
      "package": "graphics",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    }
  ],
  "_owner": "watanabe-j",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-49",
      "n": 2
    },
    {
      "week": "2025-50",
      "n": 3
    },
    {
      "week": "2026-03",
      "n": 1
    },
    {
      "week": "2026-21",
      "n": 1
    }
  ],
  "_tags": [],
  "_topics": [
    "quadratic-forms",
    "rcpp",
    "rcppeigen",
    "zonal-polynomials",
    "cpp",
    "openmp"
  ],
  "_stars": 2,
  "_contributors": [
    {
      "user": "watanabe-j",
      "count": 310,
      "uuid": 26689590
    }
  ],
  "_userbio": {
    "uuid": 26689590,
    "type": "user",
    "name": "Junya Watanabe"
  },
  "_downloads": {
    "count": 219,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/qfratio"
  },
  "_devurl": "https://github.com/watanabe-j/qfratio",
  "_searchresults": 6,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/qfratio.html",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/watanabe-j/qfratio",
  "_realowner": "watanabe-j",
  "_cranurl": true,
  "_releases": [
    {
      "version": "1.0.0",
      "date": "2023-03-16"
    },
    {
      "version": "1.0.1",
      "date": "2023-04-02"
    },
    {
      "version": "1.1.0",
      "date": "2023-10-02"
    },
    {
      "version": "1.1.1",
      "date": "2024-02-09"
    }
  ],
  "_exports": [
    "dqfr",
    "pqfr",
    "qfm_Ap_int",
    "qfmrm",
    "qfmrm_ApBDqr_int",
    "qfmrm_ApBDqr_npi",
    "qfmrm_ApBIqr_int",
    "qfmrm_ApBIqr_npi",
    "qfmrm_IpBDqr_gen",
    "qfpm_ABDpqr_int",
    "qfpm_ABpq_int",
    "qfrm",
    "qfrm_ApBq_int",
    "qfrm_ApBq_npi",
    "qfrm_ApIq_int",
    "qfrm_ApIq_npi",
    "qqfr",
    "rqfmr",
    "rqfp",
    "rqfr"
  ],
  "_help": [
    {
      "page": "a1_pk",
      "title": "Recursion for a_{p,k}",
      "topics": [
        "a1_pk"
      ]
    },
    {
      "page": "d1_i",
      "title": "Coefficients in polynomial expansion of generating function-single matrix",
      "topics": [
        "d1_i",
        "dtil1_i",
        "dtil1_i_m",
        "dtil1_i_v"
      ]
    },
    {
      "page": "d2_ij",
      "title": "Coefficients in polynomial expansion of generating function-for ratios with two matrices",
      "topics": [
        "d2_1j",
        "d2_1j_m",
        "d2_1j_v",
        "d2_ij",
        "d2_ij_m",
        "d2_ij_v",
        "d2_pj",
        "d2_pj_m",
        "d2_pj_v",
        "h2_ij",
        "h2_ij_m",
        "h2_ij_v",
        "hhat2_1j",
        "hhat2_1j_m",
        "hhat2_1j_v",
        "hhat2_pj",
        "hhat2_pj_m",
        "hhat2_pj_v",
        "htil2_1j",
        "htil2_1j_m",
        "htil2_1j_v",
        "htil2_pj",
        "htil2_pj_m",
        "htil2_pj_v"
      ]
    },
    {
      "page": "d3_ijk",
      "title": "Coefficients in polynomial expansion of generating function-for ratios with three matrices",
      "topics": [
        "d3_ijk",
        "d3_ijk_m",
        "d3_ijk_v",
        "d3_pjk",
        "d3_pjk_m",
        "d3_pjk_v",
        "h3_ijk",
        "h3_ijk_m",
        "h3_ijk_v",
        "hhat3_pjk",
        "hhat3_pjk_m",
        "hhat3_pjk_v",
        "htil3_pjk",
        "htil3_pjk_m",
        "htil3_pjk_v"
      ]
    },
    {
      "page": "pqfr",
      "title": "Probability distribution of ratio of quadratic forms",
      "topics": [
        "dqfr",
        "dqfr_A1I1",
        "dqfr_broda",
        "dqfr_butler",
        "pqfr",
        "pqfr_A1B1",
        "pqfr_butler",
        "pqfr_davies",
        "pqfr_imhof",
        "qqfr"
      ]
    },
    {
      "page": "dtil2_pq",
      "title": "Coefficients in polynomial expansion of generating function-for products",
      "topics": [
        "dtil2_1q_m",
        "dtil2_1q_v",
        "dtil2_pq",
        "dtil2_pq_m",
        "dtil2_pq_v",
        "dtil3_pqr",
        "dtil3_pqr_m",
        "dtil3_pqr_v"
      ]
    },
    {
      "page": "hgs",
      "title": "Calculate hypergeometric series",
      "topics": [
        "hgs",
        "hgs_1d",
        "hgs_2d",
        "hgs_3d"
      ]
    },
    {
      "page": "gsl_wrap",
      "title": "Internal C++ wrappers for GSL",
      "topics": [
        "gsl_wrap",
        "hyperg_1F1_vec_b",
        "hyperg_2F1_mat_a_vec_c"
      ]
    },
    {
      "page": "is_diagonal",
      "title": "Is this matrix diagonal?",
      "topics": [
        "is_diagonal"
      ]
    },
    {
      "page": "iseq",
      "title": "Are these vectors equal?",
      "topics": [
        "iseq"
      ]
    },
    {
      "page": "KiK",
      "title": "Matrix square root and generalized inverse",
      "topics": [
        "KiK"
      ]
    },
    {
      "page": "new_qfrm",
      "title": "Construct qfrm object",
      "topics": [
        "new_qfpm",
        "new_qfrm"
      ]
    },
    {
      "page": "qfrm_cpp",
      "title": "Internal C++ functions",
      "topics": [
        "ABDpqr_int_E",
        "ABpq_int_E",
        "ApBDqr_int_Ec",
        "ApBDqr_int_Ed",
        "ApBDqr_int_El",
        "ApBDqr_npi_Ec",
        "ApBDqr_npi_Ed",
        "ApBDqr_npi_El",
        "ApBIqr_int_cEd",
        "ApBIqr_int_nEc",
        "ApBIqr_int_nEd",
        "ApBIqr_int_nEl",
        "ApBIqr_npi_Ec",
        "ApBIqr_npi_Ed",
        "ApBIqr_npi_El",
        "ApBq_int_E",
        "ApBq_npi_Ec",
        "ApBq_npi_Ed",
        "ApBq_npi_El",
        "ApIq_int_cE",
        "ApIq_int_nE",
        "ApIq_npi_cE",
        "ApIq_npi_nEc",
        "ApIq_npi_nEd",
        "ApIq_npi_nEl",
        "Ap_int_E",
        "d_A1I1_Ed",
        "d_broda_Ed",
        "d_butler_Ed",
        "IpBDqr_gen_Ec",
        "IpBDqr_gen_Ed",
        "IpBDqr_gen_El",
        "p_A1B1_Ec",
        "p_A1B1_Ed",
        "p_A1B1_El",
        "p_butler_Ed",
        "p_imhof_Ed",
        "qfrm_cpp",
        "rqfpE"
      ]
    },
    {
      "page": "methods.qfrm",
      "title": "Methods for qfrm and qfpm objects",
      "topics": [
        "methods.qfrm",
        "plot.qfrm",
        "print.qfpm",
        "print.qfrm"
      ]
    },
    {
      "page": "qfmrm",
      "title": "Moment of multiple ratio of quadratic forms in normal variables",
      "topics": [
        "qfmrm",
        "qfmrm_ApBDqr_int",
        "qfmrm_ApBDqr_npi",
        "qfmrm_ApBIqr_int",
        "qfmrm_ApBIqr_npi",
        "qfmrm_IpBDqr_gen"
      ]
    },
    {
      "page": "qfpm",
      "title": "Moment of (product of) quadratic forms in normal variables",
      "topics": [
        "qfm_Ap_int",
        "qfpm",
        "qfpm_ABDpqr_int",
        "qfpm_ABpq_int"
      ]
    },
    {
      "page": "qfrm",
      "title": "Moment of ratio of quadratic forms in normal variables",
      "topics": [
        "qfrm",
        "qfrm_ApBq_int",
        "qfrm_ApBq_npi",
        "qfrm_ApIq_int",
        "qfrm_ApIq_npi"
      ]
    },
    {
      "page": "range_qfr",
      "title": "Get range of ratio of quadratic forms",
      "topics": [
        "gen_eig",
        "range_qfr"
      ]
    },
    {
      "page": "rqfr",
      "title": "Monte Carlo sampling of ratio/product of quadratic forms",
      "topics": [
        "rqfmr",
        "rqfp",
        "rqfr"
      ]
    },
    {
      "page": "S_fromUL",
      "title": "Make covariance matrix from eigenstructure",
      "topics": [
        "S_fromUL"
      ]
    },
    {
      "page": "sum_counterdiag",
      "title": "Summing up counter-diagonal elements",
      "topics": [
        "sum_counterdiag",
        "sum_counterdiag3D"
      ]
    },
    {
      "page": "tr",
      "title": "Matrix trace function",
      "topics": [
        "tr"
      ]
    }
  ],
  "_readme": "https://github.com/watanabe-j/qfratio/raw/HEAD/README.md",
  "_rundeps": [
    "MASS",
    "Rcpp",
    "RcppEigen"
  ],
  "_sysdeps": [
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "14.2.0-4ubuntu2~24.04.1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    },
    {
      "shlib": "libgomp",
      "package": "libgomp1",
      "source": "gcc",
      "version": "14.2.0-4ubuntu2~24.04.1",
      "name": "openmp",
      "homepage": "http://gcc.gnu.org/",
      "description": "GCC OpenMP (GOMP) support library"
    }
  ],
  "_vignettes": [
    {
      "source": "qfratio.Rmd",
      "filename": "qfratio.html",
      "title": "qfratio: Moments of Ratios of Quadratic Forms",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Symbols used",
        "Target",
        "First examples",
        "Mathematical details",
        "Moment existence conditions",
        "Expressions for moments",
        "In these expressions, $\\beta_{\\cdot}$ are arbitrary scaling constants thatsatisfy $0 < \\beta < 2 / \\qfrlmax$, with $\\qfrlmax$ beingthe largest eigenvalue of the argument matrix.In addition, $h_{k_1, \\dots k_s}$ and $\\tilde{h}_{k_1; k_2 \\dots k_s}$ arethe coefficients of $t_1^{k_1} \\dots t_s^{k_s}$ in the following power seriesexpansions:\\begin{multline}\\det{ \\mathbf{I}_n - t_1 \\mathbf{A}_1 - \\dots - t_s \\mathbf{A}_s }^{-\\frac{1}{2}}\\\\cdot\\exp \\left( \\frac{(1 - t_1 - \\dots - t_s) \\boldsymbol{\\mu}^T\\left( \\mathbf{I}_n - t_1 \\mathbf{A}_1 - \\dots - t_s \\mathbf{A}_s \\right)^{-1}\\boldsymbol{\\mu}- \\boldsymbol{\\mu}^T \\boldsymbol{\\mu}}{2} \\right)\\",
        "\\sum_{k_1 = 0}^{\\infty} \\dots \\sum_{k_s = 0}^{\\infty} \\qfrhijk[k_1, \\dots, k_s]{ \\mathbf{A}_1 }{\\dots}{ \\mathbf{A}_s } t_1^{k_1} \\dots t_s^{k_s}, \\label{gfun_hij} \\\\end{multline}\\begin{multline}\\det{ \\mathbf{I}_n - t_1 \\mathbf{A}_1 - \\dots - t_s \\mathbf{A}_s }^{-\\frac{1}{2}}\\ \\cdot\\exp \\left( \\frac{(1  - t_2 - \\dots - t_s) \\boldsymbol{\\mu}^T\\left( \\mathbf{I}_n - t_1 \\mathbf{A}_1 - \\dots - t_s \\mathbf{A}_s \\right)^{-1}\\boldsymbol{\\mu}- \\boldsymbol{\\mu}^T \\boldsymbol{\\mu}}{2} \\right)\\",
        "A common special case is when $\\boldsymbol",
        "Special cases",
        "A notable special case for moments of simple ratios is when $p$ is a positiveinteger and $\\mathbf{B} = \\mathbf{I}_n$.In this case, (2) simplifies into [@HillierEtAl2014, theorem 4]\\begin{equation}\\qfrE \\left( \\frac{(\\mathbf{x}^T \\mathbf{A} \\mathbf{x})^p}{(\\mathbf{x}^T \\mathbf{x})^q} \\right)",
        "2^{p - q} p!\\sum_{k=0}^{p}\\frac{ \\qfrGmf{ \\frac{n}{2} + p - q + k } }{ 2^k k! \\qfrGmf{ \\frac{n}{2} + p + k } }{}1 F_1 \\left( q ; \\frac{n}{2} + p + k ; - \\frac{\\boldsymbol{\\mu}^T \\boldsymbol{\\mu}}{2} \\right) a{p, k} \\left( \\mathbf{A}, \\boldsymbol{\\mu} \\right),\\tag{5}\\end{equation}where ${}1 F_1 \\left( \\cdot ; \\cdot ; \\cdot \\right)$ is the confluenthypergeometric function, and $a{p, k}$ are the coefficients of $t^p$ in\\begin{align}&\\det{ \\mathbf{I}_n - t \\mathbf{A} }^{-\\frac{1}{2}}\\left(\\boldsymbol{\\mu}^T \\left( \\mathbf{I}_n - t \\mathbf{A} \\right)^{-1} \\boldsymbol{\\mu}- \\boldsymbol{\\mu}^T \\boldsymbol{\\mu}\\right) ^ k",
        "Numerical evaluation",
        "Truncation error",
        "A great advantage in the above expressions is that an error bound is availablefor a partial (truncated) sum for the simple ratio, provided that $p$ is apositive integer and $\\mathbf{B}$ is positive definite.By denoting the expression (2) as $M \\left( \\mathbf{A}, \\mathbf{B}, p, q \\right)$and the partial sum of the same up to $j = m$ as$\\hat{M}m \\left( \\mathbf{A}, \\mathbf{B}, p, q \\right)$, the error bound is[@HillierEtAl2014, theorem 7]\\begin{multline}\\lvert M \\left( \\mathbf{A}, \\mathbf{B}, p, q \\right) - \\hat{M}m \\left( \\mathbf{A}, \\mathbf{B}, p, q \\right) \\rvert \\\\leq\\frac{ 2^{p - q} \\beta{\\mathbf{B}}^{q} p! \\qfrGmf{ \\frac{n}{2} + p - q } \\qfrrf[m+1]{q} }{ \\qfrGmf{ \\frac{n}{2} + p + m + 1 } }\\left[\\frac{\\exp \\left( \\frac{ \\bar{\\boldsymbol{\\mu}}^T \\bar{\\boldsymbol{\\mu}} - \\boldsymbol{\\mu}^T \\boldsymbol{\\mu} }{2} \\right)\\qfrdtk[p]{ \\bar{A} }{ \\bar{\\boldsymbol{\\mu}} }}{\\det{\\beta{\\mathbf{B}} \\mathbf{B}}^{\\frac{1}{2}}}- \\sum_{j=0}^{m}\\qfrhhij[p;j]{ \\mathbf{A}^+ }{ \\mathbf{I}n - \\beta{\\mathbf{B}} \\mathbf{B} }\\right],\\end{multline}where $\\mathbf{A}^+$ is a symmetric matrix constructed from the eigenvectors and\"positivized\" eigenvalues of $\\mathbf{A}$ (above),$\\bar{\\boldsymbol{\\mu}} = \\sqrt{2}\\left( \\beta_\\mathbf{B} \\mathbf{B} \\right)^{-\\frac{1}{2}} \\boldsymbol{\\mu}$,$\\bar{\\mathbf{A}} = \\beta_{\\mathbf{B}}^{-1} \\mathbf{B}^{-\\frac{1}{2}} \\mathbf{A}^+ \\mathbf{B}^{-\\frac{1}{2}}$,and $\\tilde{d}$ and $\\hat{h}$ are coefficients in the following generating functions:\\begin{equation}\\det{ \\mathbf{I}_n - t \\mathbf{A} }^{-\\frac{1}{2}}\\exp \\left( \\frac{\\boldsymbol{\\mu}^T \\left( \\mathbf{I}_n - t \\mathbf{A} \\right)^{-1} \\boldsymbol{\\mu}- \\boldsymbol{\\mu}^T \\boldsymbol{\\mu}}{2} \\right)",
        "\\sum_{k = 0}^{\\infty} \\qfrdtk[k]{ \\mathbf{A} }{ \\boldsymbol{\\mu} } t^{k},\\end{equation}\\begin{multline}\\det{ \\mathbf{I}_n - t_1 \\mathbf{A}_1 - \\dots - t_s \\mathbf{A}_s }^{-\\frac{1}{2}}\\\\quad \\cdot\\exp \\left( \\frac{(1  + t_2 + \\dots + t_s) \\boldsymbol{\\mu}^T\\left( \\mathbf{I}_n - t_1 \\mathbf{A}_1 - \\dots - t_s \\mathbf{A}_s \\right)^{-1}\\boldsymbol{\\mu}- \\boldsymbol{\\mu}^T \\boldsymbol{\\mu}}{2} \\right) \\",
        "Recursions",
        "Functions",
        "qfrm(): quadratic form ratio moment",
        "Usage",
        "Inside the function",
        "qfmrm(): quadratic form multiple ratio moment",
        "qfm_Ap_int(), qfpm_ABpq_int(), qfpm_ABDpqr_int(): quadratic form (product) moment",
        "rqfr(), rqfmr(), rqfp(): random number generation",
        "d1_i(), d2_*j_*(), d3_*jk_*(), etc.: recursion algorithms",
        "Using the functionality",
        "Recommended workflow",
        "Checking for numerical convergence",
        "Computational cost",
        "References"
      ],
      "created": "2023-02-16 19:47:59",
      "modified": "2025-12-04 16:24:58",
      "commits": 17
    },
    {
      "source": "qfratio_distr.Rmd",
      "filename": "qfratio_distr.html",
      "title": "Probability Distribution Functions in Package qfratio",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Symbols used",
        "Theory",
        "Preliminaries",
        "Series expression",
        "Distribution function",
        "Density function",
        "Numerical inversion",
        "Saddlepoint approximation",
        "Let $M_{X_q}(s)$ be the moment generating function of $X_q$,\\begin{equation}M_{X_q}(s)",
        "A first-order saddlepoint approximation formula for the distribution function$F_Q$ is [@ButlerPaolella2007; @ButlerPaolella2008]:\\begin{equation}\\widehat{\\Pr{}}_1 (Q < q)",
        "A more accurate second-order approximation is [@ButlerPaolella2007]\\begin{equation}\\widehat{\\Pr{}}_2 (Q < q)",
        "A first-order saddlepoint approximation for the density function $f_Q$ is[@ButlerPaolella2007; @ButlerPaolella2008]\\begin{equation}\\hat{f_1}(q)",
        "A second-order approximation is [@ButlerPaolella2007]\\begin{equation}\\hat{f_2}(q)",
        "\\hat{f_1}(q) (1 + O) ,\\end{equation}where\\begin{equation}O",
        "Implementation details",
        "Exported functions",
        "Choosing a method",
        "Use with ks.test()",
        "Series expressions",
        "Specifying integration error",
        "autoscale_args",
        "trim_values",
        "Options",
        "Error bound",
        "pqfr() and dqfr()",
        "qqfr()",
        "Distribution of powers",
        "When $\\mathbf{A}$ is nonnegative definite or $p$ is an odd integer",
        "When $\\mathbf{A}$ is indefinite and $p$ is an even integer",
        "When $\\mathbf{A}$ is indefinite and $p$ is non-integer",
        "Graphical examples",
        "References"
      ],
      "created": "2023-07-12 21:29:04",
      "modified": "2023-10-20 15:38:37",
      "commits": 15
    }
  ],
  "_score": 4.903089986991944,
  "_indexed": true,
  "_nocasepkg": "qfratio",
  "_universes": [
    "watanabe-j"
  ],
  "_binaries": [
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.1.9000",
      "date": "2026-05-12T08:43:29.000Z",
      "arch": "x86_64",
      "commit": "0ecb1faa1a9cda4ef424c337d54e4dec1780fc3a",
      "fileid": "45678723310f25385c403434e321797efe7a2cc235988208127b0222f6b62a06",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/25723102391"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:20:14.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "5fd61aad3bbcb85a0bd29d00cb7c60decd7bfa25b0c073cfa68f663e241e3f88",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:20:15.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "395c43b7367ee4fd36eaf356f62a4cf630a4b55d79909813715faa45ec31a38f",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:20:04.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "4676b710d984558d28e28f29c0798d365e566a8cc369c25e3b2f5f6b20ad793c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:21:26.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "fc86e378cd5bf3d99da5eadda2ff499414383093bd88d6142f5b7bc063bdb01f",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:19:51.000Z",
      "arch": "aarch64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "ae73ecf9932ad71df4a40c7e353405a38e3a397e765c496f3650cc53bee287b6",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:21:36.000Z",
      "arch": "x86_64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "1a24b1bd4e09217d98313057ab8559e84a01d9a2f54ef4143ad4c699747e04ad",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:19:42.000Z",
      "arch": "aarch64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "b9fca3e382948ce053b14f80099afe995c9ec2a669ef2bba3ce090224f91e855",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:19:37.000Z",
      "arch": "x86_64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "51caa0178229367351f368c2ddda9b668fce89313600b827638c2db087683a1c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:19:59.000Z",
      "arch": "x86_64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "e6e786e535e4d714fd86c5178fb0b9bae3dc10c7af963b6bb6f2ec7e72d8e4ce",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.1.1.9000",
      "date": "2026-05-20T11:19:41.000Z",
      "arch": "x86_64",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "f644d3d589f887997701dc53c2f31040fa7d92c23f34b2f7e88e77d67085499e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.1.1.9000",
      "date": "2026-06-02T13:03:15.000Z",
      "arch": "emscripten",
      "commit": "4c906aadb6717c9e8fd1c885ae36c5c47e98513b",
      "fileid": "4ade9c25655833e58032b7cbb4e3cb15b481cb983efd9d59981fb273c03cdcb6",
      "status": "success",
      "buildurl": "https://github.com/r-universe/watanabe-j/actions/runs/26158759774"
    }
  ]
}