{"id":17646385,"url":"https://github.com/samuelsonric/gaussianrelations.jl","last_synced_at":"2026-03-19T01:38:54.354Z","repository":{"id":226301812,"uuid":"763596380","full_name":"samuelsonric/GaussianRelations.jl","owner":"samuelsonric","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-14T19:57:18.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-30T22:03:45.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/samuelsonric.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-26T15:34:54.000Z","updated_at":"2024-03-06T20:39:57.000Z","dependencies_parsed_at":"2024-03-14T20:46:13.898Z","dependency_job_id":"99fbbc0d-444d-49ae-aecb-5bd4910d8ead","html_url":"https://github.com/samuelsonric/GaussianRelations.jl","commit_stats":null,"previous_names":["samuelsonric/gaussianrelations.jl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samuelsonric/GaussianRelations.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelsonric%2FGaussianRelations.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelsonric%2FGaussianRelations.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelsonric%2FGaussianRelations.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelsonric%2FGaussianRelations.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelsonric","download_url":"https://codeload.github.com/samuelsonric/GaussianRelations.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelsonric%2FGaussianRelations.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30683534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-19T00:52:14.022Z","status":"ssl_error","status_checked_at":"2026-03-19T00:51:33.610Z","response_time":104,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-23T11:01:32.022Z","updated_at":"2026-03-19T01:38:54.323Z","avatar_url":"https://github.com/samuelsonric.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GaussianRelations.jl\n\n[![tests](https://github.com/samuelsonric/GaussianRelations.jl/actions/workflows/tests.yml/badge.svg)](https://github.com/samuelsonric/GaussianRelations.jl/actions/workflows/tests.yml?query=workflow%3Atests)\n[![codecov](https://codecov.io/gh/samuelsonric/GaussianRelations.jl/graph/badge.svg?token=pVcto1pdzK)](https://codecov.io/gh/samuelsonric/GaussianRelations.jl)\n\nGaussianRelations.jl is a Julia library that provides tools for working with Gaussian linear systems. It accompanies the paper [A Categorical Treatment of Open Linear Systems](https://arxiv.org/abs/2403.03934).\n\n## Example: A Noisy Resistor\n\nIn the paper [Open Stochastic Systems](https://ieeexplore.ieee.org/abstract/document/6255764), Jan Willems defines a Gaussian linear system that he calls the \"noisy resistor.\"\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"resistor.png\" width=\"259\" height=\"215\"\u003e\n\u003c/p\u003e\n\nUsing our library, the noisy resistor can be implemented as follows.\n\n```julia\nusing Catlab\nusing GaussianRelations\n\n###############################\n# Example 1: A Noisy Resistor #\n###############################\n\nσ₁ = 1/2\nR₁ = 2\n\n# ϵ₁ ~ N(0, σ₁²)\nϵ₁ = CovarianceForm(0, σ₁^2)\n\n# Define the noisy resistor using a kernel representation.\n#         [ I₁ ]\n# [-R₁ 1] [ V₁ ] = ϵ₁\nIV₁ = [-R₁ 1] \\ ϵ₁\n\n#################################################\n# Example 3: The Noisy Resistor, Interconnected #\n#################################################\n\nσ₂ = 2/3\nR₂ = 4\nV₀ = 5\n\n# ϵ₂ ~ N(0, σ₂²)\nϵ₂ = CovarianceForm(0, σ₂^2)\n\n# Construct the second resistor.\n#        [ I₁ ]\n# [R₂ 1] [ V₂ ] = ϵ₂ + V₀\nIV₂ = [R₂ 1] \\ (ϵ₂ + V₀)\n\n# The interconnected system solves the following equation:\n# [ 1 0 ]         [ I₁ ]\n# [ 0 1 ]         [ V₁ ]\n# [ 1 0 ] [ I ]   [ I₂ ]\n# [ 0 1 ] [ V ] = [ V₂ ]\nIV = [1 0; 0 1; 1 0; 0 1] \\ otimes(IV₁, IV₂)\n\n# The interconnected system corresponds to the following undirected wiring diagram.\n#       IV₁\n#      /   \\\n# --- I     V ---\n#      \\   /\n#       IV₂\ndiagram = @relation (I, V) begin\n    IV₁(I, V)\n    IV₂(I, V)\nend\n\n# We can also interconnect the systems by applying an operad algebra to the preceding\n# diagram.\nIV = oapply(diagram, Dict(:IV₁ =\u003e IV₁, :IV₂ =\u003e IV₂), Dict(:I =\u003e 1, :V =\u003e 1))\n\n# If a system is classical, access its parameters by calling the functions mean and cov.\nmean(IV)\ncov(IV)\n\n##################################################\n# Example 5: The Noisy Resistor With Constraints #\n##################################################\n\n# I₂ = 1 amp.\nI₂ = CovarianceForm(1, 0)\n\n# The constrained system solves the following equation:\n# [ 1 0 ]         [ I₁ ]\n# [ 0 1 ] [ I ]   [ V₁ ]\n# [ 1 0 ] [ V ] = [ I₂ ]\nIV = [1 0; 0 1; 1 0] \\ otimes(IV₁, I₂)\n\n# Marginalize over I by computing\n#           [ I ]\n# V = [0 1] [ V ]\nV = [0 1] * IV\n\n# The constrained system corresponds to the following undirected wiring diagram.\n#    IV₁\n#   /   \\\n#  I     V ---\n#   \\\n#    I₂\ndiagram = @relation (V,) begin\n    IV₁(I, V)\n    I₂(I)\nend\n\n# We can also constrain the system by applying an operad algebra to the preceding\n# diagram.\nV = oapply(diagram, Dict(:IV₁ =\u003e IV₁, :I₂ =\u003e I₂), Dict(:I =\u003e 1, :V =\u003e 1))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelsonric%2Fgaussianrelations.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelsonric%2Fgaussianrelations.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelsonric%2Fgaussianrelations.jl/lists"}