Skip to content

Commit ee7122b

Browse files
committed
Merge branch 'master' of https://github.com/stan-dev/docs into issue/774-size-must-be-data-var
2 parents 90255c6 + 419c978 commit ee7122b

File tree

6 files changed

+453
-323
lines changed

6 files changed

+453
-323
lines changed

gen_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def write_index_page(index):
5454

5555
escaped_name = name.replace("\\", "\\\\").replace("*", "\\*")
5656
f.write(f"**{escaped_name}**:\n\n")
57-
for link, entry in sorted(links):
57+
for link, entry in sorted(links, key=lambda x: x[1].lower() + x[0]):
5858
f.write(f" - [{entry}]({link})\n")
5959
f.write("\n\n")
6060

src/cmdstan-guide/installation.qmd

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -396,34 +396,49 @@ g++ --version
396396
make --version
397397
```
398398

399-
CmdStan is known compatible with the RTools43 toolchain. The toolchain will require
399+
CmdStan is known compatible with the RTools44 toolchain. The toolchain will require
400400
updating your `PATH` variable, See [these instructions](https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/)
401401
for details on changing the `PATH` if you are unfamiliar. The following instructions will assume that the default installation
402402
directory was used, so be sure to update the paths accordingly if you have chosen a different
403403
directory.
404404

405405

406-
##### RTools43
406+
##### RTools44
407407

408408
All required utilities (e.g., `make`, `g++`) for compiling and running CmdStan models on Windows are
409-
provided by the RTools43 toolchain from the R Project. Installation steps are provided below,
410-
and for more technical details on the toolchain refer to the [R Project documentation](https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html).
409+
provided by the RTools44 toolchain from the R Project. Installation steps are provided below,
410+
and for more technical details on the toolchain refer to the [R Project documentation](https://cran.r-project.org/bin/windows/Rtools/rtools44/rtools.html).
411+
412+
The R Project provides RTools44 for both Intel/AMD 64-bit (x86_64) and ARM 64-bit (aarch64) systems.
413+
If you are unsure which to use, then you can check by going to the Windows Settings, selecting the 'System' menu and then the 'About' option.
414+
If the 'System Type' field lists 'ARM-based processor', then you should follow the ARM64 instructions below.
411415

412416
Note that the toolchain is only available for 64-bit systems, and uses the new Universal C Runtime (UCRT).
413417
UCRT is only natively supported on Windows 10 and newer, older systems will require a
414418
[Microsoft update](https://support.microsoft.com/en-us/topic/update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c).
415419

416-
###### Installation
420+
###### Installation - Intel/AMD 64-bit (x86_64)
421+
422+
Download the installer and complete the prompts for installation:
423+
424+
- [RTools44](https://cran.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-6104-6039.exe)
425+
426+
Next, you need to add the toolchain directory to your `PATH` variable:
427+
```
428+
C:\rtools44\usr\bin
429+
C:\rtools44\x86_64-w64-mingw32.static.posix\bin
430+
```
431+
432+
###### Installation - ARM 64-bit (arm64/aarch64)
417433

418434
Download the installer and complete the prompts for installation:
419435

420-
- [RTools43](https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-5958-5975.exe)
436+
- [RTools44 - ARM64](https://cran.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-aarch64-6104-6039.exe)
421437

422-
Next, you need to add the toolchain directory to your `PATH` variable. Add the appropriate lines
423-
from below:
438+
Next, you need to add the toolchain directory to your `PATH` variable:
424439
```
425-
C:\rtools43\usr\bin
426-
C:\rtools43\x86_64-w64-mingw32.static.posix\bin
440+
C:\rtools44-aarch64\usr\bin
441+
C:\rtools44-aarch64\aarch64-w64-mingw32.static.posix\bin
427442
```
428443

429444
## Using GNU Make {#gnu-make}

src/cmdstan-guide/laplace_sample_config.qmd

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ and how much the true posterior in the unconstrained space resembles a Gaussian.
2424

2525
## Configuration
2626

27-
This method takes 2 arguments:
28-
29-
- `jacobian` - Whether or not the
30-
[Jacobian adjustment](https://mc-stan.org/docs/stan-users-guide/reparameterization.html)
31-
should be included in the gradient. The default value is `true` (include adjustment).
32-
(Note: in optimization, the default value is `false`, for historical reasons.)
27+
This method takes several arguments:
3328

3429
- `mode` - Input file of parameters values on the constrained scale.
3530
When Stan's `optimize` method is used to estimate the modal values,
@@ -38,6 +33,16 @@ run with default settings, i.e., the input is the MLE estimate;
3833
if `optimize` was run with argument `jacobian=true`, then the `laplace`
3934
method default setting, `jacobian=true`, should be used.
4035

36+
- `jacobian` - Whether or not the
37+
[Jacobian adjustment](https://mc-stan.org/docs/stan-users-guide/reparameterization.html)
38+
should be included in the gradient. The default value is `true` (include adjustment).
39+
(Note: in optimization, the default value is `false`, for historical reasons.)
40+
41+
- `draws` - How many total draws to return. The default is $1000$.
42+
43+
- `calculate_lp` - Whether to calculate the log probability of the model at
44+
each draw. If this is `false`, the `log_p__` column of the output will be
45+
entirely `nan`. The default value is `true`.
4146

4247

4348
## CSV output
@@ -53,6 +58,12 @@ These can be used for diagnostics and importance sampling.
5358

5459
- Output columns for all model parameters on the constrained scale.
5560

61+
## Diagnostic file outputs
62+
63+
If requested with `output diagnostic_file=`, a JSON file will be
64+
created which contains the log density, the gradient, and the Hessian
65+
of the log density evaluated at the mode.
66+
5667
## Example
5768

5869
To get an approximate estimate of the mode and standard deviation of the
@@ -83,7 +94,7 @@ The header and first few data rows of the output sample are shown below.
8394

8495
```
8596
# stan_version_major = 2
86-
# stan_version_minor = 31
97+
# stan_version_minor = 35
8798
# stan_version_patch = 0
8899
# model = bernoulli_model
89100
# start_datetime = 2022-12-20 01:01:14 UTC
@@ -92,6 +103,7 @@ The header and first few data rows of the output sample are shown below.
92103
# mode = bernoulli_lbfgs.csv
93104
# jacobian = true (Default)
94105
# draws = 1000 (Default)
106+
# calculate_lp = true (default)
95107
# id = 1 (Default)
96108
# data
97109
# file = examples/bernoulli/bernoulli.data.json

0 commit comments

Comments
 (0)