instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stan-dev__cmdstanpy__184 | stan-dev/cmdstanpy | 184 | defect | 822f69d6ee60c7e921b4832d630fa170f8f1d4d1 | 614489df127d7894a0c0887a4f3e71c9dd26a4ac | Feature/165 use pylint - add to travis.ci | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
- ran pylint on all tests in dir `test`, fixed problems accordingly
- added pylint to travis workflow for dirs `cmdstanpy` and `test`
#### Copyright and Licensing
Please list th... | diff --git a/.pylintrc b/.pylintrc
index 4644e28d..51e31897 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -69,6 +69,7 @@ disable=bad-continuation,
no-else-return,
protected-access,
redefined-builtin,
+ redundant-unittest-assert,
too-many-branches,
too-many-locals
@@ -392,7 +393,7 @@ name-g... | 3 | 2 | 1 | [{"id": "G0", "claim": "Now that pylint is being added, the flake8 line in the Travis CI config may be redundant and should perhaps be removed.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The test directory should also be linted in CI, not just the cmds... | null |
stan-dev__cmdstanpy__194 | stan-dev/cmdstanpy | 194 | defect | c042fbba047cd4ff08166231f3ffa4d3e10a1f2d | 783feca6b19ce90c0cf9c1739a9e4b2c38d3f26a | Make Stan model syntax errors readable | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
It was not easy to read the error messages for .stan file with syntax errors. The error messages were all printed out in one line because the new line characters were escaped. I've cha... | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 6af3f639..0dab4655 100644
--- a/cmdstanpy/model.py
+++ b/cmdstanpy/model.py
@@ -257,7 +257,7 @@ def compile(self, opt_lvl: int = 3, force: bool = False) -> None:
do_command(cmd, cmdstan_path(), logger=self._logger)
... | 1 | 1 | 0 | [{"id": "G0", "claim": "The compile-failure log call should use str(e) instead of e, since that fixes how newlines are rendered; mitzimorris asked whether it does the right thing with respect to newlines and then requested str(e) explicitly.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope"... | null |
stan-dev__cmdstanpy__197 | stan-dev/cmdstanpy | 197 | defect | ac5e5441ec370b4b7f6575673ac0f3f2ad93be95 | 0241b12233a9e3662799caa033420fd255f8cb28 | Use single progress bar | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
* Use a single progress bar instead of separate bars for warmup and sampling. This simplifies code since cmdstan output also combines warmup and sampling.
* Change the description o... | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 6329a503..2f7a66ef 100644
--- a/cmdstanpy/model.py
+++ b/cmdstanpy/model.py
@@ -601,21 +601,6 @@ def sample(
try:
import tqdm
- # progress bar updates - 100 per warmup, sampling
- if fixed_param or n... | 1 | 1 | 1 | [{"id": "G0", "claim": "The progress bar's total of 2000 (and the default-iteration guess) may be wrong when the user sets non-default warmup/sampling iteration values.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stan-dev__cmdstanpy__216 | stan-dev/cmdstanpy | 216 | defect | 301f94026d6c1c60a3510641f1cfee11560bd5f9 | 0de86f1dce17f5b4c2416687494743fea5603003 | Bugfix/188 cmdstan env var | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
added test logic to `test_utils.py` tests for location of cmdstan.
- `test_default_path` checks `CMDSTAN` env var is set
- `test_set_path` also checks that `CMDSTAN` env var is set a... | diff --git a/cmdstanpy/utils.py b/cmdstanpy/utils.py
index 5f80dac7..1028eafa 100644
--- a/cmdstanpy/utils.py
+++ b/cmdstanpy/utils.py
@@ -192,6 +192,7 @@ def cmdstan_path() -> str:
'run command line script "install_cmdstan"'
)
cmdstan = os.path.join(cmdstan_dir, latest_cmdstan)
+... | 2 | 2 | 1 | [{"id": "G0", "claim": "The new tests mutate the global CMDSTAN environment variable and should record its value beforehand and reset it in a try/finally block so the original value survives the test run.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "T... | null |
stan-dev__cmdstanpy__258 | stan-dev/cmdstanpy | 258 | defect | da306ec14dcdf4bb36886a47206cf1a5dfeaa19b | 45d9721dba40a03c83153fbfa849544c29b7b954 | Feature/256 num stan threads | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
- Added logic to allow for specifying parallel chains and threads per chain
- Set os.environ['STAN_NUM_THREADS'] to match `sample` method args
Logic: sample method takes arguments... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 31d2f2a3..488e7037 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -9,10 +9,7 @@
from typing import List, Union
from numpy.random import RandomState
-from cmdstanpy.utils import (
- read_metric,
- get_logger,
-)... | 5 | 4 | 3 | [{"id": "G0", "claim": "The 'Requested %u parallel chains, but only %u CPUs' warning passes threads_per_chain where the requested parallel-chains count belongs, so it reports the wrong number; the reviewer suggests passing parallel_chains.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": ... | null |
stan-dev__cmdstanpy__264 | stan-dev/cmdstanpy | 264 | defect | 1bb40108821a2b019fd0d1563eb22bbc1758cf71 | c4b2ba7c5db873ce2fd7a46a16b2234a31c3ba68 | Cleanup/243 model name | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Better documentation and checks on CmdStanModel property `name`.
Addresses confusion that led to issue #243.
#### Copyright and Licensing
Please list the copyright holder for ... | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 1ee30b69..b883a327 100644
--- a/cmdstanpy/model.py
+++ b/cmdstanpy/model.py
@@ -50,6 +50,8 @@ class CmdStanModel:
model given data.
- By default, compiles model on instantiation - override with argument
``compile=False``
+ - By default, pr... | 3 | 2 | 0 | [{"id": "G0", "claim": "The emptiness check should be written as `if not model_name.strip():` instead of `if len(model_name.strip()) == 0:`.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The validation should also reject a model name that conta... | null |
stan-dev__cmdstanpy__301 | stan-dev/cmdstanpy | 301 | defect | fe044ac112b596b146905ea0956cfb7892b163c3 | 21a40ac9f6c3f78d7dc30de955434af74dfb8e81 | Feature/227 cmdstan install | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Cleanup function `install_cmdstan` (`cmdstanpy/utils.py`) and corresponding script `install_cmdstan.py` per issues #227 and #262
- Constants, logic, and documentation for directori... | diff --git a/cmdstanpy/__init__.py b/cmdstanpy/__init__.py
index 2d0c5bcc..c6655b3c 100644
--- a/cmdstanpy/__init__.py
+++ b/cmdstanpy/__init__.py
@@ -21,6 +21,8 @@
_CMDSTAN_WARMUP = 1000
_CMDSTAN_SAMPLING = 1000
_CMDSTAN_THIN = 1
+_DOT_CMDSTANPY = '.cmdstanpy'
+_DOT_CMDSTAN = '.cmdstan'
def _cleanup_tmpdir():
... | 1 | 1 | 0 | [{"id": "G0", "claim": "The install scripts should handle the default install-directory logic properly: the user should not need to create `.cmdstan` themselves, and `$HOME/.cmdstan` should be the default (keeping an existing `$HOME/.cmdstanpy`), consistently in both `install_cmdstan.py` and `install_cxx_toolchain.py`.... | null |
stan-dev__cmdstanpy__306 | stan-dev/cmdstanpy | 306 | defect | 6cbccbba95910d002dd0f19f6e8fd68f86084dd8 | e463319d40ef4f87e9bad8e5e1b23a798cfe4b84 | providing sig_figs option; fixes #300 | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
CmdStan 2.25 introduced output flag "sig_figs",
- allow this argument for all CmdStan methods (providing CmdStan version is >= 2.25
- add option "sig_figs" to summary method
Un... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 48a2a34b..c6621b07 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -9,7 +9,7 @@
from typing import List, Union
from numpy.random import RandomState
-from cmdstanpy.utils import read_metric, get_logger
+from cmdstanpy.... | 5 | 5 | 2 | [{"id": "G0", "claim": "As first designed the sig_figs option is incomplete: sig_figs needs to be specified as a sampler arg in order for the sampler output csv file to capture enough precision (and bin/stansummary currently caps its output at 10 sig figs until changed on the CmdStan side).", "category": "design", "ver... | null |
stan-dev__cmdstanpy__40 | stan-dev/cmdstanpy | 40 | defect | c68d78ad9055fba1fac046693227a774758795af | 76f1a550eb6481743ec9484359c14f2c9c5f0b44 | Feature/30 extract adaptation info | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Added logic to parse adaptation information from stan_csv files:
+ check metric consistency
+ parse stepsize and metric from stan_csv files
+ make available as attributes on `Pos... | diff --git a/cmdstanpy/cmds.py b/cmdstanpy/cmds.py
index 0e6eb6e6..793d0f4d 100644
--- a/cmdstanpy/cmds.py
+++ b/cmdstanpy/cmds.py
@@ -148,11 +148,13 @@ def sample(
cores, cpu_count()))
cores = cpu_count()
runset = RunSet(args=args, chains=chains)
- tp = ThreadPool(cores)
- for i in ran... | 6 | 3 | 1 | [{"id": "G0", "claim": "The comments under the attribute assignments in PosteriorSample.__init__ are for users and should be put in docstrings, with comments placed above the line.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "In parse_sample and... | null |
stan-dev__cmdstanpy__404 | stan-dev/cmdstanpy | 404 | defect | 7121b1bcaa73b8cf390572b50387dd398601f45e | 5fcda58bbc20ffdf17e03d4f1d35bf2b8574058d | Support xarray draws object | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Add an optional dependency on [xarray](https://xarray.pydata.org/en/stable/index.html) and add the ability to call `.draws_xr()` on a CmdStanMCMC object. Modeled after `.draws_pd()`
... | diff --git a/cmdstanpy/stanfit.py b/cmdstanpy/stanfit.py
index a9ab4528..ff70b40a 100644
--- a/cmdstanpy/stanfit.py
+++ b/cmdstanpy/stanfit.py
@@ -14,7 +14,14 @@
import numpy as np
import pandas as pd
-from cmdstanpy import _TMPDIR, _CMDSTAN_WARMUP, _CMDSTAN_SAMPLING, _CMDSTAN_THIN
+try:
+ import xarray as xr
+
... | 3 | 3 | 2 | [{"id": "G0", "claim": "The dimension and coordinate names should use the singular forms 'chain' and 'draw' to follow ArviZ convention, including in the coordinates dict, the dims tuple and the final transpose call.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "... | null |
stan-dev__cmdstanpy__408 | stan-dev/cmdstanpy | 408 | defect | d1ecba9897adb4ba125084b7a5f26431a8e977e4 | 6621d4a636e94d9c2de4b2e4af9438c8356143dc | Feature/405 extend stan variables | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
This PR generalizes the `stan_variables` function to optimize and variational methods, which requires the following:
- expose the `InferenceMedatadata` class
- populate CmdStanMCMC... | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 74367e7e..b85fa8d4 100644
--- a/cmdstanpy/model.py
+++ b/cmdstanpy/model.py
@@ -690,7 +690,7 @@ def sample(
and consistency.
:param refresh: Specify the number of iterations cmdstan will take
- between progress messages. Default v... | 3 | 3 | 0 | [{"id": "G0", "claim": "The new stan_variable/stan_variables methods, like the existing one in the MCMC object, need fairly detailed docstrings describing at least the dimensionality of the return type.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim"... | null |
stan-dev__cmdstanpy__45 | stan-dev/cmdstanpy | 45 | defect | f1ae91622d27784526e6be2044398de999aa77a8 | 78bedf09d545b6c6a71bbaf083dcb6bbf7cd8655 | Feature/packaging | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
- Replaced CmdStan install script `make_cmdstan.sh` with Python script `bin/install_cmdstah.py`- (issue https://github.com/stan-dev/cmdstanpy/issues/41)
- Updated `setup.py` to make... | diff --git a/.travis.yml b/.travis.yml
index 89001cdc..1c42369f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,10 +8,10 @@ python:
install:
- pip install -r requirements.txt
- pip install flake8 pytest
- - ./make_cmdstan.sh
+ - ./bin/install_cmdstan
after install:
script:
- - flake8 --extend-ignore=E1... | 10 | 5 | 1 | [{"id": "G0", "claim": "The reviewer notes argparse works but suggests Click would make it a bit easier to create the manual.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The explicit `import os.path` is redundant because `os` imports `os.path` by defaul... | null |
stan-dev__cmdstanpy__450 | stan-dev/cmdstanpy | 450 | defect | 33482112d2764113ed2df1b089d46bff2d02e69b | 0323178cfbc6d69880edfc932ee13f890dff28ef | Project/release 1.0 281 optimize | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Addresses issue #281 - the call to the `optimize` method now has argument `save_iterations`, default is `False`. When set to `True`, will set CmdStan command line arg `save_iterations... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 6f457728..4501d18e 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -315,6 +315,7 @@ def __init__(
algorithm: Optional[str] = None,
init_alpha: Optional[float] = None,
iter: Optional[int] = None,... | 3 | 2 | 1 | [{"id": "G0", "claim": "CmdStanMLE.stan_variable/stan_variables should feature a flag to include the saved intermediate iteration estimates, analogous to inc_sample for GQ and include_warmup for MCMC.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Review... | null |
stan-dev__cmdstanpy__489 | stan-dev/cmdstanpy | 489 | defect | 725ad89f98f8c9e9b8d41bb1a684589359e40bba | a7e91b8a39d1897742fd688a8ae97e83610f3bc7 | Give more informative error for bad draws (highlight disk space as possible culprit) | Closes #485
#### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Mentions disk space as a possible cause for the rror
#### Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be yo... | diff --git a/cmdstanpy/utils.py b/cmdstanpy/utils.py
index 2699ca80..ffd9f39f 100644
--- a/cmdstanpy/utils.py
+++ b/cmdstanpy/utils.py
@@ -894,9 +894,12 @@ def scan_sampling_iters(
data = line.split(',')
if len(data) != num_cols:
raise ValueError(
- 'line {}: bad draw, expe... | 3 | 3 | 1 | [{"id": "G0", "claim": "The calling function scan_sampler_csv should catch the ValueError raised for a bad draw and add the csv filepath to the error message.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The unit tests are brittle because assertRaisesR... | null |
stan-dev__cmdstanpy__492 | stan-dev/cmdstanpy | 492 | defect | 725ad89f98f8c9e9b8d41bb1a684589359e40bba | 7d7cbd01a3ce3a042871fff093e79519809680ae | Feature/436 num chains | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Added logic to expose CmdStan 2.28 cross-chain parallelism via argument `num_chains`.
When model has been compiled with `STAN_THREADS=true`, `sample` method will use `num_chains` arg to... | diff --git a/cmdstanpy/__init__.py b/cmdstanpy/__init__.py
index fcd8672f..39769c95 100644
--- a/cmdstanpy/__init__.py
+++ b/cmdstanpy/__init__.py
@@ -2,6 +2,7 @@
"""CmdStanPy Module"""
import atexit
+import logging
import shutil
import tempfile
@@ -27,9 +28,9 @@
def _cleanup_tmpdir() -> None:
"""Force ... | 11 | 10 | 4 | [{"id": "G0", "claim": "More unit tests are needed for the pull request's new functionality.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The num_chains argument should belong in SamplerArgs rather than in the general CmdStanArgs.compose_command.", "c... | null |
stan-dev__cmdstanpy__532 | stan-dev/cmdstanpy | 532 | defect | 2b14038979da9b6490d215221575b3592e7dae29 | a317166295f1d273fa430f73196bbbfc103b2276 | Added passing of new stanc O options as well as validation | #### Submission Checklist
- [ ] Run unit tests
- [ ] Declare copyright holder and open-source license: see below
#### Summary
#### Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
J. Michael Bur... | diff --git a/cmdstanpy/compiler_opts.py b/cmdstanpy/compiler_opts.py
index 2b673d74..69705844 100644
--- a/cmdstanpy/compiler_opts.py
+++ b/cmdstanpy/compiler_opts.py
@@ -46,6 +46,11 @@
]
+VALID_OPTIM_OPTS = (0,
+ 1,
+ "experimental")
+
+
class CompilerOptions:
"""
... | 3 | 3 | 2 | [{"id": "G0", "claim": "The new O options should not be passed as a key=val pair ('--O={val}' / stanc_args={'O':1}); the O0/O1/Oexperimental flags should instead be added to the list of allowed stanc option keys, with any value accepted.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introd... | null |
stan-dev__cmdstanpy__537 | stan-dev/cmdstanpy | 537 | defect | 5ed096e99927eef92ad89629d2d6d0c2c6d86446 | 46130ba6c8e33b503108f31f6d0e66284bf66253 | Properly handle complex outputs | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Closes #536
#### Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
... | diff --git a/cmdstanpy/stanfit/mcmc.py b/cmdstanpy/stanfit/mcmc.py
index 571e75c9..0418aad4 100644
--- a/cmdstanpy/stanfit/mcmc.py
+++ b/cmdstanpy/stanfit/mcmc.py
@@ -32,6 +32,7 @@
from cmdstanpy.cmdstan_args import Method, SamplerArgs
from cmdstanpy.utils import (
EXTENSION,
+ BaseType,
check_sampler_cs... | 1 | 1 | 0 | [{"id": "G0", "claim": "The rewritten docstring should read \"Returns dicts\" (without the stray \"a\") instead of \"Returns a dicts\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__cmdstanpy__579 | stan-dev/cmdstanpy | 579 | defect | 39ee4467cc501e6bbb899d555f06ff6c2523c46c | 0cc04eae9c9fd6dfef284e4174bef43cc85597fb | Add an interactive option to `install_cmdstan` | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
This is inspired by https://github.com/stan-dev/cmdstanr/issues/605.
This PR adds a `--interactive` (short `-i`) flag to the `install_cmdstan` script. If this is set, it drops the ... | diff --git a/cmdstanpy/install_cmdstan.py b/cmdstanpy/install_cmdstan.py
index f19c7aba..1c4164be 100644
--- a/cmdstanpy/install_cmdstan.py
+++ b/cmdstanpy/install_cmdstan.py
@@ -26,7 +26,7 @@
from collections import OrderedDict
from pathlib import Path
from time import sleep
-from typing import Any, Callable, Dict,... | 1 | 1 | 1 | [{"id": "G0", "claim": "Expose the interactive CmdStan installation so it can be run from within Python via the install_cmdstan function, not only from the command line.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stan-dev__cmdstanpy__583 | stan-dev/cmdstanpy | 583 | defect | 35b411c4ec93cef99948c5692293dabab1a55e3b | ec15849b142f2cc413475bbda712fd6d0e4d7ee7 | Ensure stanfit objects can be deepcopied and pickled | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
The change in #543 broke the ability to pickle models. Because pickling does not call `__init__` on object, its internal state may not be 100% correct.
This led to an infinite recu... | diff --git a/cmdstanpy/stanfit/mcmc.py b/cmdstanpy/stanfit/mcmc.py
index 230550bb..8e758555 100644
--- a/cmdstanpy/stanfit/mcmc.py
+++ b/cmdstanpy/stanfit/mcmc.py
@@ -43,6 +43,7 @@
get_logger,
scan_generated_quantities_csv,
)
+
from .metadata import InferenceMetadata
from .runset import RunSet
@@ -122,6 ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new pickle tests should delete the original fit object before unpickling, in case the unpickled object would otherwise reference something from it.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__cmdstanpy__598 | stan-dev/cmdstanpy | 598 | defect | 5bc1040206b6a6812a6123d811480ab0323d13ff | cf8176a87168045f4ca586a65b1252d147859ee9 | Keep column order for dataframe | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Replace `set(vars_list)` with `dict.fromkeys(vars_list)`.
#### Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your ... | diff --git a/cmdstanpy/stanfit/gq.py b/cmdstanpy/stanfit/gq.py
index d9af18f4..2d2cef4e 100644
--- a/cmdstanpy/stanfit/gq.py
+++ b/cmdstanpy/stanfit/gq.py
@@ -282,7 +282,7 @@ def draws_pd(
gq_cols = []
mcmc_vars = []
if vars is not None:
- for var in set(vars_list):
+ fo... | 1 | 1 | 1 | [{"id": "G0", "claim": "Please add a test which checks that the order of the columns is correct (the eight schools model has enough params to do this with).", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
stan-dev__cmdstanpy__692 | stan-dev/cmdstanpy | 692 | defect | b5d7484c1dcdc1251c8ca26d67b73b23900914c0 | 977ba76e1d1bd8b273e436c0690ed42633863fb8 | Add `sig_figs` option for `log_prob`. | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Add `sig_figs` option to the `log_prob` method, e.g., for checking manual gradients to higher precision. I have added tests that compare with a literal string of the expected digits be... | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 55fa5a2c..8b0602b4 100644
--- a/cmdstanpy/model.py
+++ b/cmdstanpy/model.py
@@ -1640,6 +1640,7 @@ def log_prob(
data: Union[Mapping[str, Any], str, os.PathLike, None] = None,
*,
jacobian: bool = True,
+ sig_figs: Optional[int] ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The docstring for the new `sig_figs` parameter should drop the sentence \"Introduced in CmdStan-2.25.\", since the `log_prob` command is newer than 2.25 and no such note is needed.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai... | null |
stan-dev__cmdstanpy__73 | stan-dev/cmdstanpy | 73 | defect | c0eb70b2f86aa15e51e8a20b63c13c4ab35ce321 | 9031a52c64de5781fef5e465b7d45189ce4b4423 | Added dict support for optimizing | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
I've just realized I forgot to add support dict for `data` and `inits` parameters which is already supported by sampling method.
#### Copyright and Licensing
Please list the copyrigh... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 6a9eec1d..a280ce5c 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -381,9 +381,12 @@ def validate(self) -> None:
' found {}'.format(self.seed[i])
)
- if self.... | 2 | 2 | 2 | [{"id": "G0", "claim": "The type hint on the data parameter of CmdStanArgs.__init__ should be updated, otherwise self.data can never be a dict.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The validation branch that rejects data that is neither st... | null |
stan-dev__cmdstanpy__79 | stan-dev/cmdstanpy | 79 | defect | 23fdd227025e4975a0a7b41b3fe076b79e565ce7 | c9265f9132568895c78e8b6642ce43c59a6fdf27 | Minor fixes | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Minor fixes like exception type, more logging ad additional args check.
#### Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be ... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 45f41e43..856bf8bd 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -248,6 +248,10 @@ def validate(self, chains=None) -> None:
)
if self.init_alpha is not None:
+ if self.algorithm == "Ne... | 3 | 2 | 0 | [{"id": "G0", "claim": "Use new-style string formatting everywhere in the logging statements, including the newly added debug line at model.py:496.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Logging statements should always pass arguments to t... | null |
stan-dev__cmdstanpy__804 | stan-dev/cmdstanpy | 804 | defect | 54a0416abc4acc86cdf7bdad1c69d1e021bedf62 | 60f0a0d1f6cc7681d01f22c8e01b79628e0e0971 | Deprecate metric argument and property, rename to inv_metric | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Closes #803
This renames the `metric` property of `CmdStanMCMC` to `inv_metric`, with the old property still available but raising a warning.
Secondly, it updates how the initia... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 80441bae..77450d70 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -10,15 +10,7 @@
import numpy as np
from numpy.random import default_rng
-from cmdstanpy import _TMPDIR
-from cmdstanpy.utils import (
- cmdstan_pat... | 1 | 1 | 1 | [{"id": "G0", "claim": "The rewritten metric docstring in CmdStanModel.sample should say it specifies the type of the inverse mass matrix (and generally say \"inverse mass matrix\" when talking about the matrix and its contents) instead of \"mass matrix\".", "category": "documentation", "verdict": "supported", "priorit... | null |
stan-dev__cmdstanpy__820 | stan-dev/cmdstanpy | 820 | defect | 956f237d8fc40ff9d78723281637d329be1add54 | 91be728418e9b7df3e1d8076d01a9741d3fe1439 | Update model to always be compiled, remove deprecated compilation features | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Closes #695. As described there, the exefile always exists after the constructor concludes.
#### Copyright and Licensing
Please list the copyright holder for the work you are sub... | diff --git a/cmdstanpy/cmdstan_args.py b/cmdstanpy/cmdstan_args.py
index 77450d70..c82ee8b5 100644
--- a/cmdstanpy/cmdstan_args.py
+++ b/cmdstanpy/cmdstan_args.py
@@ -632,7 +632,7 @@ class CmdStanArgs:
def __init__(
self,
model_name: str,
- model_exe: OptionalPath,
+ model_exe: Unio... | 2 | 2 | 0 | [{"id": "G0", "claim": "If support for CmdStan versions before 2.36 is being dropped in 2.0 (issue #685), the version check should be simplified to just cmdstan_version_before(2, 36).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Since the only remainin... | null |
stan-dev__cmdstanpy__825 | stan-dev/cmdstanpy | 825 | defect | 9662f3314a711838f2f569ef07002baa3de382df | be965dca1a205204f844a3383df35702d5ade503 | 2.0 more deprecation removals | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
A few more deprecation removals:
- model.format
- vb.stan_variable now always returns an np array, and returns the variational sample by default
- mle.stan_variable now always retur... | diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 8944c699..7d23bcff 100644
--- a/cmdstanpy/model.py
+++ b/cmdstanpy/model.py
@@ -13,7 +13,7 @@
from concurrent.futures import ThreadPoolExecutor
from io import StringIO
from multiprocessing import cpu_count
-from typing import Any, Callable, Iterable, Mapping... | 1 | 1 | 0 | [{"id": "G0", "claim": "Now that stan_variables() always returns dict[str, np.ndarray], CmdStanMLE.create_inits can be simplified to return the values directly (ultimately just `return self.stan_variables()`), dropping the np.array(val) that existed to account for the removed float case.", "category": "maintainability"... | null |
stan-dev__cmdstanpy__90 | stan-dev/cmdstanpy | 90 | defect | 9855138e5d278123f2503fcf2e43ba5d5892699d | 5af7ed3b23539bb7350b225d8aca6faafbd62db2 | Feature/89 rload fn | #### Submission Checklist
- [x] Run unit tests
- [x] Declare copyright holder and open-source license: see below
#### Summary
Add utility function `rload` - see issue #89 for discussion.
Test data for unit tests taken from Stan `src/test/test-models/good`.
#### Copyright and Licensing
Please list the c... | diff --git a/cmdstanpy/_version.py b/cmdstanpy/_version.py
index e1424ed0..f0ede3d3 100644
--- a/cmdstanpy/_version.py
+++ b/cmdstanpy/_version.py
@@ -1 +1 @@
-__version__ = '0.3.1'
+__version__ = '0.4.1'
diff --git a/cmdstanpy/model.py b/cmdstanpy/model.py
index 31cfb137..9e1bd9bf 100644
--- a/cmdstanpy/model.py
+++ b... | 3 | 2 | 0 | [{"id": "G0", "claim": "The line `np.array(vals).reshape(dim[::-1]).T` is unclear and the reviewer asks whether it could instead be written as a reshape with column-major order, e.g. `np.array(vals).reshape(dim, order='F')`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced... | null |
stan-dev__math__1185 | stan-dev/math | 1,185 | defect | 1a641ffbec297abe9778c3bcededa37e02d50d98 | 7f3091c99842d9bd425badbaf7091062a9ad615d | Glm optimizations | ## Summary
This optimizes GLMs, especially for small number of attributes.
This is based on code from pull request [1038](https://github.com/stan-dev/math/pull/1038), which was further optimized and extended so that it does not drop support for std::vector and RowVector input arguments.
## Tests
One new tes... | diff --git a/stan/math/prim/arr.hpp b/stan/math/prim/arr.hpp
index 7ae02d7409d..d6933726285 100644
--- a/stan/math/prim/arr.hpp
+++ b/stan/math/prim/arr.hpp
@@ -21,6 +21,7 @@
#include <stan/math/prim/arr/err/is_nonzero_size.hpp>
#include <stan/math/prim/arr/err/is_ordered.hpp>
#include <stan/math/prim/arr/fun/array_... | 20 | 13 | 0 | [{"id": "G0", "claim": "The new as_array_or_scalar/as_column_vector_or_scalar/as_scalar helpers should live in the meta directory rather than fun.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The doc for the std::vector overload of as_array_or_scalar w... | null |
stan-dev__math__1334 | stan-dev/math | 1,334 | defect | 5377924860ca7ebc5e084131439904cbcf0fce4a | 57005a144b56e7c7a4389387852874c91b3602e3 | Implemented reverse mode for inverse | ## Summary
This PR implements reverse mode differentiation for `stan::math::inverse`.
## Tests
Added tests for 0x0, 1x1 input; input containing NaN, Inf; singular matrix input. Copied and modified test_ad_unary from test_ad_test.cpp
## Side Effects
Are there any side effects that we should be aware of?
... | diff --git a/stan/math/rev/mat.hpp b/stan/math/rev/mat.hpp
index 810cd91027f..c75499bc6b5 100644
--- a/stan/math/rev/mat.hpp
+++ b/stan/math/rev/mat.hpp
@@ -24,6 +24,7 @@
#include <stan/math/rev/mat/fun/gp_periodic_cov.hpp>
#include <stan/math/rev/mat/fun/grad.hpp>
#include <stan/math/rev/mat/fun/initialize_variable... | 3 | 3 | 1 | [{"id": "G0", "claim": "Reorder the includes in stan/math/rev/mat/fun/inverse.hpp so Eigen.hpp comes first, then rev, then prim (mat before arr and scal).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The inverse autodiff tests should be migrat... | null |
stan-dev__math__1389 | stan-dev/math | 1,389 | defect | 7b68d4403c6389cfa25c0c5c3abec43d1ba21428 | 39d43822aecda656e52f90ff54fe4971c18025a6 | Glm broadcasting | ## Summary
This pr implements broadcasting of x and y for the GLMs that do not support it yet. More details in the issue.
To avoid compile errors with code that is optimized away the meta function `as_scalar()` was replaced with more general `assume_type()`.
## Tests
Each GLM has two new tests - one for br... | diff --git a/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp b/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp
index bb0574f3240..80a8063e7ce 100644
--- a/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp
+++ b/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp
@@ -156,8 +156,9 @@ return_type_t<T_alp... | 7 | 3 | 0 | [{"id": "G0", "claim": "The GLM code should disable compilation of the dead branches (e.g. via SFINAE) instead of using assume_type's explicit forwarding that can throw at runtime; if that is not possible, the no-op/runtime-exception combination needs to be documented.", "category": "design", "verdict": "opposed", "pri... | null |
stan-dev__math__1600 | stan-dev/math | 1,600 | defect | b66b7f07a877581d28bfb210f2616930ec82ef7b | f5cdc33af664f3023b3f123981d6765a5ff1c41b | Remove unnecessary calculations in exp mod normal by storing intermediate results | ## Summary
This is a cleanup of the `exp_mod_normal_{cdf,lcdf,lccdf,lpdf}` functions. The main changes concern the use of local variables for intermediate calculations that can be reused throughout the functions. In doing that, it became clear that some expressions could be further simplified.
For the `*cdf` func... | diff --git a/stan/math/prim/prob/exp_mod_normal_cdf.hpp b/stan/math/prim/prob/exp_mod_normal_cdf.hpp
index ac76a691602..2c7e9b18f11 100644
--- a/stan/math/prim/prob/exp_mod_normal_cdf.hpp
+++ b/stan/math/prim/prob/exp_mod_normal_cdf.hpp
@@ -48,37 +48,37 @@ return_type_t<T_y, T_loc, T_scale, T_inv_scale> exp_mod_normal_... | 4 | 3 | 0 | [{"id": "G0", "claim": "Use the specialized stan::math::inv, which has analytic gradients, instead of dividing by the value.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The inf-check loop could be rewritten in C++11 algorithm/iterator style, e.g.... | null |
stan-dev__math__1612 | stan-dev/math | 1,612 | defect | 47b0595203bd9df718940baedac19c48d4179af4 | b74c0bc10a13447cd54015bb24492a8d466506d0 | Fix lbeta for large arguments | ## Summary
Reimplementing `lbeta` to be stable when one argument is large and other small.
It is a neat trick I found in the R codebase - you first compute an approximation to `lbeta` via Stirling approximation to `lgamma` which allows you to analytically manipulate the expression and avoid catastrophic cancellatio... | diff --git a/stan/math/prim/fun/lbeta.hpp b/stan/math/prim/fun/lbeta.hpp
index 23a9ba9e5fb..fd88cbcd3a6 100644
--- a/stan/math/prim/fun/lbeta.hpp
+++ b/stan/math/prim/fun/lbeta.hpp
@@ -3,6 +3,13 @@
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/fun/lgamma.hpp>
+#include <stan/math/prim/fun/lgamma_stirl... | 16 | 14 | 0 | [{"id": "G0", "claim": "The new headers should include stan/math/prim/meta.hpp (and err.hpp where needed) first and list the remaining headers alphabetically instead of including check_nonnegative.hpp and meta/return_type.hpp individually.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scop... | null |
stan-dev__math__1626 | stan-dev/math | 1,626 | defect | 10cc6ba675743f09832c6749fbb1a92d74888bd2 | 67377020e11180cf3f04850e1cc59774d45334c6 | Lift some check_foo functions out of loops. | ## Summary
I found a few instances of:
```
for (i=...)
check_foo(...x[i]...);
```
That can be replaced by:
```
check_foo(x)
```
This slightly improves the resulting error messages.
Closes #1625.
## Tests
test/unit/math/prim/err/check_cholesky_factor_test.cpp
test/unit/math/prim/err/check_c... | diff --git a/stan/math/prim/err/check_cholesky_factor.hpp b/stan/math/prim/err/check_cholesky_factor.hpp
index 5c26138a43a..9b74a747654 100644
--- a/stan/math/prim/err/check_cholesky_factor.hpp
+++ b/stan/math/prim/err/check_cholesky_factor.hpp
@@ -32,10 +32,7 @@ inline void check_cholesky_factor(
... | 1 | 1 | 0 | [{"id": "G0", "claim": "Similar check_foo calls left inside loops in prim/prob/ordered_logistic_lpmf.hpp, prim/prob/ordered_probit_lpmf.hpp, rev/fun/gp_exp_quad_cov.hpp and rev/fun/gp_periodic_cov.hpp should also be lifted out of the loops.", "category": "performance", "verdict": "supported", "priority": "P2", "scope":... | null |
stan-dev__math__1644 | stan-dev/math | 1,644 | defect | c0d2265f842a1b2df04855fac49d87e9962aa878 | 5f7b2a90066b6b7deba4fb5cfbc1b6ee98bc29d8 | fix returned expressions | ## Summary
PR #1471 generalized some functions to return Eigen expressions. In #1643 it was found that the change prevents compilation of some models. This PR fixes the problem by making those functions return `Eigen::Matrix` again.
## Tests
No tests, as this kind of problem is hard to test in general. But now... | diff --git a/stan/math/prim/fun/acos.hpp b/stan/math/prim/fun/acos.hpp
index 709864e1db6..e5960f1b758 100644
--- a/stan/math/prim/fun/acos.hpp
+++ b/stan/math/prim/fun/acos.hpp
@@ -45,7 +45,7 @@ inline auto acos(const T& x) {
template <typename Derived,
typename = require_eigen_vt<std::is_arithmetic, Derive... | 4 | 1 | 1 | [{"id": "G0", "claim": "The code that failed to compile should be added as a test in this PR (or the problematic model added to the good models in stan-dev/stan) so that the cases being fixed are covered and regressions are caught.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"... | null |
stan-dev__math__1657 | stan-dev/math | 1,657 | defect | dc096aa6a66f7cd95cb29b50fe47680556187aa1 | 312c4a7e6d8938536dc80b28488e7829222c4002 | Improved behavior of expect_near_rel | ## Summary
Improved the behavior of `expect_near_rel` as proposed in #1656.
Wherever a tolerance of type `double` was used, there is a new struct `relative_tolerance` that gathers relative (`tol`) and minimal tolerance (`tol_min`). The final tolerance is computed as `std::max(tol * fabs(x), tol_min)` where `x` is e... | diff --git a/test/unit/math/ad_tolerances.hpp b/test/unit/math/ad_tolerances.hpp
index 5c7eca72bc1..c34a3dd412c 100644
--- a/test/unit/math/ad_tolerances.hpp
+++ b/test/unit/math/ad_tolerances.hpp
@@ -1,6 +1,8 @@
#ifndef TEST_UNIT_MATH_AD_TOLERANCES_HPP
#define TEST_UNIT_MATH_AD_TOLERANCES_HPP
+#include <test/unit/... | 2 | 2 | 0 | [{"id": "G0", "claim": "Member variables of relative_tolerance should be named with a trailing underscore (tol_ and tol_min_) while the constructor arguments keep the bare names, per the project convention.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "... | null |
stan-dev__math__1663 | stan-dev/math | 1,663 | defect | dd9774dbc03935433b25a00be21763b43a242191 | dbaac119e3943acb4ff802cd20b105da6614ed5e | correctness fixes in neg_binomial_* functions | ## Summary
The various `neg_binomial` and `neg_binomial_2` functions suffer from several cases in which the loops that construct VectorBuilders are executed the wrong number of times (see examples pointed out in #1662 and #1531). Besides that, these functions can be cleaned up a bit so that intermediate computations a... | diff --git a/stan/math/prim/prob/neg_binomial_2_cdf.hpp b/stan/math/prim/prob/neg_binomial_2_cdf.hpp
index a080ebe55cb..dad7a41555c 100644
--- a/stan/math/prim/prob/neg_binomial_2_cdf.hpp
+++ b/stan/math/prim/prob/neg_binomial_2_cdf.hpp
@@ -3,11 +3,13 @@
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/e... | 3 | 2 | 1 | [{"id": "G0", "claim": "T_n is always a constant type (an integer or array of integers), so it need not appear as a type parameter of these VectorBuilder declarations here or elsewhere.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The `.0` suffixes are u... | null |
stan-dev__math__1718 | stan-dev/math | 1,718 | defect | f11c9e09a20a8f5347b81b22215df66114b69a64 | 56a0964f2d97d16013f7ffaf1166f76eb4b9c2d3 | Remove size zero checks from check_multiplicable | ## Summary
This removes the `check_positive` calls from `check_multiplicable`, so that we can multiply matrices/vectors even if they have size 0. This means that for several functions, we need to return early for size 0 inputs with the correct result, as otherwise Eigen might raise some assertions. This restores the `... | diff --git a/stan/math/fwd/fun/mdivide_left.hpp b/stan/math/fwd/fun/mdivide_left.hpp
index 680b87cf426..b42910e39e2 100644
--- a/stan/math/fwd/fun/mdivide_left.hpp
+++ b/stan/math/fwd/fun/mdivide_left.hpp
@@ -19,6 +19,9 @@ inline Eigen::Matrix<fvar<T>, R1, C2> mdivide_left(
const Eigen::Matrix<fvar<T>, R2, C2> &b)... | 5 | 4 | 1 | [{"id": "G0", "claim": "The size-zero early returns should use brace-initialization (`return {0, b.cols()};`) instead of a redundant spelled-out Eigen constructor, in nearly every return defined by this PR.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "... | null |
stan-dev__math__1751 | stan-dev/math | 1,751 | defect | f0341173706be97c95f5b76af06f27a0fa597791 | cc1b44f164ee0c91f4ffb8768197c4e292a3caa9 | Allow kernel generator to calculate multiple outputs in single kernel | ## Summary
Adds functionality to kernel generator to allow calculation of multiple expressions in a single kernel. These expressions need to have results of the same size.
An option to skip calculation of some results also exists. This will be useful for implementing highly templated functions, such as GLMs.
... | diff --git a/stan/math/opencl/kernel_generator.hpp b/stan/math/opencl/kernel_generator.hpp
index 66991756a47..6318bf50c95 100644
--- a/stan/math/opencl/kernel_generator.hpp
+++ b/stan/math/opencl/kernel_generator.hpp
@@ -18,6 +18,7 @@
#include <stan/math/opencl/kernel_generator/rowwise_reduction.hpp>
#include <stan/m... | 7 | 5 | 1 | [{"id": "G0", "claim": "The calc_if_ class doxygen documents template parameters T_a, T_b (and Derived) that do not exist on the template.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The get_whole_kernel_parts doc says the function throws, and ... | null |
stan-dev__math__1816 | stan-dev/math | 1,816 | defect | 53791650538ff5bd68c6e3357a686e00b8cc7575 | 86a78ec2e47895dd0fe2870ab1ea16acf97771bf | Replace matrix-vector multiplication kernel with kernel generator | ## Summary
Replaces OpenCL kernel for matrix-vector multiplication with kernel generator.
## Tests
No new tests. New code is tested as a part of OpenCL matrix multiply tests.
## Side Effects
Since `multiply.hpp` now includes `kernel_generator.hpp`, `binary_operation.hpp` can not include `multiply.hpp` anymo... | diff --git a/stan/math/opencl/kernel_generator.hpp b/stan/math/opencl/kernel_generator.hpp
index 49a5a39287c..be65bc2da99 100644
--- a/stan/math/opencl/kernel_generator.hpp
+++ b/stan/math/opencl/kernel_generator.hpp
@@ -132,5 +132,7 @@
#include <stan/math/opencl/kernel_generator/matrix_cl_conversion.hpp>
+#includ... | 8 | 6 | 1 | [{"id": "G0", "claim": "Add a performance benchmark so the performance difference of the new kernel can be seen.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new kernel-generator matrix-vector multiply is up to about 20% slower than the old kernel... | null |
stan-dev__math__1828 | stan-dev/math | 1,828 | defect | 11742e2041922a99d35755b0c99322412f25baf6 | 28046f6bec92be5ab24b5712ec4ca999297e90c9 | Generalize */fun starting with e-l | ## Summary
Generalizes functions with names starting with letters e-l to accept general Eigen expressions.
## Tests
This is just a refactor. No new tests. Templating of `get_base1` was changed. As a side effect explicit template parameters are not necessary anymore. Tests has been appropriately modified.
## S... | diff --git a/stan/math/prim/fun/eigenvalues_sym.hpp b/stan/math/prim/fun/eigenvalues_sym.hpp
index ec7437b90f8..353e24a3222 100644
--- a/stan/math/prim/fun/eigenvalues_sym.hpp
+++ b/stan/math/prim/fun/eigenvalues_sym.hpp
@@ -1,6 +1,7 @@
#ifndef STAN_MATH_PRIM_FUN_EIGENVALUES_SYM_HPP
#define STAN_MATH_PRIM_FUN_EIGENVA... | 24 | 13 | 1 | [{"id": "G0", "claim": "eigenvalues_sym's template should also require that the input's plain type is a matrix, otherwise it accepts Array types that will likely cause compile errors.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "eigenvalues_sym should ... | null |
stan-dev__math__1856 | stan-dev/math | 1,856 | defect | 569fa36fc529b5bcc9f3e3a8236e681d09e99364 | 8f5f71bbbe1f0caa2bb3504f41ca5510b2fc1a2d | Allow nested gradients in reverse mode chain (Issue 1855) | Fixes #1855
## Tests
This adds a new test that will fail with the old code.
## Side Effects
Calling nested gradients in reverse mode works now
## Release notes
Fixed issue where doing nested gradients while there is an ongoing chain would cause segfaults.
## Checklist
- [x] Math issue #1855
-... | diff --git a/stan/math/rev/core/grad.hpp b/stan/math/rev/core/grad.hpp
index 7809088481c..1e3c515d6bc 100644
--- a/stan/math/rev/core/grad.hpp
+++ b/stan/math/rev/core/grad.hpp
@@ -28,20 +28,11 @@ namespace math {
* derivative propagation.
*/
static void grad(vari* vi) {
- // simple reference implementation (inte... | 4 | 2 | 1 | [{"id": "G0", "claim": "Other core functions such as `set_zero_adjoints_*` may also need this change to avoid invalidated iterators, and should be checked.", "category": "correctness", "verdict": "opposed", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "The reviewer asks whether the change has an ef... | null |
stan-dev__math__1878 | stan-dev/math | 1,878 | defect | 17a67ad204467843b5dfb29a4fcfe964b5f15df4 | ac9ee2e07c129cff4b6582d4534a4a490533f436 | Implemented reverse mode for symmetric eigendecomposition | ## Summary
This PR implements reverse mode differentiation for `stan::math::eigenvectors_sym` and `stan::math::eigenvalues_sym`.
## Tests
There are already tests for AD with [`eigenvalues_sym`](https://github.com/stan-dev/math/blob/develop/test/unit/math/mix/fun/eigenvalues_sym_test.cpp) and [`eigenvectors_sym`](h... | diff --git a/stan/math/rev/fun.hpp b/stan/math/rev/fun.hpp
index 7aef9d11ab3..49652dc278a 100644
--- a/stan/math/rev/fun.hpp
+++ b/stan/math/rev/fun.hpp
@@ -38,6 +38,8 @@
#include <stan/math/rev/fun/divide.hpp>
#include <stan/math/rev/fun/dot_product.hpp>
#include <stan/math/rev/fun/dot_self.hpp>
+#include <stan/mat... | 3 | 3 | 1 | [{"id": "G0", "claim": "The double buffers A_, w_ and v_ should be allocated with ChainableStack::instance_->memalloc_.alloc_array<double>() instead of alloc() with a reinterpret_cast.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The eigenvalu... | null |
stan-dev__math__1993 | stan-dev/math | 1,993 | defect | d34f10a67df9affb3e12af4b7f2a7fd4d6f757d3 | afbc1e81a04709f64e422a94a54cd48437030f6f | Silence warnings on building TBB with g++ 9+ | ## Summary
Fixes #1992 by adding `-Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation` when compiling TBB with g++ toolchain or `-Wno-deprecated-copy for clang.
## Tests
/
## Side Effects
/
## Release notes
Added flags to suppress warnings when building TBB.
## Checklist
- [... | diff --git a/make/libraries b/make/libraries
index 9e72a85aa33..ba7bff9fb63 100644
--- a/make/libraries
+++ b/make/libraries
@@ -113,9 +113,11 @@ TBB_CXX_TYPE ?= $(CXX_TYPE)
# Set c compiler used for the TBB
ifeq (clang,$(CXX_TYPE))
TBB_CC ?= $(subst clang++,clang,$(CXX))
+ TBB_CPLUS_FLAGS ?= -Wno-unknown-warning... | 4 | 3 | 1 | [{"id": "G0", "claim": "Nulling the warnings out in Math's build could hide similar future warnings from view; consider whether upstream repos should handle silencing them instead (reviewer is fine either way).", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim":... | null |
stan-dev__math__2022 | stan-dev/math | 2,022 | defect | 6d9e1a487c38efe84ec2a11675900786a2f28e06 | 451625b49adcecd263123a140fa53162da544ab7 | Generalize double exponential | ## Summary
Generalizes double exponential distribution related function to accept Eigen expressions.
## Tests
Tested using expression testing framework
## Side Effects
None.
## Release notes
Generalized double exponential distribution related function to accept Eigen expressions.
## Checklist
- [x] M... | diff --git a/stan/math/opencl/matrix_cl.hpp b/stan/math/opencl/matrix_cl.hpp
index 5b6b7cae2c8..4a0c22c0eea 100644
--- a/stan/math/opencl/matrix_cl.hpp
+++ b/stan/math/opencl/matrix_cl.hpp
@@ -2,15 +2,15 @@
#define STAN_MATH_OPENCL_MATRIX_CL_HPP
#ifdef STAN_OPENCL
+#include <stan/math/opencl/prim/size.hpp>
+#includ... | 6 | 5 | 1 | [{"id": "G0", "claim": "Comparisons of Eigen values with mixed scalar types (e.g. double vs fvar<var>) fail to compile in the rewritten distributions; the author asks for help solving it at the Eigen level rather than wrapping both sides in value_of_rec.", "category": "correctness", "verdict": "supported", "priority": ... | null |
stan-dev__math__2058 | stan-dev/math | 2,058 | defect | 0f3ab571e56c9210d31bbb9e9f62126a3b3fb257 | 96b5f063592372314e9911ac0282dcdd59cae196 | Generalize gaussian dlm obs | ## Summary
Generalizes `gaussian_dlm_obs` functions to accept Eigen expressions.
## Tests
Tested using expression testing framework.
## Side Effects
None.
## Release notes
Generalized `gaussian_dlm_obs` functions to accept Eigen expressions.
## Checklist
- [x] Math issue #1470
- [x] Copyright ... | diff --git a/stan/math/prim/prob/gaussian_dlm_obs_log.hpp b/stan/math/prim/prob/gaussian_dlm_obs_log.hpp
index db7181129d1..3cda104319f 100644
--- a/stan/math/prim/prob/gaussian_dlm_obs_log.hpp
+++ b/stan/math/prim/prob/gaussian_dlm_obs_log.hpp
@@ -8,53 +8,14 @@
namespace stan {
namespace math {
/** \ingroup multiva... | 1 | 1 | 0 | [{"id": "G0", "claim": "In gaussian_dlm_obs_lpdf.hpp the local variables T and r are each used in only one place and need not be declared as local variables, so the unnecessary ones (T) can be eliminated.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__math__2146 | stan-dev/math | 2,146 | defect | a2584979759a5392f9ae110df5b6b79f76b0f1dc | a8a1e248e0473d05c206a7dd42a914a367c84890 | add address sanitizer | ## Summary
Fixes #2142 by adding `-fsanitize=address` to the Full Unit Tests on Jenkins.
This PR will also include fixes for any currently failing tests.
## Tests
/
## Side Effects
/
## Release notes
Added address sanitizer to continuous integration.
## Checklist
- [x] Copyright holder: Ro... | diff --git a/Jenkinsfile b/Jenkinsfile
index 264abf81971..9b0dc652838 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -201,6 +201,8 @@ pipeline {
}
steps {
script {
+ sh "mkdir -p make"
+ sh "echo CXXFLAGS += -fsanitize=address >> make/local"
... | 5 | 1 | 0 | [{"id": "G0", "claim": "matrix_product_vari allocates a std::vector, so the class must also inherit from chainable_alloc for its members to be cleaned up on the chainable stack.", "category": "correctness", "verdict": "uncertain", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The N_VNew/IDACreate all... | null |
stan-dev__math__2160 | stan-dev/math | 2,160 | defect | c0fe04aa2eeac43fd37073c58b7bdd124066d1cb | d032cd61e6915dbf21ef7ee52b5020fb987800bd | Alternative bugfix for arena_matrix_cl | ## Summary
Fixes a crash that happens when calling `recover_memory` after using `arena_matrix_cl` (used internally in all rev OpenCL functions). (This fixes the same bug as #2156, but in different, less dangerous way)
## Tests
Added `recover_memory()` to `arena_matrix` and `to_arena` tests and to `compare_cpu_op... | diff --git a/stan/math/opencl/kernel_generator/as_operation_cl.hpp b/stan/math/opencl/kernel_generator/as_operation_cl.hpp
index e589eae06ac..c6e5e819174 100644
--- a/stan/math/opencl/kernel_generator/as_operation_cl.hpp
+++ b/stan/math/opencl/kernel_generator/as_operation_cl.hpp
@@ -59,7 +59,9 @@ inline scalar_<char> ... | 3 | 1 | 1 | [{"id": "G0", "claim": "SteveBronder asks whether these eval calls need to be made before every custom kernel (in stan/math/opencl/multiply.hpp), questioning the placement of the A.eval()/B.eval() calls.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The e... | null |
stan-dev__math__2162 | stan-dev/math | 2,162 | defect | c0fe04aa2eeac43fd37073c58b7bdd124066d1cb | 9cf713c9c4211b20fc0b8ae27984d5caf29c0274 | Feature faster reduce_sum | ## Summary
The current `reduce_sum` parallel AD implementation suffers from performance bottlenecks whenever many shared arguments are being used. The issue is that the input operands must be copied **per work chunk** as scheduled by the Intel TBB. This creates potentially a large burden on the AD system. This PR li... | diff --git a/stan/math/rev/core.hpp b/stan/math/rev/core.hpp
index 2427a377384..35ad42775bf 100644
--- a/stan/math/rev/core.hpp
+++ b/stan/math/rev/core.hpp
@@ -50,6 +50,7 @@
#include <stan/math/rev/core/print_stack.hpp>
#include <stan/math/rev/core/recover_memory.hpp>
#include <stan/math/rev/core/recover_memory_nes... | 4 | 4 | 2 | [{"id": "G0", "claim": "The std::vector member of ScopedChainableStack should be replaced: bbbales2 does not like the vector stack there and notes that taking away the stack (so execute cannot be called recursively inside its own execute) is not a huge limitation.", "category": "design", "verdict": "supported", "priori... | null |
stan-dev__math__2164 | stan-dev/math | 2,164 | defect | 0dd2068403db9ae2b8799e4b5bccde22b3d6ddc3 | d00537bc3d488fecc4f065bbd240bc9f6ed16334 | `var<mat>` versions of quad_form and trace_quad_form (Issue #2101) | ## Summary
`var<mat>` versions for `quad_form` and `trace_quad_form`
Not the cleanest. Comments inline.
## Release notes
`var<mat>` versions of `quad_form` and `trace_quad_form`
## Checklist
- [x] Math issue #2101
- [x] Copyright holder: Columbia University
The copyright holder is typically ... | diff --git a/stan/math/prim/err/check_square.hpp b/stan/math/prim/err/check_square.hpp
index ecd509ef91b..2aabff38eee 100644
--- a/stan/math/prim/err/check_square.hpp
+++ b/stan/math/prim/err/check_square.hpp
@@ -17,7 +17,7 @@ namespace math {
* @param y Matrix to test
* @throw <code>std::invalid_argument</code> if... | 8 | 3 | 1 | [{"id": "G0", "claim": "The check functions still need to be made to work with `var<mat>` types; for now this PR works around it by passing values into them.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Returning the scalar through the `(0, 0)` access cr... | null |
stan-dev__math__2169 | stan-dev/math | 2,169 | defect | 199d28b69e3dad2a61826810c2745935adb483c9 | d1501830210d23540df00ccd1acdee6879af3309 | Get `sd`, `log_softmax`, and `log_sum_exp` fully `var<mat>` compatible (Issue #2101) | ## Summary
This makes `sd`, `log_sum_exp`, and `log_softmax` fully `var<mat>` compatible (and `apply_vector_unary` in the process).
## Release notes
Updated `sd`, `log_softmax`, and `log_sum_exp` to work fully with `var<mat>`
## Checklist
- [x] Math issue #2101
- [x] Copyright holder: Columbia Univer... | diff --git a/stan/math/prim/fun/sd.hpp b/stan/math/prim/fun/sd.hpp
index 971e30363ed..465a2aa9047 100644
--- a/stan/math/prim/fun/sd.hpp
+++ b/stan/math/prim/fun/sd.hpp
@@ -22,7 +22,7 @@ namespace math {
* @return Sample variance.
*/
template <typename T, require_container_t<T>* = nullptr,
- require_not_v... | 4 | 4 | 2 | [{"id": "G0", "claim": "The `require_var_matrix_t` specialization of `apply_vector_unary` should live in `rev` rather than `prim`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "If the split `sd_impl` pattern works, the same treatment should be copied in... | null |
stan-dev__math__2172 | stan-dev/math | 2,172 | defect | 8464e86fa846d11459c46bc706627583935e7ee3 | b87c3c93256f968a4087754a13b0c16a716d36e4 | Allow var_value<Matrix> to var_value<Block> Assignment | ## Summary
Quick bug fix, for doing
```cpp
var_value<Eigen::MatrixXd> A_v(A);
var_value<Eigen::MatrixXd> B_v(B);
A_v.block(0, 0, 2, 2) = B_v;
```
We need the constructors for `var<mat>` to require that the input is assignable and not convertible. This just changes the requires on the constructors fo... | diff --git a/stan/math/prim/meta/require_generics.hpp b/stan/math/prim/meta/require_generics.hpp
index 96e0c3c8f79..59eb9d1625b 100644
--- a/stan/math/prim/meta/require_generics.hpp
+++ b/stan/math/prim/meta/require_generics.hpp
@@ -11,6 +11,8 @@ STAN_ADD_REQUIRE_BINARY_INNER(same, std::is_same, require_std);
STAN_A... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new test performs the block assignment after setting the adjoints, a non-realistic forward/reverse ordering the library intentionally does not handle correctly, so its asserted result is wrong and the test should be changed to assign the block before the adjoints are set, as Ben suggested.",... | null |
stan-dev__math__2188 | stan-dev/math | 2,188 | defect | 495dc91dbfbca3586cb16a3fcc44e79af48d8050 | ee5399fb144b05f9be561cc848ef755f43d154e3 | Adds extra var matrix block methods | ## Summary
This adds a few things I need in `var<matrix>` and some type traits for checking the inner types of `var<Eigen>` types.
Essentially with these specialized block member functions I can reuse a whole bunch of the code I just wrote for `rvalue()` and `assign()` which is nice!
## Tests
Tests added fo... | diff --git a/stan/math/prim/meta.hpp b/stan/math/prim/meta.hpp
index 5d3f139cd22..4328f9025c6 100644
--- a/stan/math/prim/meta.hpp
+++ b/stan/math/prim/meta.hpp
@@ -189,6 +189,7 @@
#include <stan/math/prim/meta/is_autodiff.hpp>
#include <stan/math/prim/meta/is_arena_matrix.hpp>
#include <stan/math/prim/meta/is_base_... | 4 | 3 | 2 | [{"id": "G0", "claim": "The is_var_dense_dynamic doc comment should also state that the type has dynamic rows and columns.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The is_nan special case in fill should be removed so that filling with a NaN ... | null |
stan-dev__math__2199 | stan-dev/math | 2,199 | defect | 34a8f8b2692d8a5c26af650d922042341b9a567d | 308c87a8d0990b92fb029ff8a6b1fe5cd8363f30 | Added `var<mat>` implementations of `columns_dot_product` and `rows_dot_product` | ## Summary
Added `var<mat>` versions of `columns_dot_product` and `rows_dot_product`
## Release notes
Added `var<mat>` versions of `columns_dot_product` and `rows_dot_product`
## Checklist
- [x] Math issue #2101
- [x] Copyright holder: Columbia University
The copyright holder is typically you o... | diff --git a/stan/math/rev/fun/columns_dot_product.hpp b/stan/math/rev/fun/columns_dot_product.hpp
index 0ae34420cd6..863095df824 100644
--- a/stan/math/rev/fun/columns_dot_product.hpp
+++ b/stan/math/rev/fun/columns_dot_product.hpp
@@ -14,6 +14,20 @@
namespace stan {
namespace math {
+/**
+ * Returns the dot produ... | 2 | 1 | 0 | [{"id": "G0", "claim": "Since both operands are var types inside the `!is_constant<Mat1> && !is_constant<Mat2>` branch, the adjoint update should call `.val()` directly on the arena expressions instead of wrapping them in `value_of`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "i... | null |
stan-dev__math__2209 | stan-dev/math | 2,209 | defect | d47c331a693a3d5ebc4453360743b9353a8e3ed1 | a703f6792fc6e0f2bdda752cf4a505a6592b20ad | added symmetrize function | ## Summary
Wrapped Eigen's selfadjointView function.
## Tests
1. Throw error if not a square matrix.
2. Check if result of symmetrize function is symmetric.
## Side Effects
None
## Release notes
Add `symmetrize(matrix m)` function to `stan::math`.
## Checklist
- [x] Copyright holder: Sean Pin... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index 04cc3990bc7..bf8c3dfc5c9 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -305,6 +305,7 @@
#include <stan/math/prim/fun/sub_row.hpp>
#include <stan/math/prim/fun/subtract.hpp>
#include <stan/math/prim/fun/sum.hpp>
+#include <stan/m... | 1 | 1 | 0 | [{"id": "G0", "claim": "The function should be renamed to a more descriptive name (e.g. symmetrize_low or symmetrize_to_upp, later agreed as symmetrize_from_lower_tri); implementing the upper-triangular versions could then follow in a separate PR.", "category": "maintainability", "verdict": "supported", "priority": "P2... | null |
stan-dev__math__2212 | stan-dev/math | 2,212 | defect | 92fce0218c9fb15fd405ef031f488cad05c5546b | 5d5f771be31bd3f112999ea72c6ce7632e12757d | Added `var<mat>` implementation of squared distance (Issue #2101) | ## Summary
Added `var<mat>` implementation of `squared_distance`
## Release notes
Added `var<mat>` implementation of `squared_distance`
## Checklist
- [x] Math issue #2101
- [x] Copyright holder: Columbia University
The copyright holder is typically you or your assignee, such as a university o... | diff --git a/stan/math/rev/fun/squared_distance.hpp b/stan/math/rev/fun/squared_distance.hpp
index 39655f6c08b..91eddd015cd 100644
--- a/stan/math/rev/fun/squared_distance.hpp
+++ b/stan/math/rev/fun/squared_distance.hpp
@@ -140,6 +140,96 @@ inline var squared_distance(const EigVecArith& v1, const EigVecVar& v2) {
r... | 4 | 3 | 0 | [{"id": "G0", "claim": "Use an early return in each conditional block instead of falling through to a shared return at the end of the function.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The reverse-pass adjoint update would likely be better written ... | null |
stan-dev__math__2219 | stan-dev/math | 2,219 | defect | effd263008e18519c7490303b3db21fb13947738 | 13694f32d341e5f09812b10790e1a1e985ea5660 | avoid copies in matrix_cl & add OpenCL CPU tests | ## Summary
Done by @t4c1 :
When a `matrix_cl` is created from data on host, it copies the data to OpenCL device. This is not necessary if the OpenCL device in use uses same memory as host (when the device is CPU or integrated GPU).
This PR changes `matrix_cl` to instead use the same data if the device uses sam... | diff --git a/Jenkinsfile b/Jenkinsfile
index c5a5b64ae2f..6d9eaf64b4f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -224,25 +224,87 @@ pipeline {
}
post { always { retry(3) { deleteDir() } } }
}
- stage('OpenCL tests') {
- agen... | 3 | 3 | 0 | [{"id": "G0", "claim": "test/unit/math/opencl/kernel_generator/block_test.cpp has a legitimate issue when run on the CPU, and t4c1 should look at it (the fix could land here or in #2182).", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "pre_existing"}, {"id": "G1", "claim": "The `sh \"cl... | null |
stan-dev__math__2230 | stan-dev/math | 2,230 | defect | 089db8e9b3ebc2ae65ef4321ebd0652205f31b82 | 0b479859b32d38fe18ca933b946c96e1845d97a3 | Added `var<mat>` implementation of `mdivide_left` (Issue #2101) | Added `var<mat>` implementation of `mdivide_left` and some stuff to avoid computing qr decomposition twice (Issue #2101)
## Release notes
Added `var<mat>` implementation of `mdivide_left`
Updated `mdivide_left` to avoid doing QR decomposition in forward and reverse passes
## Checklist
- [x] Math issue #2... | diff --git a/stan/math/rev/core.hpp b/stan/math/rev/core.hpp
index 1d62301ac5b..048e7242924 100644
--- a/stan/math/rev/core.hpp
+++ b/stan/math/rev/core.hpp
@@ -7,6 +7,7 @@
#include <stan/math/rev/core/autodiffstackstorage.hpp>
#include <stan/math/rev/core/build_vari_array.hpp>
#include <stan/math/rev/core/chainable... | 5 | 3 | 0 | [{"id": "G0", "claim": "A const version of `get()` should be added; the attempted `inline const T& get() noexcept const` does not compile because overloads must differ by more than return type.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "It is unclear... | null |
stan-dev__math__2250 | stan-dev/math | 2,250 | defect | b49445de22d97f217fd4711a39b8da86157ab868 | c4bdbf178acd8320fc515680f0fa8a19c2a9f631 | Add OpenCL/prim add_diag, diag_matrix, subtract and minor OpenCL fixes | ## Summary
This PR does the following:
- fixes inv_cloglog header guard
- adds OpenCL prim version of add_diag, diag_matrix, subtract
- add is now handled by ADD_BINARY_OPERATION
- adds an OpenCL prim test utility function and replaced/used it in: add, subtract, and new functions
- removes OpenCL/prim cholesky... | diff --git a/stan/math/opencl/err/check_diagonal_zeros.hpp b/stan/math/opencl/err/check_diagonal_zeros.hpp
index dac58c1f655..95076143f7a 100644
--- a/stan/math/opencl/err/check_diagonal_zeros.hpp
+++ b/stan/math/opencl/err/check_diagonal_zeros.hpp
@@ -33,8 +33,7 @@ inline void check_diagonal_zeros(const char* function... | 12 | 11 | 1 | [{"id": "G0", "claim": "The kernel generator's binary operation class names for addition are confusing (addition_ vs addition_operator_ are swapped) and it would be better to add a wrapper function for add that delegates to operator+ instead of constructing another class.", "category": "maintainability", "verdict": "su... | null |
stan-dev__math__2259 | stan-dev/math | 2,259 | defect | 7946558172cf3d3fb60e7b117ad6ac909c2519ec | c8c8e5bf29e2fe4fc2e9cd97b6f73740f9beb8fc | OpenCL: rev support for trigonometric functions | ## Summary
This PR adds /rev OpenCL support for acos, acosh, asin, asinh, atan, atanh, cos, cosh, sin, sinh, tan, tanh
## Tests
/
## Side Effects
/
## Release notes
OpenCL: added /rev support for acos, acosh, asin, asinh, atan, atanh, cos, cosh, tan, tanh
## Checklist
- [x] Math issue #1854
... | diff --git a/stan/math/opencl/rev.hpp b/stan/math/opencl/rev.hpp
index 5c9430e077c..90063d4e0f0 100644
--- a/stan/math/opencl/rev.hpp
+++ b/stan/math/opencl/rev.hpp
@@ -3,16 +3,28 @@
#ifdef STAN_OPENCL
#include <stan/math/opencl/prim.hpp>
+#include <stan/math/opencl/rev/acos.hpp>
+#include <stan/math/opencl/rev/aco... | 2 | 2 | 0 | [{"id": "G0", "claim": "In tanh's reverse pass, cosh(A.val()) should be assigned to an auto instead of a const matrix_cl<double>& so it is not evaluated in a separate kernel — the kernel generator deduplicates it, so cosh is only calculated once.", "category": "performance", "verdict": "supported", "priority": "P2", "s... | null |
stan-dev__math__2261 | stan-dev/math | 2,261 | defect | 343a3b7802e0d00f79eecbea87d10539637a458d | 861ce9342756d5f18677338c52aecc5464bf7abe | Fix the new TBB interface and use tbb::task_arena | ## Summary
This builds on https://github.com/stan-dev/math/pull/2257 and fixes the related tests when the TBB environment variables are set correctly to use an externally updated library, including [oneTBB](https://github.com/oneapi-src/oneTBB). It fixes the `LDFLAGS_TBB` compiler flags and uses `tbb::task_arena` in... | diff --git a/make/compiler_flags b/make/compiler_flags
index 8106f58b324..ac188d4ab6e 100644
--- a/make/compiler_flags
+++ b/make/compiler_flags
@@ -247,7 +247,7 @@ else
CXXFLAGS_TBB ?= -I $(TBB)/include
endif
-LDFLAGS_TBB ?= -Wl,-L,"$(TBB_LIB)" -Wl,-rpath,"$(TBB_LIB) -ltbb"
+LDFLAGS_TBB ?= -Wl,-L,"$(TBB_LIB)" -Wl,... | 2 | 2 | 2 | [{"id": "G0", "claim": "With the new TBB interface the thread pool is not restricted to the user-set limit: with STAN_NUM_THREADS=4 a reduce_sum test used around 33 threads, so whenever STAN_NUM_THREADS is set it needs to be respected.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "int... | null |
stan-dev__math__2266 | stan-dev/math | 2,266 | defect | 3d03131bdcbb2d33878f4117c857ac6404c7e10e | 36cdf30897558048d0a94e569b29b6c4d1762bf5 | Make `varmat` functions work with ldlt (Issue #2101) | ## Summary
Second attempt at making `varmat` work with ldlt
## Side Effects
I removed `LDLT_alloc` and replaced `LDLT_factor` with an API incompatible replacement.
So this is a major version bump for Math right?
## Release notes
- Add `varmat` implementation of `*_ldlt_*` functions
## Checklist
... | diff --git a/stan/math/fwd/fun/mdivide_left_ldlt.hpp b/stan/math/fwd/fun/mdivide_left_ldlt.hpp
index a7db75b2af9..37f00a067ba 100644
--- a/stan/math/fwd/fun/mdivide_left_ldlt.hpp
+++ b/stan/math/fwd/fun/mdivide_left_ldlt.hpp
@@ -22,14 +22,16 @@ namespace math {
* @return x = b A^-1, solution of the linear system.
*... | 13 | 10 | 1 | [{"id": "G0", "claim": "A three-argument `expect_ad_matvar` is still needed so that `trace_gen_inv_quad_form_ldlt` can be tested with `varmat` types.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "In the fwd overload the `const Eigen::Ref<const plain_ty... | null |
stan-dev__math__2270 | stan-dev/math | 2,270 | defect | be482a212615b80319654108c9b1cf291de9a170 | daa4eaee194e6678a403487d86e0b7e52cf3ee64 | Implement OpenCL dot product related functions | ## Summary
Implemented OpenCL dot product related functions (`dot_product`, `dot_self`, `rows_dot_product`, `rows_dot_self`, `columns_dot_product`, `columns_dot_self`).
To simplify those implementations the following things are changed:
- added `adjoint_of()` function that accesses `.adj()` of `var`s, but analogou... | diff --git a/stan/math/opencl/kernel_generator/elt_function_cl.hpp b/stan/math/opencl/kernel_generator/elt_function_cl.hpp
index 268a2b4447f..607ee3f256f 100644
--- a/stan/math/opencl/kernel_generator/elt_function_cl.hpp
+++ b/stan/math/opencl/kernel_generator/elt_function_cl.hpp
@@ -302,6 +302,7 @@ ADD_UNARY_FUNCTION_... | 2 | 1 | 0 | [{"id": "G0", "claim": "The doxygen comment in stan/math/opencl/prim/columns_dot_product.hpp misspells \"columns\" as \"colomns\" and should read \"Returns the dot product of columns of the specified matrices.\"", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1"... | null |
stan-dev__math__2285 | stan-dev/math | 2,285 | defect | 62f5aa809737f3e18800fc082c88f862613fdf3c | 2b141ff7116100f07b0030b17799e27458a72252 | Adds var<mat> specializations for lower/upper bounds | ## Summary
This adds specializations for lower / upper / lower_upper constraints to work with var<matrix>. I had to do a few other things for this to work.
1. To test this I had to write a specialization for `[lb/up/lub]_constrain` that worked for `Matrix<var>` and `var_value<Eigen::Matrix>`. That means that a fe... | diff --git a/stan/math/prim/err.hpp b/stan/math/prim/err.hpp
index 3c74503179c..5bd0f6dc753 100644
--- a/stan/math/prim/err.hpp
+++ b/stan/math/prim/err.hpp
@@ -54,6 +54,7 @@
#include <stan/math/prim/err/is_cholesky_factor_corr.hpp>
#include <stan/math/prim/err/is_column_index.hpp>
#include <stan/math/prim/err/is_co... | 11 | 9 | 3 | [{"id": "G0", "claim": "The vectorized check added as is_infinity only detects positive infinity, so it should be called is_positive_infinity and its docs updated to match.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The infinities handling i... | null |
stan-dev__math__2286 | stan-dev/math | 2,286 | defect | be49360ca7eb65addfa7001c04699fd6f1a85330 | 8d41dd46818c9d7e22a9b07cb833fbd5045be4fe | Add singular_values, svd_U, and svd_V | ## Summary
This implements `singular_values`, `svd_U`, and `svd_V`, with its respective gradients based on Eigen's [JacobiSVD](https://eigen.tuxfamily.org/dox/classEigen_1_1JacobiSVD.html)
## Tests
```
test/unit/math/rev/fun/singularvalues_test.cpp
test/unit/math/prim/fun/svd_U_test.cpp
test/unit/math/prim/fu... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index ef110d5fa34..24c624a0dbc 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -306,6 +306,8 @@
#include <stan/math/prim/fun/sub_row.hpp>
#include <stan/math/prim/fun/subtract.hpp>
#include <stan/math/prim/fun/sum.hpp>
+#include <stan/m... | 13 | 12 | 3 | [{"id": "G0", "claim": "Rev `singular_values` only needs the thin U and V (ComputeThinU | ComputeThinV instead of ComputeFullU | ComputeFullV), and once the factors are thin the `.block()` slicing in the adjoint update is not needed either.", "category": "performance", "verdict": "supported", "priority": "P1", "scope":... | null |
stan-dev__math__2299 | stan-dev/math | 2,299 | defect | 8c7733a6bd13835a2cec19283b511f5ddc3ee174 | 5466cbacaf7f3643a6795b39fa907c482d1bf82d | Added `std::vector` compatible versions of `to_var_value` and `from_var_value` | ## Summary
This is a basic implementation of https://github.com/stan-dev/math/issues/2297
## Release notes
- `to_var_value` and `from_var_value` now work with `std::vector` types
## Checklist
- [x] Math issue #2297
- [x] Copyright holder: Columbia University
The copyright holder is typically yo... | diff --git a/stan/math/rev/fun/from_var_value.hpp b/stan/math/rev/fun/from_var_value.hpp
index f8482d30a5a..183ec50ab9d 100644
--- a/stan/math/rev/fun/from_var_value.hpp
+++ b/stan/math/rev/fun/from_var_value.hpp
@@ -16,7 +16,7 @@ namespace math {
* @tparam T type of the input
* @param a matrix to convert
*/
-tem... | 3 | 2 | 0 | [{"id": "G0", "claim": "The decltype in the vector-overload return type should possibly be decayed, though it may be unnecessary in reasonable cases.", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The doc comment on the Eigen containers overload... | null |
stan-dev__math__2308 | stan-dev/math | 2,308 | defect | 6ac9c2e5ab14bb53a5f4a0e31d3a783015fe1dd7 | 751aab9d28e7118c9b899286e8e9409e33aedb18 | OpenCL: add missing binary function support for (scalar, matrix) and (matrix, scalar) | ## Summary
Adds OpenCL rev support for:
```
beta(real, matrix), beta(matrix, real)
elt_divide(real, matrix), elt_divide(matrix, real)
hypot(real, matrix), hypot(matrix, real)
lbeta(real, matrix), lbeta(matrix, real)
ldexp(int, matrix), lbeta(real, int[])
log_diff_exp(real, matrix), log_diff_exp(matrix, real... | diff --git a/stan/math/opencl/rev/beta.hpp b/stan/math/opencl/rev/beta.hpp
index acd179467b6..02955bf340a 100644
--- a/stan/math/opencl/rev/beta.hpp
+++ b/stan/math/opencl/rev/beta.hpp
@@ -61,6 +61,84 @@ inline auto beta(const T_a& a, const T_b& b) {
return res;
}
+/**
+ * Return the elementwise `beta()` on an in... | 1 | 1 | 1 | [{"id": "G0", "claim": "Scalar arguments of the (matrix, scalar) beta overload (and its mirror overload and the same pattern in the other binary functions) should not be wrapped in arena variables; matrix arguments should use perfect forwarding, e.g. `beta(T_a&& a, const T_b& b)` with `std::forward<T_a>(a)`.", "categor... | null |
stan-dev__math__2312 | stan-dev/math | 2,312 | defect | d2e485cf1597d1a30fbfdf9330540033c432683c | 8890dc5a270f595113e900ec009fd8905366733c | Add linspaced_int_array() | ## Summary
Adds support for `ìnt[] linspaced_int_array(int, int, int)` as a complement to `real[] linspaced_int_array(int, real, real)`. This was proposed by @avehtari in a discussion and I agree it would be useful.
`linspaced_int_array(5,0,8)` returns 0,2,4,6,8
`linspaced_int_array(5,0,9)` returns 0,2,4,6,8
`l... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index d7be8fc9f6c..f5208bc996f 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -160,6 +160,7 @@
#include <stan/math/prim/fun/LDLT_factor.hpp>
#include <stan/math/prim/fun/lgamma.hpp>
#include <stan/math/prim/fun/linspaced_array.hpp>
+#i... | 6 | 5 | 3 | [{"id": "G0", "claim": "The new @throw doc ends in a dangling 'or if ().' fragment, which misleads readers about when the function throws.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The doc should say 'inclusive' instead of '(included)'.", "ca... | null |
stan-dev__math__2318 | stan-dev/math | 2,318 | defect | 7eb49416e78ff6ab1763f9c72799386739790b04 | f252412f2e2b162278fcfaa0b97892248f71b039 | Add cdf_log, ccdf_log, and log functions for poisson binomial | ## Summary
Adds `poisson_binomial_log` `poisson_binomial_cdf_log` and `poisson_binomial_ccdf_log` functions for poisson binomial distribution.
## Tests
Adds tests comparing output of `poisson_binomial_log` to `poisson_binomial_lpmf`, `poisson_binomial_cdf_log` to `poisson_binomial_lcdf` and `poisson_binomial_... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 546cb4408d4..4e2f4d47ee5 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -264,8 +264,11 @@
#include <stan/math/prim/prob/pareto_type_2_log.hpp>
#include <stan/math/prim/prob/pareto_type_2_lpdf.hpp>
#include <stan/math/prim/pro... | 4 | 3 | 1 | [{"id": "G0", "claim": "The lcdf, lccdf (and cdf_log/ccdf_log wrappers) do not compile for signature (int, vector[]) and several other argument combinations, and these expression-test failures must be fixed before merging.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"... | null |
stan-dev__math__2329 | stan-dev/math | 2,329 | defect | 5409cfb861887ce8113a540561d0fd25c17239b5 | d121695a9388a76287ca12144c07def0c4571913 | Add some tools to simplify code generation for stanc3 | ## Summary
Adds some tools to simplify conde generation for stanc3:
- makes `from_var_value` work on prim types, returning the argument
- adds `conditional_var_value` metaprogram that constructs a type from a scalar and a container.
Closes #2325. Closes #2298.
## Tests
New changes are tested. `EXPECT_TYPE_EQ`... | diff --git a/stan/math/rev/fun/from_var_value.hpp b/stan/math/rev/fun/from_var_value.hpp
index e63e7421bdc..6766e911b07 100644
--- a/stan/math/rev/fun/from_var_value.hpp
+++ b/stan/math/rev/fun/from_var_value.hpp
@@ -26,23 +26,17 @@ Eigen::Matrix<var, T::RowsAtCompileTime, T::ColsAtCompileTime> from_var_value(
}
/*... | 2 | 2 | 0 | [{"id": "G0", "claim": "The doxygen comment should read 'vars, scalars or prim types' instead of 'vars or scalars or prim types'.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "There is one silly doxygen comment in the pull request that the author... | null |
stan-dev__math__2354 | stan-dev/math | 2,354 | defect | 122d8b5329c45fc6ebe7efd37d8fc0f46b536afe | 4c91a21ca6645d26aa5848e8ca75684254b55604 | Add symmetrize_from_upper_tri | ## Summary
Added symmetrize_from_upper_tri.cpp function, which creates a symmetric matrix by using elements in the upper triangular part of the input matrix. Implementation is based on the existing symmetrize_from_lower_tri.cpp.
Changed the second test in symmetrize_from_lower_tri_test.cpp. Before, the input was ... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index f5208bc996f..fda4c37925c 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -316,6 +316,7 @@
#include <stan/math/prim/fun/svd_U.hpp>
#include <stan/math/prim/fun/svd_V.hpp>
#include <stan/math/prim/fun/symmetrize_from_lower_tri.hpp>
... | 3 | 3 | 2 | [{"id": "G0", "claim": "The symmetrize_from_lower_tri value test should also check that the function returns the right values, by building a reference matrix and comparing with EXPECT_MATRIX_EQ, instead of only asserting the result is symmetric.", "category": "testing", "verdict": "supported", "priority": "P1", "scope"... | null |
stan-dev__math__2398 | stan-dev/math | 2,398 | defect | 796c0f0966e03dfc92cc7bb68ca670770e3fe528 | a9e3fc653d3f0f3fccff65dedecae332fbb16973 | Add quantile function | ## Summary
Addresses #1036 .
Still WIP - points I'd be happy to get feedback on:
- Currently only implemented for `std::vector` - I'm sure adding an implementation for Eigen vectors/row vectors is straightforward, but still I'm a C++ newcomer and would appreciate an example or a simple explanation on how to do ... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index fda4c37925c..3926cee93df 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -264,6 +264,7 @@
#include <stan/math/prim/fun/quad_form.hpp>
#include <stan/math/prim/fun/quad_form_diag.hpp>
#include <stan/math/prim/fun/quad_form_sym.hpp>... | 13 | 12 | 4 | [{"id": "G0", "claim": "The argument-validation checks should pass \"quantile\" as the function-name argument, otherwise errors look like a function \"sort_asc\" threw them.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Use require templates togeth... | null |
stan-dev__math__2414 | stan-dev/math | 2,414 | defect | e37f9861420feae0a913ac025a192d70a049c023 | 048059eb0f481d7fd6728ff65e4f09f84ee8b441 | Evaluate expressions in poisson functions (Issue #2413) | ## Summary
Hopefully fixes #2413
## Tests
The expression tests catch these. Only works for g++ though? For some reason clang++ passes. Not sure if it's possible to do better.
## Release notes
- Fix bug with expressions in poisson distribution functions
## Checklist
- [x] Math issue #2413
- [x] ... | diff --git a/stan/math/prim/prob/poisson_cdf.hpp b/stan/math/prim/prob/poisson_cdf.hpp
index 313f7968494..2b79b494a0c 100644
--- a/stan/math/prim/prob/poisson_cdf.hpp
+++ b/stan/math/prim/prob/poisson_cdf.hpp
@@ -52,9 +52,7 @@ return_type_t<T_rate> poisson_cdf(const T_n& n, const T_rate& lambda) {
return ops_parti... | 3 | 2 | 2 | [{"id": "G0", "claim": "poisson_lcdf.hpp line 55 should wrap log(gamma_q(n_val + 1.0, lambda_val)) in to_ref_if<!is_constant_all<T_rate>::value> instead of to_ref, which forces evaluation even when it is not needed and is a performance bug that makes this slower.", "category": "performance", "verdict": "supported", "pr... | null |
stan-dev__math__2484 | stan-dev/math | 2,484 | defect | eec0ad1dffa5906e7717db9afac675171260ce49 | 86eabfe4dff5032e255f8e83182e1e304409b011 | append_row/col for var matrix |
## Summary
This adds var matrix overloads for `append_row/col` functions
## Tests
Same tests as for `matrix<var>` but using `expect_ad_matvar()`
```
./runTests.py ./test/unit/math/mix/fun/append_col_test.cpp ./test/unit/math/mix/fun/append_row_test.cpp
```
## Side Effects
Nope!
## Release notes... | diff --git a/stan/math/rev/fun.hpp b/stan/math/rev/fun.hpp
index d198c4ac022..61902f173c2 100644
--- a/stan/math/rev/fun.hpp
+++ b/stan/math/rev/fun.hpp
@@ -14,6 +14,8 @@
#include <stan/math/rev/fun/abs.hpp>
#include <stan/math/rev/fun/acos.hpp>
#include <stan/math/rev/fun/acosh.hpp>
+#include <stan/math/rev/fun/app... | 1 | 1 | 0 | [{"id": "G0", "claim": "The intermediate `arena_B = value_of(B)` (and similar copies elsewhere in the PR) is unnecessary because `B` could be used directly on the next line.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__math__2487 | stan-dev/math | 2,487 | defect | 6cf500edd75899d609663896f319823a3882953f | 8e79bc2c4f9d446c50263d1eb15028c309e7673e | add functions for varmatrix rep_vector and rep_row_vector | ## Summary
Adds overloads for `rep_vector()` and `rep_row_vector()` for `var<Matrix>`
## Tests
```
./runTests.py ./test/unit/math/rev/fun/ -f rep -f vector
```
## Side Effects
Nope!
## Release notes
add functions for `var<Matrix> `rep_vector()` and `rep_row_vector()`
## Checklist
- [x] Math... | diff --git a/stan/math/prim/fun/rep_row_vector.hpp b/stan/math/prim/fun/rep_row_vector.hpp
index b79efdce89c..abc63e4a773 100644
--- a/stan/math/prim/fun/rep_row_vector.hpp
+++ b/stan/math/prim/fun/rep_row_vector.hpp
@@ -1,16 +1,23 @@
#ifndef STAN_MATH_PRIM_FUN_REP_ROW_VECTOR_HPP
#define STAN_MATH_PRIM_FUN_REP_ROW_VE... | 2 | 2 | 1 | [{"id": "G0", "claim": "The rev overloads of rep_vector and rep_row_vector should take a var argument instead of templating on a generic scalar T guarded by a conditional is_var<T> check (\"T should always be var\").", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", ... | null |
stan-dev__math__2488 | stan-dev/math | 2,488 | defect | b9944754f973de6638ce21105a98a6d490e3893f | 70782e6c1653027665970ab9ae153eee26bc8dc9 | Added loglogistic cdf and rng | ## Summary
Implemented `loglogistic_cdf` with manual gradients and `loglogistic_rng` [#2320](https://github.com/stan-dev/math/issues/2320#issuecomment-781315580). The latter is based on sampling from Uniform(0, 1) and transforming the samples with the inverse cdf.
## Tests
Added a cdf to distribution tests and... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 04416a966ec..2fce0b34e1d 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -175,7 +175,9 @@
#include <stan/math/prim/prob/logistic_log.hpp>
#include <stan/math/prim/prob/logistic_lpdf.hpp>
#include <stan/math/prim/prob/logistic_... | 6 | 5 | 0 | [{"id": "G0", "claim": "Initialize the CDF directly as 'T_partials_return cdf = prod(prod_all);' instead of value-initializing to 1.0 and multiplying in a separate statement.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Use square(prod_all) instead of ... | null |
stan-dev__math__2491 | stan-dev/math | 2,491 | defect | 29843fe934fdb25ee1cc76d1f46d70e07a0bbf05 | c8a67fcee47e98664dfeddf03607c0b015e1902a | Have conditional_var_value_t return correct matrix type if scalar is var |
## Summary
This just makes `conditional_var_value_t<var, Eigen::Matrix<var, -1, -1>>` returns back a `var_value<Eigen::Matrix<double, -1, -1>>`
## Tests
Test added for checking above behavior
```
./runTests.py ./test/unit/math/rev/meta/conditional_var_value_test.cpp
```
## Side Effects
Nope
## ... | diff --git a/stan/math/rev/meta/conditional_var_value.hpp b/stan/math/rev/meta/conditional_var_value.hpp
index c105c41bb0a..e377c46bdb1 100644
--- a/stan/math/rev/meta/conditional_var_value.hpp
+++ b/stan/math/rev/meta/conditional_var_value.hpp
@@ -3,6 +3,7 @@
#include <stan/math/rev/core/var.hpp>
#include <stan/ma... | 2 | 2 | 0 | [{"id": "G0", "claim": "The doxygen comment on conditional_var_value should be updated to match the code change.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The trailing 'This must be a prim type.' clause of the T_container doxygen line should ... | null |
stan-dev__math__2502 | stan-dev/math | 2,502 | defect | 134184699c81556c1cced08c7ca043e31072179e | 3fb1507adb22d68aff4bbb7d29b871b5ac9c7ccc | adds testing suite for nested binary var matrix functions | ## Summary
So @andrjohns in #2461 you were totally correct that I wasn't handling nested array structures correctly for var matrix. This fixes that by
1. adding overloads for `apply_scalar_binary()` for handling `var_value<Matrix>` types
2. adding an overload for `as_array_or_scalar()` that makes a 2d array from... | diff --git a/stan/math/prim/fun/as_array_or_scalar.hpp b/stan/math/prim/fun/as_array_or_scalar.hpp
index 8845c2432b2..6e91323d447 100644
--- a/stan/math/prim/fun/as_array_or_scalar.hpp
+++ b/stan/math/prim/fun/as_array_or_scalar.hpp
@@ -52,7 +52,8 @@ inline auto as_array_or_scalar(T&& v) {
* @param v Specified vector... | 9 | 6 | 0 | [{"id": "G0", "claim": "Drop the `#include <vector>` from the new rev apply_scalar_binary.hpp since `binaryExpr` isn't used with the `varmat` types.", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The separate apply_scalar_binary overloads should b... | null |
stan-dev__math__2507 | stan-dev/math | 2,507 | defect | 1d0b4a08b4a800a3e8d2c1a3559fbe9390b7584e | 63618a1a68949618ba5f57a23986fdb468d1c3b9 | Basic slicing and dimension queries operators support var<Matrix> types |
## Summary
As title says, this adds slicing and dimension queries like `rows()` and `cols()` for `var_value<Eigen>` types
## Tests
Tests can be run with
```
./runTests.py ./test/unit/math/rev/fun/dimensions_test.cpp \
./test/unit/math/rev/fun/cols_test.cpp \
./test/unit/math/rev/fun/rows_test.cpp
`... | diff --git a/stan/math/prim/err/check_column_index.hpp b/stan/math/prim/err/check_column_index.hpp
index 4f2cdc2d7fd..41b875c0d39 100644
--- a/stan/math/prim/err/check_column_index.hpp
+++ b/stan/math/prim/err/check_column_index.hpp
@@ -25,7 +25,7 @@ namespace math {
* @throw <code>std::out_of_range</code> if index i... | 3 | 1 | 0 | [{"id": "G0", "claim": "The change of the vari_view constructor from const references to forwarding references is not in line with the other changes in this PR; the reviewer asks what the reason for it is and does not think any view would ever need forwarding.", "category": "correctness", "verdict": "supported", "prior... | null |
stan-dev__math__2510 | stan-dev/math | 2,510 | defect | da36ba4ca4b2fcf0fea9a9214b785895f07a1c95 | de7f96bb818e24179e6495ad769246022be31ab8 | Generalised Hypergeometric Function | ## Summary
This PR implements the generalised hypergeometric function:

Which has signature: `hypergeometric_pFq(vector a, vector b, real z)`
The value itself is calculated by Boosts' `boost::math:... | diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp
index e10e9da72f1..9ff500b64fc 100644
--- a/stan/math/fwd/fun.hpp
+++ b/stan/math/fwd/fun.hpp
@@ -40,6 +40,7 @@
#include <stan/math/fwd/fun/gamma_p.hpp>
#include <stan/math/fwd/fun/gamma_q.hpp>
#include <stan/math/fwd/fun/grad_inc_beta.hpp>
+#include <stan/m... | 13 | 10 | 3 | [{"id": "G0", "claim": "The doxygen on the new fwd hypergeometric_pFq overloads is too terse and the template/parameter descriptions should be made more verbose (e.g. 'Type inheriting from Eigen::DenseBase with either one row or column at compile time and scalar type of fvar').", "category": "documentation", "verdict":... | null |
stan-dev__math__2521 | stan-dev/math | 2,521 | defect | 00405fb90982bdd3f18b8edf746e32207e7de02b | bdeea03a0186c09fa5dfb66460123e57533a26af | adds to_vector() support for var<Matrix> |
## Summary
Adds a `to_vector()` method for `var_value<Eigen::Matrix>`.
## Tests
I just added a test in `rev` that checks the values are the same and updating the adjoints in the tmp made by `to_vector()` changes the adjoint in the original `var_value<Matrix>`
```
./runTests.py -j4 ./test/unit/math/rev/fu... | diff --git a/stan/math/rev/fun.hpp b/stan/math/rev/fun.hpp
index d198c4ac022..499454bc3a9 100644
--- a/stan/math/rev/fun.hpp
+++ b/stan/math/rev/fun.hpp
@@ -170,6 +170,7 @@
#include <stan/math/rev/fun/to_var.hpp>
#include <stan/math/rev/fun/to_arena.hpp>
#include <stan/math/rev/fun/to_var_value.hpp>
+#include <stan/... | 2 | 2 | 0 | [{"id": "G0", "claim": "The doc comment should describe the operation as reshaping rather than casting, since casting is unclear for complex types that cannot actually be cast into one another.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The do... | null |
stan-dev__math__2522 | stan-dev/math | 2,522 | defect | c2edd605b30d68da5d22665de26bb3e1203c8403 | 7936caca48c0c44beb90e163f81501ce1aa31ae6 | Fix OpenCL Jenkins CPU tests and minor issues | ## Summary
A few minor fixes:
- fixes the current issue with OpenCL tests on develop by not running some tests on the GG Linux machine. I would prefer not running them entirely on that machine, but given the lack of test machine with OpenCL CPU support, this is not a realistic option right now. The same tests are... | diff --git a/Jenkinsfile b/Jenkinsfile
index 85a30e9e391..0990afd6071 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -245,6 +245,11 @@ pipeline {
sh "echo STAN_OPENCL=true>> make/local"
sh "echo OPENCL_PLATFORM_ID=${env.OPENCL_PLATFORM_ID_CPU}>> make/loca... | 1 | 1 | 0 | [{"id": "G0", "claim": "Both tests are already wrapped by the new #ifndef STAN_TEST_SKIP_REQUIRING_OPENCL_INT64_BASE_ATOMIC guard, so the includes can also be moved inside it.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
stan-dev__math__2535 | stan-dev/math | 2,535 | defect | c87156b59b772f8988dbf29f242eb73169398786 | 554fc9336d8a6bba60ee5ceadeab187d554c5a37 | adds accumulators for var and fwd | ## Summary
This adds specializations for `var` and `fwd` for Stan's `accumulator` class.
For https://github.com/stan-dev/stanc3/pull/898 I needed to add the ability for the accumulator to accept `var<Matrix>` type inputs. But then I was looking at the impl and I didn't really understand why we kept a whole `std:... | diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp
index e10e9da72f1..5e46cc1e083 100644
--- a/stan/math/fwd/fun.hpp
+++ b/stan/math/fwd/fun.hpp
@@ -5,6 +5,7 @@
#include <stan/math/fwd/fun/Eigen_NumTraits.hpp>
#include <stan/math/fwd/fun/abs.hpp>
+#include <stan/math/fwd/fun/accumulator.hpp>
#include <stan... | 8 | 6 | 4 | [{"id": "G0", "claim": "Check how much the accumulator actually matters for rev scalars; if it does not matter, remove the accumulator class entirely, and if it does, use a general implementation that stores just a scalar plus a rev specialization that keeps the vector but sums containers first.", "category": "design",... | null |
stan-dev__math__2546 | stan-dev/math | 2,546 | defect | 7eee48cc1830a5d9c8b7173c98c3996344c76c70 | 74cab2796a379bff6ae33e90431f3c0c83b4b0fa | pow() for varmat |
## Summary
This adds pow for `var<Matrix>` types. I thought it would be better as it's own PR since this is a vectorized binary functions that takes in all combinations of matrices and scalars (and `std::vector<int>/std::vector<std::vector<int>>`)
## Tests
Tests added in mix for pow with varmat as well as al... | diff --git a/stan/math/prim/fun/pow.hpp b/stan/math/prim/fun/pow.hpp
index 65b4ff16215..eca3f0e6b0d 100644
--- a/stan/math/prim/fun/pow.hpp
+++ b/stan/math/prim/fun/pow.hpp
@@ -38,9 +38,10 @@ inline complex_return_t<U, V> complex_pow(const U& x, const V& y) {
* @param b Second input
* @return pow function applied t... | 2 | 1 | 0 | [{"id": "G0", "claim": "The prim pow() container overload should use require_not_var_matrix_t instead of the added require_all_not_matrix_st<is_var, T1, T2> constraint, since the rev implementations traverse the input matrices multiple times and so may be less efficient for matvar than the elementwise approach.", "cate... | null |
stan-dev__math__2549 | stan-dev/math | 2,549 | defect | d7848ba16f58ab441aabd0ca9c03de49178842c0 | 515891754cd20c512d7206ee2315876ef3ee7a36 | [WIP] apply_scalar_unary supports complex types | ## Summary
This is WIP to have `apply_scalar_unary` support complex types. The tests currently compile but fail the ad testing framework. @bob-carpenter I only had time to set this up but did not have time to look at why the ad test framework was failing. I can look more tmrw into that unless you have time to take a... | diff --git a/stan/math/prim/fun/acosh.hpp b/stan/math/prim/fun/acosh.hpp
index 4cf2cd3dfed..11ddeb0ab62 100644
--- a/stan/math/prim/fun/acosh.hpp
+++ b/stan/math/prim/fun/acosh.hpp
@@ -101,7 +101,7 @@ namespace internal {
*/
template <typename V>
inline std::complex<V> complex_acosh(const std::complex<V>& z) {
- s... | 9 | 5 | 1 | [{"id": "G0", "claim": "Complex NaN and +/-Inf inputs fail the PR's expect_ad checks and are excluded from the common vectorized tests, and the author proposes restoring 0.0/-0.0 to the common complex arguments (kept out only of the arc-trig functions) if just those functions cannot handle it.", "category": "testing", ... | null |
stan-dev__math__2554 | stan-dev/math | 2,554 | defect | d7848ba16f58ab441aabd0ca9c03de49178842c0 | 7b2f55a754557c8bb801518d0ca9cefe085ad2ad | Complex numbers get_real(), get_imag(), to_complex | ## Summary
Adding support for complex scalar functions get_real(), get_imag() and to_complex().
get_real() takes in a complex number and outputs its real component, get_imag() does the same but for the imaginary component.
to_complex() takes in either 0, 1, or 2 ints or doubles and returns a complex number with i... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index 3926cee93df..a39a7b63505 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -111,7 +111,9 @@
#include <stan/math/prim/fun/get.hpp>
#include <stan/math/prim/fun/get_base1.hpp>
#include <stan/math/prim/fun/get_base1_lhs.hpp>
+#include ... | 6 | 6 | 3 | [{"id": "G0", "claim": "Don't remove real() and imag(): they are needed to support programs written against the C++ standard library for autodiff, even if Stan itself won't call them by those names.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The... | null |
stan-dev__math__2566 | stan-dev/math | 2,566 | defect | d8380980dd76838dfb8f6335f5882872e08635d5 | f0906b544b6c83ed0d86ef520ba33e5834099add | updated inv_Phi | ## Summary
faster inverse phi see issue #2555
based on Algorithm described in Wichura, M. J. (1988) Algorithm AS 241: The percentage points of the normal distribution. Applied Statistics, 37, 477–484.
which provides precise results up to about 16 digits.
## Tests
I used the same tests that were already ther... | diff --git a/stan/math/prim/fun/inv_Phi.hpp b/stan/math/prim/fun/inv_Phi.hpp
index 35afd412fb5..b2d266eccaf 100644
--- a/stan/math/prim/fun/inv_Phi.hpp
+++ b/stan/math/prim/fun/inv_Phi.hpp
@@ -1,6 +1,7 @@
#ifndef STAN_MATH_PRIM_FUN_INV_PHI_HPP
#define STAN_MATH_PRIM_FUN_INV_PHI_HPP
+#include <stan/math/prim/fun/abs... | 9 | 8 | 3 | [{"id": "G0", "claim": "The doc sentence '...Applied Statistics, 37, 477-484. which provides precise results up to about 16 digits.' is a sentence fragment starting with 'which' and should be turned into a standalone statement that the algorithm provides about 16 digits of precision.", "category": "documentation", "ver... | null |
stan-dev__math__2574 | stan-dev/math | 2,574 | defect | 6ec156000d25f0ae5ba2e329583b08c7d609a6a0 | 83394fcc11b21e99cfe82fe7a478bb5b1aeec607 | Add vectorized versions of the free functions | ## Summary
This is for https://github.com/stan-dev/stanc3/pull/947 and allows the compiler to simply call the free functions for standard vectors holding containers instead of generating a for loop and iterating over them.
All the functions here are pretty much the same with the scheme being
```cpp
template <... | diff --git a/stan/math/prim/fun/cholesky_corr_free.hpp b/stan/math/prim/fun/cholesky_corr_free.hpp
index 2028b1c14ff..790ecb887ce 100644
--- a/stan/math/prim/fun/cholesky_corr_free.hpp
+++ b/stan/math/prim/fun/cholesky_corr_free.hpp
@@ -33,6 +33,22 @@ auto cholesky_corr_free(const T& x) {
return z;
}
+/**
+ * Ove... | 2 | 2 | 1 | [{"id": "G0", "claim": "The new vectorized overloads may fail on an empty standard vector because they reference x[0], which does not exist when the vector has size 0 (a legal declaration such as `array[0] simplex[5] a;`).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"... | null |
stan-dev__math__2577 | stan-dev/math | 2,577 | defect | d59561bbe8fc53f5c32d592ef5f43c162e806940 | 88e3ae2812c028f80f1dc63199c3cefa08d1feb9 | check generalized inverse for full rank symmetric mat | ## Summary
Fixes #2576. Add a check on symmetric matrices for full rank. Uses the ~FullPivLU~ completeOrthogonalDecomposition to check the rank and returns Eigen's pseudoInverse from the complete ortho-decomp if rank < full rank (otherwise just do the regular inverse).
## Tests
Added a test for a less than fu... | diff --git a/stan/math/prim/fun/generalized_inverse.hpp b/stan/math/prim/fun/generalized_inverse.hpp
index f119885fb21..93b15851331 100644
--- a/stan/math/prim/fun/generalized_inverse.hpp
+++ b/stan/math/prim/fun/generalized_inverse.hpp
@@ -1,6 +1,7 @@
#ifndef STAN_MATH_PRIM_FUN_GENERALIZED_INVERSE_HPP
#define STAN_M... | 1 | 1 | 0 | [{"id": "G0", "claim": "The square-matrix branch should be rewritten to use a Cholesky (LLT) solve instead of the full-pivot LU, because the author reports that works and will be much faster.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__math__2586 | stan-dev/math | 2,586 | defect | a3741c2fb60107ac5989117b55795e0f30b549c9 | e890f36fd3d5711aa9b28acdec66bc3918e5b3bf | [Fix] csr_matrix_times_vector indexing | ## Summary
This fixes `csr_matrix_times_vector` to use 1 indexed `u` and `v` for the CSR matrix format. It also updates the reverse mode version to support `var` types on the left and right hand side.
## Tests
Tests are updated to change for 0 indexed values, the sizes of `u` and `v`, and correctness with the ... | diff --git a/stan/math/prim/fun/csr_matrix_times_vector.hpp b/stan/math/prim/fun/csr_matrix_times_vector.hpp
index 9dfbcda196f..14106d0cafa 100644
--- a/stan/math/prim/fun/csr_matrix_times_vector.hpp
+++ b/stan/math/prim/fun/csr_matrix_times_vector.hpp
@@ -70,16 +70,14 @@ namespace math {
* @throw std::out_of_range i... | 2 | 2 | 0 | [{"id": "G0", "claim": "The newly added check_size_match(\"csr_matrix_times_vector\", \"w\", w.size(), \"v\", v.size()) duplicates the identical check already present two lines below and is redundant.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim"... | null |
stan-dev__math__2596 | stan-dev/math | 2,596 | defect | 57f05b7354af652031e10f7e278f82bdbedb1a40 | 59eaf40f6a9c1bcdfcd9ce1f58208d7fcac4d3cc | delegate lmultiply to multiply_log; vectorize abs | ## Summary
Add `lmultiply` function that parallels `multiply_log` so that the language doesn't have to rename.
Add vectorized signatures for `abs()` that deal with integer returns for integer container inputs.
While I was at it, I removed the annoying warnings from using the deprecated shuffle command from t... | diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 403610bc12f..d081c072702 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -25,4 +25,4 @@ If this is a **feature request**, show what you expect to happen if the feature
#### Current Version:
-v4.1.0
+v4.2.0
diff --git... | 2 | 1 | 1 | [{"id": "G0", "claim": "The OpenCL test requirements fail without an informative message, probably because a file configuring lmultiply (copied over from multiply_log) was missed, and the author asks for help fixing it.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id"... | null |
stan-dev__math__2616 | stan-dev/math | 2,616 | defect | 20224ff479ca557a82a7ea3c5446d301a7d85825 | e16f2308f519aeac16e3f275163e6b204587fbed | bugfix for issue 2615: use Pade approx for matrix_exp_2x2 when cosh & sinh ops overflow | ## Summary
This PR addresses https://github.com/stan-dev/math/issues/2615 where a matrix with large eigenvalues may cause overflow in the naive implementation for 2x2 matrices. In the fix we check if the 2x2 algorithm outputs `NaN` and use Pade approximation result if it does.
## Tests
An additional unit test in... | diff --git a/stan/math/prim/fun/matrix_exp_2x2.hpp b/stan/math/prim/fun/matrix_exp_2x2.hpp
index e4d7522bd8b..1cf120c38c3 100644
--- a/stan/math/prim/fun/matrix_exp_2x2.hpp
+++ b/stan/math/prim/fun/matrix_exp_2x2.hpp
@@ -47,7 +47,12 @@ matrix_exp_2x2(const EigMat& A) {
B(1, 0) = c * Two_exp_sinh;
B(1, 1) = exp_ha... | 1 | 1 | 0 | [{"id": "G0", "claim": "Eigen 3.3.9 also supports hasNaN(), which would be easier to read than the naive (B.array() != B.array()).any() NaN check and would not require additional comments to understand.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
stan-dev__math__2619 | stan-dev/math | 2,619 | defect | ddf8946198ae531954456996bc2f2cf62374c3e0 | 1081352b5f5f7c053d69570bc5c67319a83d0bc7 | fix matrix_exp_multiply accuracy bug | ## Summary
Fix #2529 by re-implementing the `prim` version of the function.
## Tests
- test `matrix_exp_multiply_handle` components that calculate the taylor expansion order and helper function approximating matrix power norm.
- test matrices from #2529.
## Side Effects
n/a
## Release notes
Bugfix... | diff --git a/stan/math/prim/fun/matrix_exp_action_handler.hpp b/stan/math/prim/fun/matrix_exp_action_handler.hpp
index 9c7bcfc1230..ca20c57377c 100644
--- a/stan/math/prim/fun/matrix_exp_action_handler.hpp
+++ b/stan/math/prim/fun/matrix_exp_action_handler.hpp
@@ -3,6 +3,8 @@
#include <stan/math/prim/meta.hpp>
#inc... | 11 | 10 | 1 | [{"id": "G0", "claim": "The expression tests fail (matrix1_expr3_counter 2 vs 1, expected <= 1): when the second matrix argument is an Eigen expression it is evaluated twice.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "Remove the stray empty comm... | null |
stan-dev__math__2620 | stan-dev/math | 2,620 | defect | a5e40e7633aabae9d25f083569fccd3268b79fde | ee568be0a9a831957ff86a5b32ca674fe4a349ea | use CVODES error string instead of numeric flag in error messages | This PR addresses #1039 by replacing flag with strings from CVODES.
## Summary
The replacement happens inside the checking functions. With added `cvodes_check` we call the library functions that map flag to error string constant.
## Tests
All CVODES unit tests with error throw checks.
## Side Effects
... | diff --git a/stan/math/prim/err/check_flag_sundials.hpp b/stan/math/prim/err/check_flag_sundials.hpp
index 3bebb166e5c..9bb60a881ce 100644
--- a/stan/math/prim/err/check_flag_sundials.hpp
+++ b/stan/math/prim/err/check_flag_sundials.hpp
@@ -1,12 +1,178 @@
#ifndef STAN_MATH_PRIM_ERR_CHECK_FLAG_SUNDIALS_HPP
#define STA... | 7 | 6 | 0 | [{"id": "G0", "claim": "Reorder the includes in check_flag_sundials.hpp so the Stan Math headers come before the third-party SUNDIALS C headers, following the project's include-order convention.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Dec... | null |
stan-dev__math__2637 | stan-dev/math | 2,637 | defect | a43562ea29ef1bb892cb7942787d682f002dfc7c | be10487b369912d466dd93d16f7ace0a9911e122 | Incomplete Beta Function Inverse | ## Summary
This PR adds the inverse of the incomplete beta function, will be needed for some of the quantile/icdf functions to come.
## Tests
Individual `rev/fwd/mix` tests have been added, as the gradients use the `F32` hypergeometric series and the autodiff finite-differencing tests are not stable.
## Side Ef... | diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp
index d33dc0fa4a7..0c2d4559867 100644
--- a/stan/math/fwd/fun.hpp
+++ b/stan/math/fwd/fun.hpp
@@ -43,6 +43,7 @@
#include <stan/math/fwd/fun/grad_inc_beta.hpp>
#include <stan/math/fwd/fun/hypot.hpp>
#include <stan/math/fwd/fun/inc_beta.hpp>
+#include <stan/ma... | 3 | 3 | 2 | [{"id": "G0", "claim": "The rev inc_beta_inv documentation says the function is 'used to compute the cumulative density function' when it should say the inverse cumulative density function.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The rev fi... | null |
stan-dev__math__2645 | stan-dev/math | 2,645 | defect | 46fa82de5489d0ddacae6bb33d4c450bde5eb939 | 5e4d2402bfafcf39f5192a7b5fc054a388e79e30 | Inverse of the complementary error function | ## Summary
This PR adds the inverse of the complementary error function: `erfc_inv(x)`, which will be needed for the quantile functions of the normal and log-normal distributions
## Tests
`prim` and `mix` tests are added
## Side Effects
N/A
## Release notes
Added the inverse of the complementary erro... | diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp
index 1291df30a61..64f22d57d6e 100644
--- a/stan/math/fwd/fun.hpp
+++ b/stan/math/fwd/fun.hpp
@@ -27,6 +27,7 @@
#include <stan/math/fwd/fun/digamma.hpp>
#include <stan/math/fwd/fun/erf.hpp>
#include <stan/math/fwd/fun/erfc.hpp>
+#include <stan/math/fwd/fun/e... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new function should be named `inv_erfc` instead of `erfc_inv`, to match the `inv_` prefix used by the other inverse functions (`inv_Phi`, `inv_cloglog`, `inv_logit`, `inv_sqrt`, `inv_square`), assuming the function is meant to be exposed.", "category": "design", "verdict": "supported", "prio... | null |
stan-dev__math__2680 | stan-dev/math | 2,680 | defect | 01dd2e7487236880bfc7282119d1355fdfd9dc48 | 4217894cb1a08f8ff1671ad654a22dd08bba191a | add overloads for scalar complex and eigen matrix multiplication | ## Summary
This adds overloads for `multiply(ComplexScalar, EigenMatrix)` and `multiply(EigenMatrix, ComplexScalar)`
## Tests
Tests added in `mix` to check instantiations of scalars and eigen matrices all compile.
## Side Effects
Nope
## Release notes
Add overloads for scalar complex and eigen mat... | diff --git a/stan/math/prim/core/operator_multiplication.hpp b/stan/math/prim/core/operator_multiplication.hpp
index bb70715033b..9c29544a459 100644
--- a/stan/math/prim/core/operator_multiplication.hpp
+++ b/stan/math/prim/core/operator_multiplication.hpp
@@ -2,6 +2,8 @@
#define STAN_MATH_PRIM_CORE_OPERATOR_MULTIPLIC... | 2 | 2 | 1 | [{"id": "G0", "claim": "The doxygen comment for the complex matrix-scalar multiply specialization should be written user-facing, with a first sentence stating what the arguments are and what the return value is, rather than dev-facing wording framed around 'specialization'.", "category": "documentation", "verdict": "su... | null |
stan-dev__math__2686 | stan-dev/math | 2,686 | defect | fe99d5f31171edb24bc841a9fa2f082982771d35 | 1954e9677dcdbbf39efe3ba92723d1748856b991 | Feature/20 fft | ## Summary
This PR adds functions `fft` for 1D FFTS, `inv_fft` for 1D inverse FFTs, `fft2` for 2D FFTs, and `inv_fft2` for 2D inverse FFTs.
Implementation delegates to Eigen with appropriate templating and just autodiffs through the vector operations.
## Tests
For primitive tests, (a) tested values against ... | diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp
index 79b5bd2c230..d55c7a286cb 100644
--- a/stan/math/prim/fun.hpp
+++ b/stan/math/prim/fun.hpp
@@ -99,6 +99,7 @@
#include <stan/math/prim/fun/factor_cov_matrix.hpp>
#include <stan/math/prim/fun/falling_factorial.hpp>
#include <stan/math/prim/fun/fdim.hpp>... | 8 | 5 | 1 | [{"id": "G0", "claim": "The mix fft autodiff tests fail with NaN fvar (forward-mode) gradient values against finite finite-difference results, so CI is red, and there should be a way to turn higher-order testing off without an environment variable like -DSTAN_MATH_TESTS_REV_ONLY.", "category": "correctness", "verdict":... | null |
stan-dev__math__2710 | stan-dev/math | 2,710 | defect | e0884615b80182965f78cbf21cfe044d7b170e3b | 5c400a5ebb1e59e1cfbaf4ecfc7182863379229b | add wishart_cholesky | ## Summary
Adds the `wishart_cholesky_lpdf()` and `wishart_cholesky_rng()` functions.
## Tests
The tests use the `wishart_lpdf` tests but add log absolute Jacobian correction for the change of variables from the input X to the Cholesky factor L.
## Release notes
The `wishart_cholesky_lpdf` is the Cholesk... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 78fd7d168cf..d63e6cf0e6e 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -363,6 +363,8 @@
#include <stan/math/prim/prob/weibull_rng.hpp>
#include <stan/math/prim/prob/wiener_log.hpp>
#include <stan/math/prim/prob/wiener_lpdf.h... | 7 | 7 | 0 | [{"id": "G0", "claim": "Fix the doc-comment line breaks in wishart_cholesky_lpdf.hpp so wrapped continuation lines keep the leading asterisk.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Use single back ticks to quote argument variables in the d... | null |
stan-dev__math__2713 | stan-dev/math | 2,713 | defect | 919e10c1fb0127b5f0446fff5bc617239cf55d4b | a8daf7fd5b94e58a1226af00113b5a72b23f19a6 | add Inverse wishart cholesky | ## Summary
Adds the `inv_wishart_cholesky_lpdf` and `_rng` functions. This PR depends upon #2710 for the `_rng` function. Closes #2714.
## Release notes
The inverse Wishart Cholesky parameterization `lpdf\lupdf` is available along with `inv_wishart_cholesky_rng`.
## Checklist
- [ ] Math issue #(issue num... | diff --git a/stan/math/prim/prob.hpp b/stan/math/prim/prob.hpp
index 432a052b45e..e9ba2f24471 100644
--- a/stan/math/prim/prob.hpp
+++ b/stan/math/prim/prob.hpp
@@ -156,6 +156,8 @@
#include <stan/math/prim/prob/inv_gamma_log.hpp>
#include <stan/math/prim/prob/inv_gamma_lpdf.hpp>
#include <stan/math/prim/prob/inv_gam... | 17 | 14 | 3 | [{"id": "G0", "claim": "The inv_wishart_cholesky_lpdf header doc should read as a 'Return ...' sentence, use lowercase 'inverse Wishart', say both the variate and the scale matrix are in lower-triangular Cholesky factor form, and follow the argument-doc style (no caps or periods for short descriptions, say whether nu i... | null |
stan-dev__math__2721 | stan-dev/math | 2,721 | defect | e0884615b80182965f78cbf21cfe044d7b170e3b | 00baf03d8d7a99e45c69f36e4874346c674ed2f3 | Add `grad_2F1` gradient for a2 | ## Summary
Adds gradient calculation for a2 input and fixes incorrect return values when `z` is between -1 and 0. Closes #2663.
## Release notes
Adds gradient calculation for the a2 input in stan-math for the `grad_2F1` function and fixes incorrect return values when `z` is between -1 and 0.
## Checklist
... | diff --git a/stan/math/fwd/fun/grad_inc_beta.hpp b/stan/math/fwd/fun/grad_inc_beta.hpp
index 194d747072f..3e8cb05e73a 100644
--- a/stan/math/fwd/fun/grad_inc_beta.hpp
+++ b/stan/math/fwd/fun/grad_inc_beta.hpp
@@ -40,12 +40,13 @@ void grad_inc_beta(fvar<T>& g1, fvar<T>& g2, fvar<T> a, fvar<T> b, fvar<T> z) {
fvar<T... | 7 | 6 | 0 | [{"id": "G0", "claim": "The doxygen @param lines in the calc_lambda and grad_2F1 doc comments duplicate the parameter name in the description (e.g. `@param[in] log_z log_z see ...`), which should read as a plain description.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.