{"id":15352218,"url":"https://github.com/xd-deng/sqrt-matrix","last_synced_at":"2025-04-11T18:11:28.427Z","repository":{"id":95966861,"uuid":"46203665","full_name":"XD-DENG/sqrt-matrix","owner":"XD-DENG","description":"How to compute the square root of a matrix with R and Python.","archived":false,"fork":false,"pushed_at":"2015-11-22T02:14:24.000Z","size":1587,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:06:37.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","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/XD-DENG.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}},"created_at":"2015-11-15T04:05:26.000Z","updated_at":"2022-10-04T05:57:34.000Z","dependencies_parsed_at":"2023-03-10T23:45:40.722Z","dependency_job_id":null,"html_url":"https://github.com/XD-DENG/sqrt-matrix","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/XD-DENG%2Fsqrt-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD-DENG%2Fsqrt-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD-DENG%2Fsqrt-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XD-DENG%2Fsqrt-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XD-DENG","download_url":"https://codeload.github.com/XD-DENG/sqrt-matrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456366,"owners_count":21106603,"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":[],"created_at":"2024-10-01T12:09:01.300Z","updated_at":"2025-04-11T18:11:28.403Z","avatar_url":"https://github.com/XD-DENG.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqrt-Matrix\nHow to compute the square root of matrix with R language and Python.\n\n\n\n## What have been done here\nIn this project, \n\n(1) I tried to optimize the existing R function \"sqrtm\" in R package \"expm\" with Rcpp.\n\n(2) Introduced how to compute the square root of matrix with the existing function in Python.\n\n(3) Implemented another two algorithms computing the square root of matrix, ***Babylonian method*** and ***Denman Beavers method*** with R language and Python separately.\n\n\n\n## Check \u0026 Compare\nI generated the code as below to compare the speed to compare the speed of these functions.\n\n    library(microbenchmark)\n    microbenchmark(sqrtm(test_dat), \n               Babylonian_sqrtm(test_dat), \n               DB_sqrtm(test_dat),\n               sqrtm_revised(test_dat), \n               times = 100)\n\n\nAnd the results are as below\n\n![\\[pic link\\]](http://me.seekingqed.com/image/sqrtm_compare_results.png)\n\nAfter optimzed with Rcpp, the *sqrtm* function is slower than the original *sqrtm* function which was written purely with R. This may due to the data I/O from R into C++ (my optimization was a combination of R and Rcpp).\n\nAnother finding is that the two iteration algorithms, Babylonian method and Denman Beavers Method are much faster. This may due to that *sqrtm* function considers more complicated inputs. \n\n(Updated on 15 November, 2015)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd-deng%2Fsqrt-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxd-deng%2Fsqrt-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd-deng%2Fsqrt-matrix/lists"}