{
  "_id": "6a2a75f77b7a29ca60045263",
  "Package": "misc",
  "Title": "Miscellaneous Useful R Functions",
  "Version": "0.10.4",
  "Date": "2026-02-11",
  "Authors@R": "person(\"T.\", \"Moudiki\", , \"thierry.moudiki@gmail.com\", role = c(\"aut\", \"cre\"))",
  "Description": "Miscellaneous Useful R Functions.",
  "License": "MIT",
  "VignetteBuilder": "knitr",
  "Encoding": "UTF-8",
  "RoxygenNote": "7.3.2",
  "Repository": "https://techtonique.r-universe.dev",
  "Date/Publication": "2026-02-11 06:42:08 UTC",
  "RemoteUrl": "https://github.com/thierrymoudiki/misc",
  "RemoteRef": "HEAD",
  "RemoteSha": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-06-11 08:42:19 UTC",
    "User": "root"
  },
  "Author": "T. Moudiki [aut, cre]",
  "Maintainer": "T. Moudiki <thierry.moudiki@gmail.com>",
  "MD5sum": "a8504cbccd79dc011afcd2e162ae0fd4",
  "_user": "techtonique",
  "_type": "src",
  "_file": "misc_0.10.4.tar.gz",
  "_fileid": "5abcb9732ee7dc122cb043f43fd47f07d21a173c5f1d461762924984d89ec3d9",
  "_filesize": 797582,
  "_sha256": "5abcb9732ee7dc122cb043f43fd47f07d21a173c5f1d461762924984d89ec3d9",
  "_created": "2026-06-11T08:42:19.000Z",
  "_published": "2026-06-11T08:46:47.288Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 80756309626,
      "time": 122,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "7559168659"
    },
    {
      "job": 80756309691,
      "time": 125,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "WARNING",
      "artifact": "7559170107"
    },
    {
      "job": 80756309634,
      "time": 230,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "7559209639"
    },
    {
      "job": 80756309669,
      "time": 109,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "WARNING",
      "artifact": "7559165343"
    },
    {
      "job": 80755725530,
      "time": 192,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7559118989"
    },
    {
      "job": 80756309633,
      "time": 109,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7559163568"
    },
    {
      "job": 80756309662,
      "time": 89,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "7559155462"
    },
    {
      "job": 80756309673,
      "time": 80,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "7559152296"
    },
    {
      "job": 80756309676,
      "time": 96,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "WARNING",
      "artifact": "7559158561"
    }
  ],
  "_buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/thierrymoudiki/misc",
  "_commit": {
    "id": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
    "author": "Thierry Moudiki <thierry.moudiki@gmail.com>",
    "committer": "Thierry Moudiki <thierry.moudiki@gmail.com>",
    "message": "add glmnet to suggests\n",
    "time": 1770792128
  },
  "_maintainer": {
    "name": "T. Moudiki",
    "email": "thierry.moudiki@gmail.com",
    "login": "thierrymoudiki",
    "linkedin": "in/thierry-moudiki",
    "twitter": "@sippingrizzly",
    "description": "Like everything related to tech, statistical/machine learning, computer simulation, numerical optimization. Other things too, not mentioned in this bio!",
    "uuid": 8895513
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "MASS",
      "role": "Depends"
    },
    {
      "package": "stats",
      "role": "Depends"
    },
    {
      "package": "utils",
      "role": "Depends"
    },
    {
      "package": "foreach",
      "role": "Depends"
    },
    {
      "package": "doSNOW",
      "role": "Depends"
    },
    {
      "package": "snow",
      "role": "Depends"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "ranger",
      "role": "Suggests"
    },
    {
      "package": "xgboost",
      "role": "Suggests"
    },
    {
      "package": "lightgbm",
      "role": "Suggests"
    },
    {
      "package": "scam",
      "role": "Suggests"
    },
    {
      "package": "survival",
      "role": "Suggests"
    },
    {
      "package": "quantreg",
      "role": "Suggests"
    },
    {
      "package": "tseries",
      "role": "Suggests"
    },
    {
      "package": "glmnet",
      "role": "Suggests"
    }
  ],
  "_owner": "thierrymoudiki",
  "_selfowned": false,
  "_usedby": 1,
  "_updates": [
    {
      "week": "2025-26",
      "n": 3
    },
    {
      "week": "2025-30",
      "n": 4
    },
    {
      "week": "2025-31",
      "n": 2
    },
    {
      "week": "2025-32",
      "n": 3
    },
    {
      "week": "2025-33",
      "n": 2
    },
    {
      "week": "2025-40",
      "n": 2
    },
    {
      "week": "2025-49",
      "n": 2
    },
    {
      "week": "2026-07",
      "n": 3
    }
  ],
  "_tags": [],
  "_stars": 0,
  "_contributors": [
    {
      "user": "thierrymoudiki",
      "count": 52,
      "uuid": 8895513
    }
  ],
  "_userbio": {
    "uuid": 69663678,
    "type": "organization",
    "name": "Techtonique",
    "description": "tech, stats, machine learning, computer simulation, numerical optimization"
  },
  "_downloads": {
    "count": 516,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/misc"
  },
  "_devurl": "https://github.com/thierrymoudiki/misc",
  "_searchresults": 69,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/misc.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/kguidonimartins/misc",
  "_realowner": "kguidonimartins",
  "_cranurl": false,
  "_releases": [
    {
      "version": "0.0.5",
      "date": "2026-04-04"
    }
  ],
  "_exports": [
    "conformalize",
    "coverage_score",
    "debug_print",
    "direct_sampling",
    "fit_param_dist",
    "fit_predict_shap",
    "get_next_date",
    "gradient_shap",
    "integrate",
    "integrated_gradients",
    "is_package_available",
    "is_wholenumber",
    "KL_divergence_hist",
    "local_linear_shap",
    "monotonic_regression",
    "mspl",
    "one_hot_encode",
    "parfor",
    "plot_prediction_interval",
    "predict.conformalize",
    "print_shap_summary",
    "residuals.conformalize",
    "rm_zero_cols",
    "scale_matrix",
    "sims_to_forecast_object",
    "simulate.conformalize",
    "sort_df",
    "split_data",
    "splitts",
    "time_series_accuracy",
    "timeit",
    "vlookup",
    "winkler_score",
    "winkler_score2"
  ],
  "_help": [
    {
      "page": "compute_finite_difference_gradients",
      "title": "Compute finite difference gradients",
      "topics": [
        "compute_finite_difference_gradients"
      ]
    },
    {
      "page": "compute_linear_shap",
      "title": "Compute SHAP values for linear models",
      "topics": [
        "compute_linear_shap"
      ]
    },
    {
      "page": "conformalize",
      "title": "Conformal Prediction for Regression Models",
      "topics": [
        "conformalize"
      ]
    },
    {
      "page": "correlation_aware_shap",
      "title": "Correlation-aware SHAP computation using sampling approach",
      "topics": [
        "correlation_aware_shap"
      ]
    },
    {
      "page": "coverage_score",
      "title": "Calculate Coverage Score for Prediction Intervals",
      "topics": [
        "coverage_score"
      ]
    },
    {
      "page": "debug_print",
      "title": "Debug print",
      "topics": [
        "debug_print"
      ]
    },
    {
      "page": "direct_sampling",
      "title": "Direct sampling",
      "topics": [
        "direct_sampling"
      ]
    },
    {
      "page": "extract_coefficients",
      "title": "Extract coefficients and intercept from various model types",
      "topics": [
        "extract_coefficients"
      ]
    },
    {
      "page": "fit_linear_model",
      "title": "Fit linear model based on specified type",
      "topics": [
        "fit_linear_model"
      ]
    },
    {
      "page": "fit_param_dist",
      "title": "Fit multiple parametric distributions, compute KL divergence, simulate best fit",
      "topics": [
        "fit_param_dist"
      ]
    },
    {
      "page": "fit_predict_shap",
      "title": "Fit a linear model and compute SHAP values with response centering",
      "topics": [
        "fit_predict_shap"
      ]
    },
    {
      "page": "get_model_predictions",
      "title": "Get predictions from various model types",
      "topics": [
        "get_model_predictions"
      ]
    },
    {
      "page": "get_model_type",
      "title": "Get model type string",
      "topics": [
        "get_model_type"
      ]
    },
    {
      "page": "get_next_date",
      "title": "Get next date for a time series object",
      "topics": [
        "get_next_date"
      ]
    },
    {
      "page": "gradient_shap",
      "title": "Gradient-Based SHAP for Any Differentiable Function",
      "topics": [
        "gradient_shap"
      ]
    },
    {
      "page": "integrate",
      "title": "Numerical Integration Using Trapezoidal or Simpson's Rule",
      "topics": [
        "integrate"
      ]
    },
    {
      "page": "integrated_gradients",
      "title": "Integrated Gradients for Model Explanations",
      "topics": [
        "integrated_gradients"
      ]
    },
    {
      "page": "is_package_available",
      "title": "Check if a package is available",
      "topics": [
        "is_package_available"
      ]
    },
    {
      "page": "is_wholenumber",
      "title": "Check if a number is a whole number",
      "topics": [
        "is_wholenumber"
      ]
    },
    {
      "page": "KL_divergence_hist",
      "title": "Function to calculate KL divergence for continuous distributions using histograms",
      "topics": [
        "KL_divergence_hist"
      ]
    },
    {
      "page": "local_linear_shap",
      "title": "LIME-style local linear approximation using gradients",
      "topics": [
        "local_linear_shap"
      ]
    },
    {
      "page": "monotonic_regression",
      "title": "Monotonic Regression using XGBoost, LightGBM, or SCAM",
      "topics": [
        "monotonic_regression"
      ]
    },
    {
      "page": "mspl",
      "title": "Mean Scaled Pinball Loss for Quantile Forecasts",
      "topics": [
        "mspl"
      ]
    },
    {
      "page": "one_hot_encode",
      "title": "One-hot encoding",
      "topics": [
        "one_hot_encode"
      ]
    },
    {
      "page": "parfor",
      "title": "Parallel For Loop with Progress Bar",
      "topics": [
        "parfor"
      ]
    },
    {
      "page": "plot_prediction_interval",
      "title": "Plot Prediction Interval With Optional Past Observations",
      "topics": [
        "plot_prediction_interval"
      ]
    },
    {
      "page": "predict.conformalize",
      "title": "Predict method for conformalize objects",
      "topics": [
        "predict.conformalize"
      ]
    },
    {
      "page": "print_shap_summary",
      "title": "Print summary of SHAP results",
      "topics": [
        "print_shap_summary"
      ]
    },
    {
      "page": "residuals.conformalize",
      "title": "Residuals method for conformalize objects",
      "topics": [
        "residuals.conformalize"
      ]
    },
    {
      "page": "rm_zero_cols",
      "title": "Removing columns containing only zeros",
      "topics": [
        "rm_zero_cols"
      ]
    },
    {
      "page": "rmultivariate",
      "title": "Simulate multivariate data",
      "topics": [
        "rmultivariate"
      ]
    },
    {
      "page": "scale_matrix",
      "title": "Scale matrix",
      "topics": [
        "scale_matrix"
      ]
    },
    {
      "page": "sims_to_forecast_object",
      "title": "Convert Simulation Matrix to Forecast Object",
      "topics": [
        "sims_to_forecast_object"
      ]
    },
    {
      "page": "simulate.conformalize",
      "title": "simulate method for conformalize objects",
      "topics": [
        "simulate.conformalize"
      ]
    },
    {
      "page": "sort_df",
      "title": "Sort data frame",
      "topics": [
        "sort_df"
      ]
    },
    {
      "page": "split_data",
      "title": "Split a dataset",
      "topics": [
        "split_data"
      ]
    },
    {
      "page": "splitts",
      "title": "Partition a time series object",
      "topics": [
        "splitts"
      ]
    },
    {
      "page": "time_series_accuracy",
      "title": "Calculate Multiple Accuracy Metrics for Forecasts",
      "topics": [
        "time_series_accuracy"
      ]
    },
    {
      "page": "timeit",
      "title": "Timing an expression",
      "topics": [
        "timeit"
      ]
    },
    {
      "page": "validate_shap_decomposition",
      "title": "Validate SHAP decomposition",
      "topics": [
        "validate_shap_decomposition"
      ]
    },
    {
      "page": "vlookup",
      "title": "VLOOKUP",
      "topics": [
        "vlookup"
      ]
    },
    {
      "page": "winkler_score",
      "title": "Winkler score for probabilistic forecasts",
      "topics": [
        "winkler_score"
      ]
    },
    {
      "page": "winkler_score2",
      "title": "Calculate Winkler Score for Prediction Intervals",
      "topics": [
        "winkler_score2"
      ]
    }
  ],
  "_readme": "https://github.com/thierrymoudiki/misc/raw/HEAD/README.md",
  "_rundeps": [
    "codetools",
    "doSNOW",
    "foreach",
    "iterators",
    "MASS",
    "snow"
  ],
  "_vignettes": [
    {
      "source": "conformalize.Rmd",
      "filename": "conformalize.html",
      "title": "conformalize",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example: Conformal Prediction with Out-of-Sample Coverage",
        "Simulated Data",
        "Fit Conformal Model",
        "Generate Predictions and Prediction Intervals",
        "Calculate Out-of-Sample Coverage Rate",
        "Results",
        "Example: Conformal Prediction with the MASS::Boston Dataset",
        "Load the Data",
        "Split the Data",
        "Fit Conformal Model 1",
        "Generate Predictions and Prediction Intervals 1",
        "Calculate Out-of-Sample Coverage Rate 1",
        "Fit Conformal Model 2",
        "Generate Predictions and Prediction Intervals 2",
        "Calculate Out-of-Sample Coverage Rate 2"
      ],
      "created": "2025-03-21 15:03:39",
      "modified": "2025-08-05 01:47:07",
      "commits": 5
    },
    {
      "source": "conformalize-matrix-interface.Rmd",
      "filename": "conformalize-matrix-interface.html",
      "title": "conformalize matrix interface",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example: Conformal Prediction with Out-of-Sample Coverage",
        "Simulated Data",
        "Fit Conformal Model",
        "Generate Predictions and Prediction Intervals",
        "Calculate Out-of-Sample Coverage Rate",
        "Results",
        "Example: Conformal Prediction with the MASS::Boston Dataset",
        "Load the Data",
        "Split the Data",
        "Calculate Out-of-Sample Coverage Rate 1"
      ],
      "created": "2025-04-28 18:20:58",
      "modified": "2025-06-23 07:13:44",
      "commits": 2
    },
    {
      "source": "fit_param_dist.Rmd",
      "filename": "fit_param_dist.html",
      "title": "Fitting multiple parametric distributions to data and simulate best-fitting distribution",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example usage 1",
        "Example usage 2",
        "Example usage 3",
        "Example usage 4"
      ],
      "created": "2024-10-01 18:27:15",
      "modified": "2024-10-01 18:27:15",
      "commits": 1
    },
    {
      "source": "getting-started.Rmd",
      "filename": "getting-started.html",
      "title": "Getting started",
      "engine": "knitr::rmarkdown",
      "headings": [],
      "created": "2024-09-14 16:33:59",
      "modified": "2024-09-14 16:33:59",
      "commits": 1
    },
    {
      "source": "getting-started-parfor.Rmd",
      "filename": "getting-started-parfor.html",
      "title": "Getting started with misc::parfor",
      "engine": "knitr::rmarkdown",
      "headings": [],
      "created": "2024-09-14 16:33:59",
      "modified": "2025-08-05 01:47:07",
      "commits": 2
    },
    {
      "source": "grad_shap.Rmd",
      "filename": "grad_shap.html",
      "title": "Gradient SHAP",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example usage"
      ],
      "created": "2025-08-06 17:26:59",
      "modified": "2025-08-06 17:26:59",
      "commits": 1
    },
    {
      "source": "linear_shap.Rmd",
      "filename": "linear_shap.html",
      "title": "Linear SHAP",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example usage"
      ],
      "created": "2025-08-05 07:43:12",
      "modified": "2025-08-05 07:43:12",
      "commits": 1
    },
    {
      "source": "monotonic.Rmd",
      "filename": "monotonic.html",
      "title": "Monotonic regression",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example usage 1"
      ],
      "created": "2025-07-31 07:02:49",
      "modified": "2025-08-05 01:47:07",
      "commits": 2
    },
    {
      "source": "plot_pi.Rmd",
      "filename": "plot_pi.html",
      "title": "Plot prediction interval",
      "engine": "knitr::rmarkdown",
      "headings": [],
      "created": "2025-07-21 11:40:34",
      "modified": "2025-07-21 11:40:34",
      "commits": 1
    },
    {
      "source": "timeit.Rmd",
      "filename": "timeit.html",
      "title": "Timing R code",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Example usage 1",
        "Example usage 2"
      ],
      "created": "2024-10-15 07:25:34",
      "modified": "2024-10-15 07:25:34",
      "commits": 1
    }
  ],
  "_score": 5.918030336784881,
  "_indexed": false,
  "_nocasepkg": "misc",
  "_universes": [
    "techtonique"
  ],
  "_indexurl": "https://kguidonimartins.r-universe.dev/misc",
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.10.4",
      "date": "2026-06-11T08:44:18.000Z",
      "distro": "noble",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "b17ebfacaf9456e0035a482abc9cc2577ee53ed4fd6de794eff1f992e3d0b646",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "0.10.4",
      "date": "2026-06-11T08:44:17.000Z",
      "distro": "noble",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "c5e522b780ec3e54134193f571644abdc4e30bc1fa9224a6b8580a861de78266",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.10.4",
      "date": "2026-06-11T08:44:18.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "daba6ae956f8f974ae72b60e418dcdc5e907e7be84891404b1e529a6c43d48ac",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "0.10.4",
      "date": "2026-06-11T08:44:11.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "39db2acda1ed909bb7ce2c37dc97f23cad4cec9abf159f531765a0873dcf24f9",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.10.4",
      "date": "2026-06-11T08:44:23.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "d1e5c580e13769528804b321d8e70a83ae84ff9b1ce658a306d46ea77169cc4b",
      "status": "success",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.10.4",
      "date": "2026-06-11T08:43:36.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "d5dd168cd257d0dc318e945ff36a975a4158aec5acee882dca99d9198f89250c",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.10.4",
      "date": "2026-06-11T08:43:26.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "4657412b8710a142ae9b0f8071626febb20f4810cc974abf1617f606f9fd3401",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "0.10.4",
      "date": "2026-06-11T08:43:42.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "df81e6f72ffd4504daf9196a1c85868a48e43e95cfa19225abf48a3299ad1e8a",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/27334683677"
    }
  ]
}