{"id":25842224,"url":"https://github.com/gunnarpdx/correlations","last_synced_at":"2025-03-01T05:38:22.902Z","repository":{"id":56606966,"uuid":"308222834","full_name":"GunnarPDX/Correlations","owner":"GunnarPDX","description":"📊 A financial correlations library for Elixir, fully compatible with the elixir Decimal library.","archived":false,"fork":false,"pushed_at":"2020-11-02T21:51:37.000Z","size":79,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T13:22:24.861Z","etag":null,"topics":["correlation-matrix","portfolio-correlation","portfolio-deviation","sharpe-ratio","sortino"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GunnarPDX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-29T05:01:39.000Z","updated_at":"2024-12-15T00:52:06.000Z","dependencies_parsed_at":"2022-08-15T21:50:26.550Z","dependency_job_id":null,"html_url":"https://github.com/GunnarPDX/Correlations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GunnarPDX%2FCorrelations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GunnarPDX%2FCorrelations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GunnarPDX%2FCorrelations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GunnarPDX%2FCorrelations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GunnarPDX","download_url":"https://codeload.github.com/GunnarPDX/Correlations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241322547,"owners_count":19944073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correlation-matrix","portfolio-correlation","portfolio-deviation","sharpe-ratio","sortino"],"created_at":"2025-03-01T05:38:22.429Z","updated_at":"2025-03-01T05:38:22.897Z","avatar_url":"https://github.com/GunnarPDX.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/tterb/atomic-design-ui/blob/master/LICENSEs)\n[![Hex.pm Version](http://img.shields.io/hexpm/v/correlations.svg?style=flat)](https://hex.pm/packages/correlations)\n\n# Correlations\n\nA financial correlations library for elixir, fully compatible with the elixir `Decimal` library.\n\n![correlation matrix img](https://github.com/GunnarPDX/correlation-matrix-chart/blob/master/correlation-matrix.png?raw=true)\n\n### Example frontend usage\nhttps://github.com/GunnarPDX/Nice-Charts\n\n## Installation\n\nThis package can be installed by adding `correlations` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:correlations, \"~\u003e 0.1.1\"},\n  ]\nend\n```\n\n## Docs\n\n#### HexDocs: [https://hexdocs.pm/correlations](https://hexdocs.pm/correlations/Correlations.html#functions)\n\n## Functions\n\n- `portfolio_correlations_picker(stocks, portfolio_size)`\n\n- `portfolio_correlations_list(stocks, portfolio_size)`\n\n- `correlation_matrix(stocks)`\n\n- `json_correlation_matrix(stocks)`\n\n- `correlation(x, y)`\n\n\n## Usage\n```elixir\niex\u003e alias Correlations, as: C\n\niex\u003e stocks = [\n    aapl: [124.400002, 121.099998, 121.190002, 120.709999, 119.019997],\n    nvda: [569.039978, 569.929993, 563.809998, 558.799988, 552.460022],\n    tsla: [442.299988, 446.649994, 461.299988, 448.880005, 439.670013],\n    amzn: [3442.929932, 3443.629883, 3363.709961, 3338.649902, 3272.709961]\n  ]\n\niex\u003e decimal_stocks = for {k, v} \u003c- stocks, do: {k, decimalize(v)}\n\niex\u003e C.portfolio_correlations_picker(decimal_stocks, 2)\n{Decimal\u003c0.104192125\u003e, [:aapl, :tsla]}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunnarpdx%2Fcorrelations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgunnarpdx%2Fcorrelations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunnarpdx%2Fcorrelations/lists"}