You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for constructing target distribution from formula (#66)
* Add function for constructing target distribution from formula
* Wrap trace function into target distribution arg
* Ensure gradient a vector and add to NAMESPACE
* Combine BridgeStan interface functions for constructing target distribution and trace function
* Allow passing formula or Stan model directly to sample_chain
* Use dummy variable declaration to avoid check note
* Qualify deriv call with stats package name
* Test target distribution from formula function
* Use base::inherits in place of methods::is
* Remove removed trace_function argument from sample_chain docs
Clarify trace_function allowable output types
* Test using invalid target distribution with sample_chain raises error
* Test passing explicit trace function to sample_chain
* Test using sample_chain with Stan model and log density formula works
Copy file name to clipboardExpand all lines: README.Rmd
+6-20Lines changed: 6 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -72,36 +72,22 @@ cat(
72
72
```
73
73
74
74
As a second example, the snippet below demonstrates sampling from a two-dimensional banana shaped distribution based on the [Rosenbrock function](https://en.wikipedia.org/wiki/Rosenbrock_function) and plotting the generated chain samples.
75
-
Here we use the default values of the `proposal` and `adapters` arguments to `sample_chain`,
75
+
Here we use the default values of the `proposal` and `adapters` arguments to `sample_chain()`,
76
76
corresponding respectively to the Barker proposal, and adapters for tuning the proposal scale to coerce the average acceptance rate using a dual-averaging algorithm,
77
77
and for tuning the proposal shape based on an estimate of the target distribution covariance matrix.
78
+
The `target_distribution` argument to `sample_chain()` is passed a formula specifying the log density of the target distribution, which is passed to `target_distribution_from_log_density_formula()` to construct necessary functions,
79
+
using `stats::deriv()` to symbolically compute derivatives.
0 commit comments