{"action":"opened","number":6,"pull_request":{"url":"https://api.github.com/repos/keyinst/keypy/pulls/6","id":197930868,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3OTMwODY4","html_url":"https://github.com/keyinst/keypy/pull/6","diff_url":"https://github.com/keyinst/keypy/pull/6.diff","patch_url":"https://github.com/keyinst/keypy/pull/6.patch","issue_url":"https://api.github.com/repos/keyinst/keypy/issues/6","number":6,"state":"open","locked":false,"title":"Update parameters.py","user":{"login":"reinoudmaex","id":15646625,"node_id":"MDQ6VXNlcjE1NjQ2NjI1","avatar_url":"https://avatars0.githubusercontent.com/u/15646625?v=4","gravatar_id":"","url":"https://api.github.com/users/reinoudmaex","html_url":"https://github.com/reinoudmaex","followers_url":"https://api.github.com/users/reinoudmaex/followers","following_url":"https://api.github.com/users/reinoudmaex/following{/other_user}","gists_url":"https://api.github.com/users/reinoudmaex/gists{/gist_id}","starred_url":"https://api.github.com/users/reinoudmaex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinoudmaex/subscriptions","organizations_url":"https://api.github.com/users/reinoudmaex/orgs","repos_url":"https://api.github.com/users/reinoudmaex/repos","events_url":"https://api.github.com/users/reinoudmaex/events{/privacy}","received_events_url":"https://api.github.com/users/reinoudmaex/received_events","type":"User","site_admin":false},"body":"In my opinion, the current KeyPy code calculates the explained standard deviation, not the explained variance.\r\nIn agreement with formulas 10-12 of Pascual-Marqui's 1995 IEEE paper, the projection of the momentous map on the model map (which in KeyPy is calculated as the dot product in line 293) should be squared, and divided by the variance (not std). The same changes should be made in modelmaps.py.\r\n\r\nHere is a simple test program with 3 channels, one model map, and one time-frame.\r\nKeyPy gives 0.5 for the explained variance, which probably should be 0.25.\r\n\r\nimport numpy as np\r\nfrom math import sqrt\r\n\r\nnch = 3\r\na = sqrt (2);\r\nmodel = ([-a,0,a])\r\nb=np.sum(np.abs(model)**2,axis=-1)**(1./2)\r\nfor col in range(nch):\r\n     model[col]=model[col]/b\r\n\r\norg_data = ([0,-a,a])\r\ncovm_all=np.dot(org_data,model)\r\nloading_all=covm_all\r\nb_loading_all=(1.0*loading_all)/sqrt(nch)\r\neeg = org_data\r\nexp_var_tot=(b_loading_all*b_loading_all)/np.var(eeg)\r\n\r\nprint (exp_var_tot)","created_at":"2018-06-28T06:40:50Z","updated_at":"2018-06-28T06:40:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keyinst/keypy/pulls/6/commits","review_comments_url":"https://api.github.com/repos/keyinst/keypy/pulls/6/comments","review_comment_url":"https://api.github.com/repos/keyinst/keypy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keyinst/keypy/issues/6/comments","statuses_url":"https://api.github.com/repos/keyinst/keypy/statuses/ef0b945d1a51daaa33fa0f8af5539c20b8314094","head":{"label":"reinoudmaex:master","ref":"master","sha":"ef0b945d1a51daaa33fa0f8af5539c20b8314094","user":{"login":"reinoudmaex","id":15646625,"node_id":"MDQ6VXNlcjE1NjQ2NjI1","avatar_url":"https://avatars0.githubusercontent.com/u/15646625?v=4","gravatar_id":"","url":"https://api.github.com/users/reinoudmaex","html_url":"https://github.com/reinoudmaex","followers_url":"https://api.github.com/users/reinoudmaex/followers","following_url":"https://api.github.com/users/reinoudmaex/following{/other_user}","gists_url":"https://api.github.com/users/reinoudmaex/gists{/gist_id}","starred_url":"https://api.github.com/users/reinoudmaex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinoudmaex/subscriptions","organizations_url":"https://api.github.com/users/reinoudmaex/orgs","repos_url":"https://api.github.com/users/reinoudmaex/repos","events_url":"https://api.github.com/users/reinoudmaex/events{/privacy}","received_events_url":"https://api.github.com/users/reinoudmaex/received_events","type":"User","site_admin":false},"repo":{"id":138973625,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5NzM2MjU=","name":"keypy","full_name":"reinoudmaex/keypy","owner":{"login":"reinoudmaex","id":15646625,"node_id":"MDQ6VXNlcjE1NjQ2NjI1","avatar_url":"https://avatars0.githubusercontent.com/u/15646625?v=4","gravatar_id":"","url":"https://api.github.com/users/reinoudmaex","html_url":"https://github.com/reinoudmaex","followers_url":"https://api.github.com/users/reinoudmaex/followers","following_url":"https://api.github.com/users/reinoudmaex/following{/other_user}","gists_url":"https://api.github.com/users/reinoudmaex/gists{/gist_id}","starred_url":"https://api.github.com/users/reinoudmaex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinoudmaex/subscriptions","organizations_url":"https://api.github.com/users/reinoudmaex/orgs","repos_url":"https://api.github.com/users/reinoudmaex/repos","events_url":"https://api.github.com/users/reinoudmaex/events{/privacy}","received_events_url":"https://api.github.com/users/reinoudmaex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reinoudmaex/keypy","description":"Python library for EEG preprocessing, analysis (microstates, spectra) and statistics","fork":true,"url":"https://api.github.com/repos/reinoudmaex/keypy","forks_url":"https://api.github.com/repos/reinoudmaex/keypy/forks","keys_url":"https://api.github.com/repos/reinoudmaex/keypy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reinoudmaex/keypy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reinoudmaex/keypy/teams","hooks_url":"https://api.github.com/repos/reinoudmaex/keypy/hooks","issue_events_url":"https://api.github.com/repos/reinoudmaex/keypy/issues/events{/number}","events_url":"https://api.github.com/repos/reinoudmaex/keypy/events","assignees_url":"https://api.github.com/repos/reinoudmaex/keypy/assignees{/user}","branches_url":"https://api.github.com/repos/reinoudmaex/keypy/branches{/branch}","tags_url":"https://api.github.com/repos/reinoudmaex/keypy/tags","blobs_url":"https://api.github.com/repos/reinoudmaex/keypy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reinoudmaex/keypy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reinoudmaex/keypy/git/refs{/sha}","trees_url":"https://api.github.com/repos/reinoudmaex/keypy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reinoudmaex/keypy/statuses/{sha}","languages_url":"https://api.github.com/repos/reinoudmaex/keypy/languages","stargazers_url":"https://api.github.com/repos/reinoudmaex/keypy/stargazers","contributors_url":"https://api.github.com/repos/reinoudmaex/keypy/contributors","subscribers_url":"https://api.github.com/repos/reinoudmaex/keypy/subscribers","subscription_url":"https://api.github.com/repos/reinoudmaex/keypy/subscription","commits_url":"https://api.github.com/repos/reinoudmaex/keypy/commits{/sha}","git_commits_url":"https://api.github.com/repos/reinoudmaex/keypy/git/commits{/sha}","comments_url":"https://api.github.com/repos/reinoudmaex/keypy/comments{/number}","issue_comment_url":"https://api.github.com/repos/reinoudmaex/keypy/issues/comments{/number}","contents_url":"https://api.github.com/repos/reinoudmaex/keypy/contents/{+path}","compare_url":"https://api.github.com/repos/reinoudmaex/keypy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reinoudmaex/keypy/merges","archive_url":"https://api.github.com/repos/reinoudmaex/keypy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reinoudmaex/keypy/downloads","issues_url":"https://api.github.com/repos/reinoudmaex/keypy/issues{/number}","pulls_url":"https://api.github.com/repos/reinoudmaex/keypy/pulls{/number}","milestones_url":"https://api.github.com/repos/reinoudmaex/keypy/milestones{/number}","notifications_url":"https://api.github.com/repos/reinoudmaex/keypy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reinoudmaex/keypy/labels{/name}","releases_url":"https://api.github.com/repos/reinoudmaex/keypy/releases{/id}","deployments_url":"https://api.github.com/repos/reinoudmaex/keypy/deployments","created_at":"2018-06-28T06:05:54Z","updated_at":"2018-06-28T06:39:03Z","pushed_at":"2018-06-28T06:39:02Z","git_url":"git://github.com/reinoudmaex/keypy.git","ssh_url":"git@github.com:reinoudmaex/keypy.git","clone_url":"https://github.com/reinoudmaex/keypy.git","svn_url":"https://github.com/reinoudmaex/keypy","homepage":null,"size":64165,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"keyinst:master","ref":"master","sha":"1a1e7e273e9473aa64bd54a00d9407e6d095d049","user":{"login":"keyinst","id":13603879,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjAzODc5","avatar_url":"https://avatars0.githubusercontent.com/u/13603879?v=4","gravatar_id":"","url":"https://api.github.com/users/keyinst","html_url":"https://github.com/keyinst","followers_url":"https://api.github.com/users/keyinst/followers","following_url":"https://api.github.com/users/keyinst/following{/other_user}","gists_url":"https://api.github.com/users/keyinst/gists{/gist_id}","starred_url":"https://api.github.com/users/keyinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keyinst/subscriptions","organizations_url":"https://api.github.com/users/keyinst/orgs","repos_url":"https://api.github.com/users/keyinst/repos","events_url":"https://api.github.com/users/keyinst/events{/privacy}","received_events_url":"https://api.github.com/users/keyinst/received_events","type":"Organization","site_admin":false},"repo":{"id":40057875,"node_id":"MDEwOlJlcG9zaXRvcnk0MDA1Nzg3NQ==","name":"keypy","full_name":"keyinst/keypy","owner":{"login":"keyinst","id":13603879,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjAzODc5","avatar_url":"https://avatars0.githubusercontent.com/u/13603879?v=4","gravatar_id":"","url":"https://api.github.com/users/keyinst","html_url":"https://github.com/keyinst","followers_url":"https://api.github.com/users/keyinst/followers","following_url":"https://api.github.com/users/keyinst/following{/other_user}","gists_url":"https://api.github.com/users/keyinst/gists{/gist_id}","starred_url":"https://api.github.com/users/keyinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keyinst/subscriptions","organizations_url":"https://api.github.com/users/keyinst/orgs","repos_url":"https://api.github.com/users/keyinst/repos","events_url":"https://api.github.com/users/keyinst/events{/privacy}","received_events_url":"https://api.github.com/users/keyinst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keyinst/keypy","description":"Python library for EEG preprocessing, analysis (microstates, spectra) and statistics","fork":false,"url":"https://api.github.com/repos/keyinst/keypy","forks_url":"https://api.github.com/repos/keyinst/keypy/forks","keys_url":"https://api.github.com/repos/keyinst/keypy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keyinst/keypy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keyinst/keypy/teams","hooks_url":"https://api.github.com/repos/keyinst/keypy/hooks","issue_events_url":"https://api.github.com/repos/keyinst/keypy/issues/events{/number}","events_url":"https://api.github.com/repos/keyinst/keypy/events","assignees_url":"https://api.github.com/repos/keyinst/keypy/assignees{/user}","branches_url":"https://api.github.com/repos/keyinst/keypy/branches{/branch}","tags_url":"https://api.github.com/repos/keyinst/keypy/tags","blobs_url":"https://api.github.com/repos/keyinst/keypy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keyinst/keypy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keyinst/keypy/git/refs{/sha}","trees_url":"https://api.github.com/repos/keyinst/keypy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keyinst/keypy/statuses/{sha}","languages_url":"https://api.github.com/repos/keyinst/keypy/languages","stargazers_url":"https://api.github.com/repos/keyinst/keypy/stargazers","contributors_url":"https://api.github.com/repos/keyinst/keypy/contributors","subscribers_url":"https://api.github.com/repos/keyinst/keypy/subscribers","subscription_url":"https://api.github.com/repos/keyinst/keypy/subscription","commits_url":"https://api.github.com/repos/keyinst/keypy/commits{/sha}","git_commits_url":"https://api.github.com/repos/keyinst/keypy/git/commits{/sha}","comments_url":"https://api.github.com/repos/keyinst/keypy/comments{/number}","issue_comment_url":"https://api.github.com/repos/keyinst/keypy/issues/comments{/number}","contents_url":"https://api.github.com/repos/keyinst/keypy/contents/{+path}","compare_url":"https://api.github.com/repos/keyinst/keypy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keyinst/keypy/merges","archive_url":"https://api.github.com/repos/keyinst/keypy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keyinst/keypy/downloads","issues_url":"https://api.github.com/repos/keyinst/keypy/issues{/number}","pulls_url":"https://api.github.com/repos/keyinst/keypy/pulls{/number}","milestones_url":"https://api.github.com/repos/keyinst/keypy/milestones{/number}","notifications_url":"https://api.github.com/repos/keyinst/keypy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keyinst/keypy/labels{/name}","releases_url":"https://api.github.com/repos/keyinst/keypy/releases{/id}","deployments_url":"https://api.github.com/repos/keyinst/keypy/deployments","created_at":"2015-08-01T19:35:06Z","updated_at":"2018-06-09T10:53:44Z","pushed_at":"2018-04-11T12:21:19Z","git_url":"git://github.com/keyinst/keypy.git","ssh_url":"git@github.com:keyinst/keypy.git","clone_url":"https://github.com/keyinst/keypy.git","svn_url":"https://github.com/keyinst/keypy","homepage":null,"size":64165,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6,"open_issues":4,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keyinst/keypy/pulls/6"},"html":{"href":"https://github.com/keyinst/keypy/pull/6"},"issue":{"href":"https://api.github.com/repos/keyinst/keypy/issues/6"},"comments":{"href":"https://api.github.com/repos/keyinst/keypy/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/keyinst/keypy/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/keyinst/keypy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keyinst/keypy/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/keyinst/keypy/statuses/ef0b945d1a51daaa33fa0f8af5539c20b8314094"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":17,"deletions":5,"changed_files":1}}
{"actor":{"display_login":"reinoudmaex"}}