{"id":18548130,"url":"https://github.com/laszlokorte/random-variable","last_synced_at":"2025-07-19T08:34:04.634Z","repository":{"id":141234366,"uuid":"448989933","full_name":"laszlokorte/random-variable","owner":"laszlokorte","description":"An interactive example of a function applied to a random variable showing the resulting distribution.","archived":false,"fork":false,"pushed_at":"2022-04-03T14:00:10.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T08:11:48.236Z","etag":null,"topics":["random-variables","statistics"],"latest_commit_sha":null,"homepage":"https://tools.laszlokorte.de","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laszlokorte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-17T17:38:24.000Z","updated_at":"2022-01-17T17:43:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"c65d3f18-d853-4f6d-80f9-926525bbc2ad","html_url":"https://github.com/laszlokorte/random-variable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/laszlokorte/random-variable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laszlokorte%2Frandom-variable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laszlokorte%2Frandom-variable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laszlokorte%2Frandom-variable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laszlokorte%2Frandom-variable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laszlokorte","download_url":"https://codeload.github.com/laszlokorte/random-variable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laszlokorte%2Frandom-variable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265905116,"owners_count":23846696,"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":["random-variables","statistics"],"created_at":"2024-11-06T20:33:12.196Z","updated_at":"2025-07-19T08:34:04.606Z","avatar_url":"https://github.com/laszlokorte.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Screenshot of the app](preview.png)\n\n[Live Demo](https://static.laszlokorte.de/random-variable/) | [Short demo video](https://www.youtube.com/watch?v=UGjjtJiGywk)\n\n# Function applied to random variables\n\nApplying a function to a random variable affects the resulting distribution. The colored rectangles represent the density of the random variable along the X axis. You can see how squaring the variable shifts all rectangles into the positive range. Each colored rectangles keeps its area but is stretched along the X axis by 2*x (the derivative of x2). Accordingly the height of each rectangle is compressed by 2*x to keep the area constant.\n\nAs x^2 is not injective multiple rectangles end up at the same target along the x axis. They simply stack on top of each other to represent the resulting probability density at each location.\n\nClicking on a single rectangle highlights its corresponding partner rectangle in the other distribution.\n\nLowering the number of bins makes the individual rectangles more recognizable but reduces the precision of the probability density.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaszlokorte%2Frandom-variable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaszlokorte%2Frandom-variable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaszlokorte%2Frandom-variable/lists"}