> For the complete documentation index, see [llms.txt](https://excelhelp.windhamlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://excelhelp.windhamlabs.com/functions/simulation/bootstrap.md).

# BOOTSTRAP

## Description

Bootstrap simulation method samples from an empirical dataset typically drawing independent observations with equal probability to reconstruct a new hyptothetical distribution. with BOOTSTRAP, can sample with equal probability or with specified biases in the empirical dataset. This is useful for stress testing and scenario analysis. This function draws from sample with replacement.

## Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

```excel-formula
=BOOTSTRAP(sample, nPaths, numPeriods, weights, prVector, rndSeed)
```

### Input(s)

| Argument       | Description                                                                                                                                                                                                                              |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sample**     | Vector or matrix of the sample population data.                                                                                                                                                                                          |
| **nPaths**     | Number of paths to simulate.                                                                                                                                                                                                             |
| **numPeriods** | Number of periods to simulate.                                                                                                                                                                                                           |
| **weights**    | Optional argument. Vector of asset/variable weights to apply to sample. If weights are not specified and sample is multivariate, then **nPaths** will be forced to 1.                                                                    |
| **prVector**   | Optional argument. Probability vector to specifiy the likelihood of sampling from a given period in the sample population. If not specified, this argument defaults to an equal probabilities across all periods (uniform distribution). |
| **rndSeed**    | Optional argument, numeric value to specify random generator seed. If not specified, the random seed is a function of CPU clock.                                                                                                         |

### Output(s)

Bootstrap simulated sample with repetitions. The simulated sample will be `numPeriods` by `nPaths` in size.&#x20;

{% hint style="info" %}
Because Microsoft Excel is in some ways a 2-dimensional application, it is challenging to work with persisting N-dimensional arrays in a presentable form. To accommodate this, we can bootstrap multivariate samples and aggregate the results to a portfolio solution via **weights** and return a 2-dimensional matrix of bootstrapped portfolio values.
{% endhint %}

## Example

{% hint style="warning" %}
Coming soon.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://excelhelp.windhamlabs.com/functions/simulation/bootstrap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
