{
"info": {
"author": "Bill Engels",
"author_email": "w.j.engels@gmail.com",
"bugtrack_url": null,
"classifiers": [],
"description": "ccsnmultivar companion code\n===========================\n\nThis `Python `_ module aids the analysis of\ncore-collapse supernova gravitational waves. It is the companion code\nfor `this paper `_.\n\n- **Multivariate Regression** of Fourier Transformed or Time Domain\n waveforms\n- **Hypothesis testing** for measuring the influence of physical\n parameters\n- Optionally incorporate additional uncertainty due to detector noise\n- Approximate waveforms from anywhere within the parameter space\n- Includes the `Abdikamalov et. al. `_\n catalog for example use\n\nDetails\n-------\n\n- A simplified formula language (like in R, or patsy) specific to this\n domain\n- `Documentation `_\n\nInstallation\n------------\n\nMake sure that the python packages numpy, scipy, pandas, and patsy are\nalready installed. pip installer will install patsy, pandas and tabular\nif they aren't installed already.\n\n::\n\n cd /path/to/ccsnmultivar\n\n1. Download github zip file here\n2. Unzip\n\n\\`\\`\\`python # cd /CCSNMultivar-master\n\npython setup.py install \\`\\`\\` or\n\n::\n\n pip install ccsnmultivar\n\nIts a good idea to update often because the package is being changed\noften. To update, type\n\n::\n\n pip install -U ccsnmultivar\n\nBasic Walkthrough\n-----------------\n\nUsing the code happens in five steps:\n\n1. Instantiate a Catalog object\n2. Instantiate a Basis object.\n3. Instantiate a DesignMatrix object.\n4. Wrapping them in a Multivar object.\n5. Analysis using the Multivar object's methods.\n\n::\n\n # import code\n import ccsnmultivar as cc\n\n # load waveforms\n path_to_waveforms = \"/path/to/Abdika13_waveforms.csv\"\n # the Abdikamalov waveform file is called \"Abdika13_waveforms.csv\"\n\n # we want to analyze the waveforms in the time domain, so instantiate\n # a Catalog object with the transform_type arguement specified\n Y = cc.Catalog(path_to_waveforms,transform_type='time')\n\nNote that Abdikamalov et al's 2013 waveform catalog and parameter file\nare included in the Example\\_Waveforms directory of the GitHub repo as\nan example of how to format the raw files for input. To access these for\nthe walkthrough, look at the right side of the GitHub page, there is a\ntoolbar with a Download button. Download, then unzip. The directory\nExample\\_Waveforms isn't included when the package is installed using\npip.\n\nNow we need to make two objects, a Basis object and a DesignMatrix\nobject\n\nFirst we instantiate a Basis object. Currently, there are two available\ntypes of Basis objects, with more planned.\n\n1. PCA - using the Singular Value Decompostion (SVD)\n2. ICA - Independent Component Ananlysis. A wrapper for skearns\n `FastICA `_\n\n``python # use a PCA basis keeping the first 10 Principal Components pca = cc.PCA(num_components=10)``\nNext we instantiate a DesignMatrix object.\n\n::\n\n # first, define a formula string describing how the physical parameters\n # need to be translated to the design matrix. Say we only want to use\n # encodings of the parameters A and B (A is discrete, B is continuous)\n\n formula = \"A + beta + A*beta | Dum(A,ref=2), Poly(beta,degree=4)\"\n\nThe formula contains 5 peices of information that determine how the\ndesign matrix is encoded. Reading the formula from left to right:\n\n1. Include columns for the physical parameter named \"A\".\n2. Include columns for the physical parameter named \"beta\".\n3. Include columns for interaction terms between parameters \"A\" and\n \"beta\".\n The \"\\|\" character seperates instructions for *what* goes into the\n design matrix from *how* it goes in.\n4. Use a dummy variable encoding on parameter \"A\". One value of \"A\"\n needs to be used as a reference in a dummy variable encoding, we\n chose value \"2\".\n5. Use a Chebyshev polynomial encoding on parameter \"beta\". Fit \"beta\"\n with a 4th degree polynomial.\n\nNow we instantiate the DesignMatrix object with two arguments: the\nformula, and the path to the parameter file. \\`\\`\\`python\n\nnote that the provided Abdikamalov+ parameterfile is called \"Abdika13\\_params.csv\"\n==================================================================================\n\npath\\_to\\_parameterfile = \"/path/to/Abdika13\\_params.csv\"\n\nnote that we dont need to load the paramfile, just supply the path.\n===================================================================\n\nX = cc.DesignMatrix(path\\_to\\_parameterfile, formula) \\`\\`\\`\n\nNow with the waveforms in the Catalog object Y, the Basis object pca,\nand DesignMatrix object X on hand, we instantiate a Multivar object with\nthese three arguements.\n\n::\n\n # instantiate Multivar object\n M = cc.Multivar(Y,X, pca)\n\nThis makes it easy to create many different Catalog, DesignMatrix,\nBasis, and Multivar objects to test different fits and parameter\ninfluences very quickly.\n\n\\`\\`\\`python # now we do a fit to time domain waveforms (solve for B)\nM.fit()\n\nprint summary of the hypothesis tests, metadata, and other\n==========================================================\n\nfacts defined by the particular formula and basis used to make M.\n=================================================================\n\nM.summary()\n\nWaveform Domain time Number of Waveforms 92 Catalog Mean Subtracted?\nFalse Catalog Name Abdika13\\_waveforms.csv Normalization Factor\n2.45651978042e+20 Decomposition PCA num\\_components 10 ================\n================ =========== Comparison Hotellings T^2 p-value\n================ ================ =========== Intercept 1129.44\n1.11022e-16 A:[1 - 2] 87.9454 1.11022e-16 A:[3 - 2] 8.06119 5.49626e-08\nA:[4 - 2] 1.8598 0.0700502 A:[5 - 2] 0.823121 0.607991 beta^1 257.711\n1.11022e-16 beta^2 383.961 1.11022e-16 beta^3 93.1575 1.11022e-16 beta^4\n18.3438 1.55431e-14 A:[1 - 2]*beta^1 77.7596 1.11022e-16 A:[1 -\n2]*beta^2 14.0067 3.68272e-12 . . . . . . . . .\n\nwe can view the waveform reconstructions with the Multivar method .reconstruct()\n================================================================================\n\nY\\_reconstructed = M.reconstruct()\n\nand pull out the original catalog waveforms for comparison\n==========================================================\n\nY\\_original = M.get\\_waveforms()\n\nplot the last waveform in the array with its reconstruction (requires matplotlib)\n=================================================================================\n\nimport matplotlib.pyplot as plt\nplt.plot(Y\\_original[-1,8000:9000],label='original')\nplt.plot(Y\\_reconstructed[-1,8000:9000],label='reconstruction')\nplt.legend() \\`\\`\\` Using the Abdikamalov catalog, this is what you\nshould see:\n\n|alt tag| \\`\\`\\`python # look at a summary of the overlaps between the\nwaveforms and their reconstructions M.overlap\\_summary()\n\n============ ============== Percentile Overlap ============\n============== 5%: 0.64866522524 25%: 0.809185728124 50%: 0.879262580569\n75%: 0.949587383571 95%: 0.97311500202\n\nMin: 0.518678320514 Mean: 0.858585006085 Max: 0.98214781409 ============\n==============\n\n\\`\\`\\` One of the main goals of this method is to predict new waveforms,\ngiven a set of physical parameters that wasn't originally used in the\ncatalog. For instance:\n\n::\n\n # make a dictionary of the new parameters\n new_parameters = {}\n # quickly generate two waveforms, one with A = 1, beta = .1, another with \n # A = 3, beta = 0.05 (using the abdikamalov example)\n new_parameters['A'] = [str(1), str(3)]\n new_parameters['beta'] = [.1, .05]\n\n # use the predict method of the multivar object\n Y_new = M.predict(new_parameters)\n\n # plot the two waveform predictions (requires matplotlib)\n import matplotlib.pyplot as plt\n plt.plot(Y_new[0,8000:9000],label='A = 1, beta = .1')\n plt.plot(Y_new[1,8000:9000],label='A = 3, beta = .05')\n plt.legend()\n\nWith the Abdikamalov catalog, this is what you should see:\n\n.. figure:: Example_Catalogs/example_prediction.png\n :align: center\n :alt: alt tag\n\n alt tag\nThis allows one to rapidly interpolate the parameter space for\ncore-collapse waveforms\n\nDependencies\n------------\n\n- numpy\n- scipy\n- scikits-learn\n- tabulate\n\nPlanned\n-------\n\n- Hotellings T2 with more than one GW detector\n- Catalog objects\n- amplitude/phase decomposition, spectrograms\n- other PC basis methods\n- sparse basis decompositions, kmeans, etc.\n- other design matrix fitting methods\n- splines, rbfs, etc.\n- different types of crossvalidation methods\n- Gaussian Process (or other interpolation/machine learning method)\n classes\n\n.. |alt tag| image:: Example_Catalogs/example_reconstruction.png",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/bwengals/CCSNMultivar/tarball/0.1",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/bwengals/CCSNMultivar",
"keywords": "multivariate,regression,core-collapse,supernova",
"license": "UNKNOWN",
"maintainer": null,
"maintainer_email": null,
"name": "ccsnmultivar",
"package_url": "https://pypi.org/project/ccsnmultivar/",
"platform": "any",
"project_url": "https://pypi.org/project/ccsnmultivar/",
"project_urls": {
"Download": "https://github.com/bwengals/CCSNMultivar/tarball/0.1",
"Homepage": "https://github.com/bwengals/CCSNMultivar"
},
"release_url": "https://pypi.org/project/ccsnmultivar/0.0.5/",
"requires_dist": null,
"requires_python": null,
"summary": "Multivariate regression analysis of core-collapse simulations",
"version": "0.0.5"
},
"last_serial": 1387427,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "58c28355a32fe4b938d8107309d4f8c9",
"sha256": "f3f5d4c86982cd1705bb758bc4de770c063306bcfea1fbeab4e437c4746481ee"
},
"downloads": -1,
"filename": "ccsnmultivar-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "58c28355a32fe4b938d8107309d4f8c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8201,
"upload_time": "2014-10-05T23:51:56",
"url": "https://files.pythonhosted.org/packages/47/fd/d0b530d5b3ceca946a570bbc59685db8c76dcc45e1d5a5be1cf1fcf4f2dc/ccsnmultivar-0.0.1.tar.gz"
}
],
"0.0.2": [
{
"comment_text": "",
"digests": {
"md5": "265e6aa3829ae88ca9d6fd0b6c9383eb",
"sha256": "f34f4bb4fc982eabacf1cf59068a1c86c9f0d845f7702fd989870847403fd9d8"
},
"downloads": -1,
"filename": "ccsnmultivar-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "265e6aa3829ae88ca9d6fd0b6c9383eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8249,
"upload_time": "2014-10-06T01:38:59",
"url": "https://files.pythonhosted.org/packages/22/e3/9d2052b4ecbb1a6c271ba519c89740ad0ef84d7775b4d2f02120662e55d8/ccsnmultivar-0.0.2.tar.gz"
}
],
"0.0.3": [
{
"comment_text": "",
"digests": {
"md5": "5afc9ea6c175d7c11bd6a82d3eb973cd",
"sha256": "ccbbc1aef6c20b480fb2b1e72279ff17e86b70a331eddb679eeba50458916ac8"
},
"downloads": -1,
"filename": "ccsnmultivar-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "5afc9ea6c175d7c11bd6a82d3eb973cd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11304,
"upload_time": "2014-10-10T07:19:55",
"url": "https://files.pythonhosted.org/packages/3b/05/8a04f1d488d6b5ea5b8274fa180b59cb476ce21ecc0a49d8f852587da34a/ccsnmultivar-0.0.3.tar.gz"
}
],
"0.0.4": [
{
"comment_text": "",
"digests": {
"md5": "a7531dc61e7e6eaa88fdd8b74e59e1ea",
"sha256": "bfb34d6e3fad1ccfe66625adcbc1d4ee02f330564ee3989e4403286191682512"
},
"downloads": -1,
"filename": "ccsnmultivar-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "a7531dc61e7e6eaa88fdd8b74e59e1ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19006,
"upload_time": "2014-10-23T04:23:33",
"url": "https://files.pythonhosted.org/packages/54/2f/ac17beaf077739e5f6a2f8f11a0ace3803c442db6485182bfedc1a41f9ab/ccsnmultivar-0.0.4.tar.gz"
}
],
"0.0.5": [
{
"comment_text": "",
"digests": {
"md5": "aac9d529a283fb94ca784d0fa82efc0d",
"sha256": "7e182b72b2053a3a9a21438cacbe86b83f78b7cea9b84d03850dabd4ff18b15a"
},
"downloads": -1,
"filename": "ccsnmultivar-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "aac9d529a283fb94ca784d0fa82efc0d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17801,
"upload_time": "2015-01-19T03:20:47",
"url": "https://files.pythonhosted.org/packages/1a/44/1014e573dba7b0dcf54659098ac4f0972aed9b723fd1a3cdec20a8801e50/ccsnmultivar-0.0.5.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "aac9d529a283fb94ca784d0fa82efc0d",
"sha256": "7e182b72b2053a3a9a21438cacbe86b83f78b7cea9b84d03850dabd4ff18b15a"
},
"downloads": -1,
"filename": "ccsnmultivar-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "aac9d529a283fb94ca784d0fa82efc0d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17801,
"upload_time": "2015-01-19T03:20:47",
"url": "https://files.pythonhosted.org/packages/1a/44/1014e573dba7b0dcf54659098ac4f0972aed9b723fd1a3cdec20a8801e50/ccsnmultivar-0.0.5.tar.gz"
}
]
}