{
  "_id": "6a10345bacfb0bcc41c98fcd",
  "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-05-12 07:48:15 UTC",
    "User": "root"
  },
  "Author": "T. Moudiki [aut, cre]",
  "Maintainer": "T. Moudiki <thierry.moudiki@gmail.com>",
  "MD5sum": "2915f8c2ba2c53cacc06340ea23b4b0f",
  "_user": "techtonique",
  "_type": "src",
  "_file": "misc_0.10.4.tar.gz",
  "_fileid": "10a7573bc1d5b544ced2141c78e00b33d8ba6b05ca14b571b36d43fce42f59f1",
  "_filesize": 798685,
  "_sha256": "10a7573bc1d5b544ced2141c78e00b33d8ba6b05ca14b571b36d43fce42f59f1",
  "_created": "2026-05-12T07:48:15.000Z",
  "_published": "2026-05-22T10:47:55.074Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 77364584252,
      "time": 137,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "6938552709"
    },
    {
      "job": 77364584249,
      "time": 123,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "WARNING",
      "artifact": "6938548749"
    },
    {
      "job": 77364583815,
      "time": 100,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "6938541845"
    },
    {
      "job": 77364584193,
      "time": 112,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "WARNING",
      "artifact": "6938545796"
    },
    {
      "job": 77364583272,
      "time": 213,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "6938512532"
    },
    {
      "job": 77364583544,
      "time": 97,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7158682707"
    },
    {
      "job": 77364583731,
      "time": 91,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "6938539265"
    },
    {
      "job": 77364584136,
      "time": 81,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "6938536800"
    },
    {
      "job": 77364583824,
      "time": 83,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "WARNING",
      "artifact": "6938537171"
    }
  ],
  "_buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084",
  "_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",
    "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": 612,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/misc"
  },
  "_devurl": "https://github.com/thierrymoudiki/misc",
  "_searchresults": 52,
  "_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.795184589682425,
  "_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-05-12T07:50:29.000Z",
      "distro": "noble",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "36164823c5ce4facd6121c0c62a3c5a101ef955dd77e65672c30fa1e317daabb",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "0.10.4",
      "date": "2026-05-12T07:50:13.000Z",
      "distro": "noble",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "397f3741c62b4b97ed4e8d3937fc7c037cf030ea5812e1769f4cb6488af70352",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.10.4",
      "date": "2026-05-12T07:49:54.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "26cc042a389d3c72af5d9e87f496caeb8f516b410606e6c230eb680e2868dafa",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "0.10.4",
      "date": "2026-05-12T07:50:05.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "91deee728e885b37183a9b9fd8fb132138cceb8992ee907a36c6f8e091ad0974",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.10.4",
      "date": "2026-05-12T07:49:34.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "7194bdead13053a42e5eb02c95e6341b908e233e2e83f33f8de16eb437a6918f",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.10.4",
      "date": "2026-05-12T07:49:26.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "755c1ce4d2e6eb99177f1b04c739c3213f2556866a4bbc430186f91c17d70a7e",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "0.10.4",
      "date": "2026-05-12T07:49:24.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "2f7558c85088ee80c06ecda1e3f3af025cf04f5b115ff1e3b45611ecfd8e76ba",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.10.4",
      "date": "2026-05-22T10:47:37.000Z",
      "commit": "1f8759cfa700e61f75f270b78f5170422b9d8d0b",
      "fileid": "7505a4cef6bf72b3bcd33bb081235381d2c17c50fdbb73e6673fde487006093c",
      "status": "success",
      "buildurl": "https://github.com/r-universe/techtonique/actions/runs/25720770084"
    }
  ]
}