Metadata-Version: 2.4
Name: reasonforge-statistics
Version: 0.1.1
Summary: Probability and data science MCP server - 16 tools for statistics
Author-email: Derek Fox <derek-fox@mail.com>
Project-URL: Homepage, https://github.com/foxintheloop/ReasonForge
Project-URL: Repository, https://github.com/foxintheloop/ReasonForge
Project-URL: Issues, https://github.com/foxintheloop/ReasonForge/issues
Keywords: mcp,statistics,probability,data-science,sympy
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: sympy>=1.12
Requires-Dist: reasonforge>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"

# ReasonForge Statistics

**Probability, statistics, and data science - 16 tools**

An MCP (Model Context Protocol) server that provides Claude with statistical and probabilistic reasoning capabilities using SymPy's symbolic engine.

> **Beta Status**: This package is functional but still undergoing testing. Some edge cases may not be fully covered. Please report issues on [GitHub](https://github.com/foxintheloop/ReasonForge/issues).

## Capabilities

- **Probability Theory** - Symbolic probability calculations and distributions
- **Statistical Inference** - Bayesian inference, hypothesis testing, confidence intervals
- **Regression Analysis** - Symbolic regression and correlation
- **Data Science** - Statistical moments, time series, ANOVA, multivariate statistics

## Installation

```bash
pip install reasonforge-statistics
```

Or install from source:

```bash
git clone https://github.com/foxintheloop/ReasonForge.git
cd ReasonForge
pip install -e packages/reasonforge -e packages/reasonforge-statistics
```

## Claude Desktop Configuration

Add to your Claude Desktop config file:

**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "reasonforge-statistics": {
      "command": "python",
      "args": ["-m", "reasonforge_statistics"]
    }
  }
}
```

## Tools

### Probability (3 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `calculate_probability` | Compute symbolic probabilities | P(A and B) given P(A), P(B) |
| `probability_distributions` | Work with probability distributions | Normal, Poisson, Binomial |
| `distribution_properties` | Get distribution properties | Mean, variance, MGF |

### Statistical Inference (4 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `bayesian_inference` | Perform Bayesian updates | Posterior from prior and likelihood |
| `statistical_test` | Conduct statistical tests | t-test, chi-square |
| `hypothesis_test_symbolic` | Symbolic hypothesis testing | Power analysis |
| `confidence_intervals` | Compute confidence intervals | 95% CI for mean |

### Regression (2 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `regression_symbolic` | Symbolic regression analysis | Fit polynomial models |
| `correlation_analysis` | Compute correlation coefficients | Pearson, Spearman |

### Data Science (7 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `symbolic_dataframe` | Symbolic data manipulation | Transform data symbolically |
| `statistical_moments_symbolic` | Compute moments of distributions | Skewness, kurtosis |
| `time_series_symbolic` | Time series analysis | Trend, seasonality |
| `anova_symbolic` | Analysis of variance | One-way, two-way ANOVA |
| `multivariate_statistics` | Multivariate analysis | PCA, factor analysis |
| `sampling_distributions` | Sampling distribution theory | CLT applications |
| `experimental_design` | Design of experiments | Factorial designs |

## Example Usage

Once configured, you can ask Claude:

**Probability:**
- "What is the probability of getting at least 3 heads in 5 coin flips?"
- "Calculate the expected value of a Poisson distribution with lambda = 5"

**Inference:**
- "Perform a Bayesian update: prior is Beta(2,2), observed 7 successes in 10 trials"
- "Calculate the 95% confidence interval for a sample mean"

**Regression:**
- "Fit a quadratic model to these data points: (1,2), (2,5), (3,10), (4,17)"
- "What is the correlation coefficient for these paired observations?"

**Data Analysis:**
- "Compute the skewness and kurtosis of a normal distribution"
- "Set up a one-way ANOVA for comparing three treatment groups"

## Dependencies

- Python >= 3.10
- mcp >= 1.0.0
- sympy >= 1.12
- reasonforge (core library)

## Running Tests

```bash
pytest packages/reasonforge-statistics/tests/ -v
```

## License

MIT License - See [LICENSE](../../LICENSE) for details.

## Related Packages

- [reasonforge](https://pypi.org/project/reasonforge/) - Core symbolic computation library
- [reasonforge-algebra](https://pypi.org/project/reasonforge-algebra/) - Matrix operations for statistics
- [reasonforge-analysis](https://pypi.org/project/reasonforge-analysis/) - Calculus for probability theory
- [reasonforge-logic](https://pypi.org/project/reasonforge-logic/) - Logical reasoning
