# Crystal sci-calc

Sci-calc is a CLI based collection of utilities for scientific data analysis written in Crystal.

Available utilities:

## Building

Install crystal compiler.

Then:

```
git clone https://github.com/heric06/sci-calc
cd sci-calc/
shards build --release
### Optional
sudo cp ./bin/sci-calc /usr/bin/
```

## Usage

Useful for things like this:

```
egrep -o '[0-9](|\.[0-9])' path/to/numbers_sep_by_commas.csv | sci-calc your-sub-command
```

Use `sci-calc your-sub-command --help`

for option list.

### Auto-correlation

Calculates statistical correlation with itself.

### Average

Calculates average of numerical data.

### Correlation

Calculates statistical correlation of two or more numerical series. Needs **at least** 2 series.

- Q: "More series?"
- A: "If more than two series are given, sci-calc will calculate correlation between each binary combination"

### Histogram

Distribuition of numerical data.

Calculates histogram and outputs elements frequencies in range left-right of each file. If no such files are given, reads standard input.

Left and right limiters **must** be less than *min* and greater than *max*, respectively, but by default they are set to *min* - 1e-7 and *max* + 1e-7. Crystal supports scientific notation, so that you can call sci-calc like this:
`sci-calc histogram --bins 10 --norm --left -1e-6 /path/to/file.whatever`

### Standard Deviation

### Sum

### Variance

## Contributing

- Fork it (https://github.com/heric06/sci-calc/fork)
- Create your feature branch (
`git checkout -b my-new-feature`

)
- Commit your changes (
`git commit -am 'Add some feature'`

)
- Push to the branch (
`git push origin my-new-feature`

)
- Create a new Pull Request

## Contributors