ortho


Nameortho JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/ameli/ortho
SummaryGenerate orthogonal set of functions
upload_time2024-02-08 02:44:28
maintainer
docs_urlNone
authorSiavash Ameli
requires_python>=3.9
license
keywords orthogonal-functions regression sympy computer-algebragram-schmidt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            =====
ortho
=====

.. |image01| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/phi_i_perp.svg
.. |image02| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/phi_i.svg
.. |image03| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/interval.svg
.. |image04| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/w.svg
.. |image05| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/delta.svg
.. |image06| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/i_0.svg
.. |image07| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/n.svg
.. |image08| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/L.svg
.. |image09| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/alpha_i.svg
.. |image10| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/a_ij.svg
.. |image11| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/Equation_phi_i.svg
.. |image12| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/Equation_phi_i_perp.svg
.. |image13| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/Equation_orthogonality.svg

.. include_after_this_line

A python package to generate a set of orthogonal functions.

* `Documentation <https://ameli.github.io/ortho/index.html>`__
* `API Reference <https://ameli.github.io/ortho/api.html>`__
* `Github <https://ameli.github.io/ortho>`__

-----------
Description
-----------

This package generates a set of orthonormal functions, called |image01|, based on the set of non-orthonormal functions |image02| defined by the inverse-monomials

|image11|

The orthonormalized functions |image01| are the linear combination of the functions |image02| by

|image12|

The functions |image01| are orthonormal in the interval |image03| with respect to the weight function |image04|. That is,

|image13|

where |image05| is the Kronecker delta function. The orthogonal functions are generated by `Gram-Schmidt orthogonalization process <https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process>`__. This script produces the symbolic functions using `Sympy <https://www.sympy.org>`__, a Python computer algebraic package. An application of these orthogonal functions can be found in [1]_.

---------------------
Build and Test Status
---------------------

|codecov-devel| 

.. |y| unicode:: U+2714
.. |n| unicode:: U+2716

+----------+----------+-------+-------+-------+-------+-----------------+
| Platform | Arch     | Python Version                | Continuous      |
+          |          +-------+-------+-------+-------+ Integration     +
|          |          |  3.9  |  3.10 |  3.11 |  3.12 |                 |
+==========+==========+=======+=======+=======+=======+=================+
| Linux    | X86-64   |  |y|  |  |y|  |  |y|  |  |y|  | |build-linux|   |
+          +----------+-------+-------+-------+-------+                 +
|          | AARCH-64 |  |y|  |  |y|  |  |y|  |  |y|  |                 |
+----------+----------+-------+-------+-------+-------+-----------------+
| macOS    | X86-64   |  |y|  |  |y|  |  |y|  |  |y|  | |build-macos|   |
+          +----------+-------+-------+-------+-------+                 +
|          | ARM-64   |  |y|  |  |y|  |  |y|  |  |y|  |                 |
+----------+----------+-------+-------+-------+-------+-----------------+
| Windows  | X86-64   |  |y|  |  |y|  |  |y|  |  |y|  | |build-windows| |
+          +----------+-------+-------+-------+-------+                 +
|          | ARM-64   |  |y|  |  |y|  |  |y|  |  |y|  |                 |
+----------+----------+-------+-------+-------+-------+-----------------+

.. |build-linux| image:: https://img.shields.io/github/actions/workflow/status/ameli/ortho/build-linux.yml
   :target: https://github.com/ameli/ortho/actions?query=workflow%3Abuild-linux 
.. |build-macos| image:: https://img.shields.io/github/actions/workflow/status/ameli/ortho/build-macos.yml
   :target: https://github.com/ameli/ortho/actions?query=workflow%3Abuild-macos
.. |build-windows| image:: https://img.shields.io/github/actions/workflow/status/ameli/ortho/build-windows.yml
   :target: https://github.com/ameli/ortho/actions?query=workflow%3Abuild-windows

-------
Install
-------

Install using either of the following three methods.

~~~~~~~~~~~~~~~~~~~~
1. Install from PyPi
~~~~~~~~~~~~~~~~~~~~

|pypi| |pyversions| |format| 

Install using the package available on `PyPi <https://pypi.org/project/ortho>`__ by

::

  pip install ortho

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. Install from Anaconda Cloud
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|conda-version| |conda-platform|

Install using `Anaconda cloud <https://anaconda.org/s-ameli/traceinv>`__ by

::

    conda install -c s-ameli ortho

~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. Install from Source Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~

|release| |licence| |implementation|

Install directly from the source code by

::

  git clone https://github.com/ameli/ortho.git
  cd ortho
  pip install .

-------
Testing
-------

To test the package, download the source code and use one of the following methods in the directory of the source code:

- *Method 1*: test locally by:

  ::
      
      python setup.py test

- *Method 2*: test in a virtual environment using ``tox``:

  ::

      pip install tox
      tox

-----
Usage
-----

The package can be used in two ways:

~~~~~~~~~~~~~~~~~~~~~
1. Import as a Module
~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

    >>> from ortho import OrthogonalFunctions
    
    >>> # Generate object of orthogonal functions
    >>> OF = OrthogonalFunctions(
    ...        start_index=1,
    ...        num_func=9,
    ...        end_interval=1,
    ...        verbose=True)
    
    >>> # Get numeric coefficients alpha[i] and a[i][j]
    >>> alpha = OF.alpha
    >>> a = OF.coeffs

    >>> # Get symbolic coefficients alpha[i] and a[i][j]
    >>> sym_alpha = OF.sym_alpha
    >>> sym_a = OF.sym_coeffs

    >>> # Get symbolic functions phi[i]
    >>> sym_phi = OF.sym_phi
    
    >>> # Print Functions
    >>> OF.print()
    
    >>> # Check mutual orthogonality of Functions
    >>> status = OF.check(verbose=True)
    
    >>> # Plot Functions
    >>> OF.plot()

The parameters are:

- ``start_index``: the index of the starting function, |image06|. Default is ``1``.
- ``num_func``: number of orthogonal functions to generate, |image07|. Default is ``9``.
- ``end_interval``: the right interval of orthogonality, |image08|. Default is ``1``.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. Use As Standalone Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The standalone application can be executed in the terminal in two ways:

#. If you have installed the package, call ``ortho`` executable in terminal:

   ::

       ortho [options]

   The optional argument ``[options]`` will be explained in the next section. When the package *ortho* is installed, the executable ``ortho`` is located in the ``/bin`` directory of the python.

#. Without installing the package, the main script of the package can be executed directly from the source code by

   ::

       # Download the package
       git clone https://github.com/ameli/ortho.git

       # Go to the package source directory
       cd ortho

       # Execute the main script of the package
       python -m ortho [options]

~~~~~~~~~~~~~~~~~~
Optional arguments
~~~~~~~~~~~~~~~~~~

When the *standalone application* (the second method in the above) is called, the executable accepts some optional arguments as follows.

+--------------------------------------+------------------------------------------------------------------------------------------+
| Option                               | Description                                                                              |
+======================================+==========================================================================================+
| ``-h``, ``--help``                   | Prints a help message.                                                                   |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-v``, ``--version``                | Prints version.                                                                          |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-l``, ``--license``                | Prints author info, citation and license.                                                |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-n``, ``--num-func[=int]``         | Number of orthogonal functions to generate. Positive integer. Default is 9.              |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-s``, ``--start-func[=int]``       | Starting function index. Non-negative integer. Default is 1.                             |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-e``, ``--end-interval[=float]``   | End of the interval of functions domains. A real number greater than zero. Default is 1. |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-c``,\ ``--check``                 | Checks orthogonality of generated functions.                                             |
+--------------------------------------+------------------------------------------------------------------------------------------+
| ``-p``, ``--plot``                   | Plots generated functions, also saves the plot as pdf file in the current directory.     |
+--------------------------------------+------------------------------------------------------------------------------------------+

~~~~~~~~~~
Parameters
~~~~~~~~~~

The variables |image06|, |image07|, and |image08| can be set in the script by the following arguments,

+-------------+----------------------+---------------------------------+
| Variable    | Variable in script   | Option                          |
+=============+======================+=================================+
| |image06|   | ``start_index``      | ``-s``, or ``--start-func``     |
+-------------+----------------------+---------------------------------+
| |image07|   | ``num_func``         | ``-n``, or ``--num-func``       |
+-------------+----------------------+---------------------------------+
| |image08|   | ``end_interval``     | ``-e``, or ``--end-interval``   |
+-------------+----------------------+---------------------------------+

~~~~~~~~
Examples
~~~~~~~~

#. Generate nine orthogonal functions from index 1 to 9 (defaults)

   ::

        ortho

#. Generate eight orthogonal functions from index 1 to 8

   ::

        ortho -n 8

#. Generate nine orthogonal functions from index 0 to 8

   ::

        ortho -s 0

#. Generate nine orthogonal functions that are orthonormal in the interval [0,10]

   ::

        ortho -e 10

#. Check orthogonality of each two functions, plot the orthonormal functions and save the plot to pdf

   ::

        ortho -c -p

#. A complete example:

   ::

        ortho -n 9 -s 1 -e 1 -c -p

------
Output
------

-  Displays the orthogonal functions as computer algebraic symbolic functions. An example a set of generated functions is shown below.

::

    phi_1(t) =  sqrt(x)
    phi_2(t) =  sqrt(6)*(5*x**(1/3) - 6*sqrt(x))/3
    phi_3(t) =  sqrt(2)*(21*x**(1/4) - 40*x**(1/3) + 20*sqrt(x))/2
    phi_4(t) =  sqrt(10)*(84*x**(1/5) - 210*x**(1/4) + 175*x**(1/3) - 50*sqrt(x))/5
    phi_5(t) =  sqrt(3)*(330*x**(1/6) - 1008*x**(1/5) + 1134*x**(1/4) - 560*x**(1/3) + 105*sqrt(x))/3
    phi_6(t) =  sqrt(14)*(1287*x**(1/7) - 4620*x**(1/6) + 6468*x**(1/5) - 4410*x**(1/4) + 1470*x**(1/3) - 196*sqrt(x))/7
    phi_7(t) =  5005*x**(1/8)/2 - 10296*x**(1/7) + 17160*x**(1/6) - 14784*x**(1/5) + 6930*x**(1/4) - 1680*x**(1/3) + 168*sqrt(x)
    phi_8(t) =  sqrt(2)*(19448*x**(1/9) - 90090*x**(1/8) + 173745*x**(1/7) - 180180*x**(1/6) + 108108*x**(1/5) - 37422*x**(1/4) + 6930*x**(1/3) - 540*sqrt(x))/3
    phi_9(t) =  sqrt(5)*(75582*x**(1/10) - 388960*x**(1/9) + 850850*x**(1/8) - 1029600*x**(1/7) + 750750*x**(1/6) - 336336*x**(1/5) + 90090*x**(1/4) - 13200*x**(1/3) + 825*sqrt(x))/5

-  Displays readable coefficients, |image09| and |image10| of the functions. For instance,

::

      i      alpha_i                                    a_[ij]
    ------  ----------   -----------------------------------------------------------------------
    i = 1:  +sqrt(2/2)   [1                                                                    ]
    i = 2:  -sqrt(2/3)   [6,   -5                                                              ]
    i = 3:  +sqrt(2/4)   [20,  -40,    21                                                      ]
    i = 4:  -sqrt(2/5)   [50,  -175,   210,   -84                                              ]
    i = 5:  +sqrt(2/6)   [105, -560,   1134,  -1008,   330                                     ]
    i = 6:  -sqrt(2/7)   [196, -1470,  4410,  -6468,   4620,   -1287                           ]
    i = 7:  +sqrt(2/8)   [336, -3360,  13860, -29568,  34320,  -20592,   5005                  ]
    i = 8:  -sqrt(2/9)   [540, -6930,  37422, -108108, 180180, -173745,  90090,  -19448        ]
    i = 9:  +sqrt(2/10)  [825, -13200, 90090, -336336, 750750, -1029600, 850850, -388960, 75582]

-  Displays the matrix of the mutual inner product of functions to check orthogonality (using option ``-c``). An example of the generated matrix of the mutual inner product of functions is shown below.

::

    [[1 0 0 0 0 0 0 0 0]
     [0 1 0 0 0 0 0 0 0]
     [0 0 1 0 0 0 0 0 0]
     [0 0 0 1 0 0 0 0 0]
     [0 0 0 0 1 0 0 0 0]
     [0 0 0 0 0 1 0 0 0]
     [0 0 0 0 0 0 1 0 0]
     [0 0 0 0 0 0 0 1 0]
     [0 0 0 0 0 0 0 0 1]]

-  Plots the set of functions (using option ``-p``) and saves the plot in the current directory. An example of a generated plot is shown below.

.. image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/orthogonal_functions.svg
    :align: center

--------
Citation
--------

.. [1] Ameli, S., and Shadden. S. C. (2022). Interpolating Log-Determinant and Trace of the Powers of Matrix **A** + t **B**. *Statistics and Computing* 32, 108. |paper-doi| |paper-arxiv|
.. [2] Ameli, S. (2022). ameli/ortho: (v0.2.0). Zenodo. |code-doi|

.. |travis-devel| image:: https://img.shields.io/travis/com/ameli/ortho
   :target: https://travis-ci.com/github/ameli/ortho
.. |codecov-devel| image:: https://img.shields.io/codecov/c/github/ameli/ortho
   :target: https://codecov.io/gh/ameli/ortho
.. |licence| image:: https://img.shields.io/github/license/ameli/ortho
   :target: https://opensource.org/licenses/BSD-3-Clause
.. |travis-devel-linux| image:: https://img.shields.io/travis/com/ameli/ortho?env=BADGE=linux&label=build&branch=main
   :target: https://travis-ci.com/github/ameli/ortho
.. |travis-devel-osx| image:: https://img.shields.io/travis/com/ameli/ortho?env=BADGE=osx&label=build&branch=main
   :target: https://travis-ci.com/github/ameli/ortho
.. |travis-devel-windows| image:: https://img.shields.io/travis/com/ameli/ortho?env=BADGE=windows&label=build&branch=main
   :target: https://travis-ci.com/github/ameli/ortho
.. |implementation| image:: https://img.shields.io/pypi/implementation/ortho
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/ortho
.. |format| image:: https://img.shields.io/pypi/format/ortho
.. |pypi| image:: https://img.shields.io/pypi/v/ortho
.. |conda| image:: https://anaconda.org/s-ameli/ortho/badges/installer/conda.svg
   :target: https://anaconda.org/s-ameli/ortho
.. |platforms| image:: https://img.shields.io/conda/pn/s-ameli/ortho?color=orange?label=platforms
   :target: https://anaconda.org/s-ameli/ortho
.. |conda-version| image:: https://img.shields.io/conda/v/s-ameli/ortho
   :target: https://anaconda.org/s-ameli/ortho
.. |release| image:: https://img.shields.io/github/v/tag/ameli/ortho
   :target: https://github.com/ameli/ortho/releases/
.. |conda-platform| image:: https://anaconda.org/s-ameli/ortho/badges/platforms.svg
   :target: https://anaconda.org/s-ameli/ortho
.. |code-doi| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6395268.svg
   :target: https://doi.org/10.5281/zenodo.6395268
.. |paper-doi| image:: https://img.shields.io/badge/doi-10.1007%2Fs11222--022--10173--4-green
   :target: https://doi.org/10.1007/s11222-022-10173-4
.. |paper-arxiv| image:: https://img.shields.io/badge/arXiv-2009.07385 [math.NA]-%23B31B1B
   :target: https://doi.org/10.48550/arXiv.2009.07385

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ameli/ortho",
    "name": "ortho",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "orthogonal-functions regression sympy computer-algebragram-schmidt",
    "author": "Siavash Ameli",
    "author_email": "sameli@berkeley.edu",
    "download_url": "https://files.pythonhosted.org/packages/51/6c/d5f8cb5413dc1e789359e7173de07fd79da3dc8595895164e7bdc3fa03c1/ortho-0.4.1.tar.gz",
    "platform": "Linux",
    "description": "=====\northo\n=====\n\n.. |image01| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/phi_i_perp.svg\n.. |image02| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/phi_i.svg\n.. |image03| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/interval.svg\n.. |image04| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/w.svg\n.. |image05| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/delta.svg\n.. |image06| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/i_0.svg\n.. |image07| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/n.svg\n.. |image08| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/L.svg\n.. |image09| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/alpha_i.svg\n.. |image10| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/a_ij.svg\n.. |image11| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/Equation_phi_i.svg\n.. |image12| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/Equation_phi_i_perp.svg\n.. |image13| image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/Equation_orthogonality.svg\n\n.. include_after_this_line\n\nA python package to generate a set of orthogonal functions.\n\n* `Documentation <https://ameli.github.io/ortho/index.html>`__\n* `API Reference <https://ameli.github.io/ortho/api.html>`__\n* `Github <https://ameli.github.io/ortho>`__\n\n-----------\nDescription\n-----------\n\nThis package generates a set of orthonormal functions, called |image01|, based on the set of non-orthonormal functions |image02| defined by the inverse-monomials\n\n|image11|\n\nThe orthonormalized functions |image01| are the linear combination of the functions |image02| by\n\n|image12|\n\nThe functions |image01| are orthonormal in the interval |image03| with respect to the weight function |image04|. That is,\n\n|image13|\n\nwhere |image05| is the Kronecker delta function. The orthogonal functions are generated by `Gram-Schmidt orthogonalization process <https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process>`__. This script produces the symbolic functions using `Sympy <https://www.sympy.org>`__, a Python computer algebraic package. An application of these orthogonal functions can be found in [1]_.\n\n---------------------\nBuild and Test Status\n---------------------\n\n|codecov-devel| \n\n.. |y| unicode:: U+2714\n.. |n| unicode:: U+2716\n\n+----------+----------+-------+-------+-------+-------+-----------------+\n| Platform | Arch     | Python Version                | Continuous      |\n+          |          +-------+-------+-------+-------+ Integration     +\n|          |          |  3.9  |  3.10 |  3.11 |  3.12 |                 |\n+==========+==========+=======+=======+=======+=======+=================+\n| Linux    | X86-64   |  |y|  |  |y|  |  |y|  |  |y|  | |build-linux|   |\n+          +----------+-------+-------+-------+-------+                 +\n|          | AARCH-64 |  |y|  |  |y|  |  |y|  |  |y|  |                 |\n+----------+----------+-------+-------+-------+-------+-----------------+\n| macOS    | X86-64   |  |y|  |  |y|  |  |y|  |  |y|  | |build-macos|   |\n+          +----------+-------+-------+-------+-------+                 +\n|          | ARM-64   |  |y|  |  |y|  |  |y|  |  |y|  |                 |\n+----------+----------+-------+-------+-------+-------+-----------------+\n| Windows  | X86-64   |  |y|  |  |y|  |  |y|  |  |y|  | |build-windows| |\n+          +----------+-------+-------+-------+-------+                 +\n|          | ARM-64   |  |y|  |  |y|  |  |y|  |  |y|  |                 |\n+----------+----------+-------+-------+-------+-------+-----------------+\n\n.. |build-linux| image:: https://img.shields.io/github/actions/workflow/status/ameli/ortho/build-linux.yml\n   :target: https://github.com/ameli/ortho/actions?query=workflow%3Abuild-linux \n.. |build-macos| image:: https://img.shields.io/github/actions/workflow/status/ameli/ortho/build-macos.yml\n   :target: https://github.com/ameli/ortho/actions?query=workflow%3Abuild-macos\n.. |build-windows| image:: https://img.shields.io/github/actions/workflow/status/ameli/ortho/build-windows.yml\n   :target: https://github.com/ameli/ortho/actions?query=workflow%3Abuild-windows\n\n-------\nInstall\n-------\n\nInstall using either of the following three methods.\n\n~~~~~~~~~~~~~~~~~~~~\n1. Install from PyPi\n~~~~~~~~~~~~~~~~~~~~\n\n|pypi| |pyversions| |format| \n\nInstall using the package available on `PyPi <https://pypi.org/project/ortho>`__ by\n\n::\n\n  pip install ortho\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n2. Install from Anaconda Cloud\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n|conda-version| |conda-platform|\n\nInstall using `Anaconda cloud <https://anaconda.org/s-ameli/traceinv>`__ by\n\n::\n\n    conda install -c s-ameli ortho\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n3. Install from Source Code\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n|release| |licence| |implementation|\n\nInstall directly from the source code by\n\n::\n\n  git clone https://github.com/ameli/ortho.git\n  cd ortho\n  pip install .\n\n-------\nTesting\n-------\n\nTo test the package, download the source code and use one of the following methods in the directory of the source code:\n\n- *Method 1*: test locally by:\n\n  ::\n      \n      python setup.py test\n\n- *Method 2*: test in a virtual environment using ``tox``:\n\n  ::\n\n      pip install tox\n      tox\n\n-----\nUsage\n-----\n\nThe package can be used in two ways:\n\n~~~~~~~~~~~~~~~~~~~~~\n1. Import as a Module\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    >>> from ortho import OrthogonalFunctions\n    \n    >>> # Generate object of orthogonal functions\n    >>> OF = OrthogonalFunctions(\n    ...        start_index=1,\n    ...        num_func=9,\n    ...        end_interval=1,\n    ...        verbose=True)\n    \n    >>> # Get numeric coefficients alpha[i] and a[i][j]\n    >>> alpha = OF.alpha\n    >>> a = OF.coeffs\n\n    >>> # Get symbolic coefficients alpha[i] and a[i][j]\n    >>> sym_alpha = OF.sym_alpha\n    >>> sym_a = OF.sym_coeffs\n\n    >>> # Get symbolic functions phi[i]\n    >>> sym_phi = OF.sym_phi\n    \n    >>> # Print Functions\n    >>> OF.print()\n    \n    >>> # Check mutual orthogonality of Functions\n    >>> status = OF.check(verbose=True)\n    \n    >>> # Plot Functions\n    >>> OF.plot()\n\nThe parameters are:\n\n- ``start_index``: the index of the starting function, |image06|. Default is ``1``.\n- ``num_func``: number of orthogonal functions to generate, |image07|. Default is ``9``.\n- ``end_interval``: the right interval of orthogonality, |image08|. Default is ``1``.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n2. Use As Standalone Application\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe standalone application can be executed in the terminal in two ways:\n\n#. If you have installed the package, call ``ortho`` executable in terminal:\n\n   ::\n\n       ortho [options]\n\n   The optional argument ``[options]`` will be explained in the next section. When the package *ortho* is installed, the executable ``ortho`` is located in the ``/bin`` directory of the python.\n\n#. Without installing the package, the main script of the package can be executed directly from the source code by\n\n   ::\n\n       # Download the package\n       git clone https://github.com/ameli/ortho.git\n\n       # Go to the package source directory\n       cd ortho\n\n       # Execute the main script of the package\n       python -m ortho [options]\n\n~~~~~~~~~~~~~~~~~~\nOptional arguments\n~~~~~~~~~~~~~~~~~~\n\nWhen the *standalone application* (the second method in the above) is called, the executable accepts some optional arguments as follows.\n\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| Option                               | Description                                                                              |\n+======================================+==========================================================================================+\n| ``-h``, ``--help``                   | Prints a help message.                                                                   |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-v``, ``--version``                | Prints version.                                                                          |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-l``, ``--license``                | Prints author info, citation and license.                                                |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-n``, ``--num-func[=int]``         | Number of orthogonal functions to generate. Positive integer. Default is 9.              |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-s``, ``--start-func[=int]``       | Starting function index. Non-negative integer. Default is 1.                             |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-e``, ``--end-interval[=float]``   | End of the interval of functions domains. A real number greater than zero. Default is 1. |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-c``,\\ ``--check``                 | Checks orthogonality of generated functions.                                             |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n| ``-p``, ``--plot``                   | Plots generated functions, also saves the plot as pdf file in the current directory.     |\n+--------------------------------------+------------------------------------------------------------------------------------------+\n\n~~~~~~~~~~\nParameters\n~~~~~~~~~~\n\nThe variables |image06|, |image07|, and |image08| can be set in the script by the following arguments,\n\n+-------------+----------------------+---------------------------------+\n| Variable    | Variable in script   | Option                          |\n+=============+======================+=================================+\n| |image06|   | ``start_index``      | ``-s``, or ``--start-func``     |\n+-------------+----------------------+---------------------------------+\n| |image07|   | ``num_func``         | ``-n``, or ``--num-func``       |\n+-------------+----------------------+---------------------------------+\n| |image08|   | ``end_interval``     | ``-e``, or ``--end-interval``   |\n+-------------+----------------------+---------------------------------+\n\n~~~~~~~~\nExamples\n~~~~~~~~\n\n#. Generate nine orthogonal functions from index 1 to 9 (defaults)\n\n   ::\n\n        ortho\n\n#. Generate eight orthogonal functions from index 1 to 8\n\n   ::\n\n        ortho -n 8\n\n#. Generate nine orthogonal functions from index 0 to 8\n\n   ::\n\n        ortho -s 0\n\n#. Generate nine orthogonal functions that are orthonormal in the interval [0,10]\n\n   ::\n\n        ortho -e 10\n\n#. Check orthogonality of each two functions, plot the orthonormal functions and save the plot to pdf\n\n   ::\n\n        ortho -c -p\n\n#. A complete example:\n\n   ::\n\n        ortho -n 9 -s 1 -e 1 -c -p\n\n------\nOutput\n------\n\n-  Displays the orthogonal functions as computer algebraic symbolic functions. An example a set of generated functions is shown below.\n\n::\n\n    phi_1(t) =  sqrt(x)\n    phi_2(t) =  sqrt(6)*(5*x**(1/3) - 6*sqrt(x))/3\n    phi_3(t) =  sqrt(2)*(21*x**(1/4) - 40*x**(1/3) + 20*sqrt(x))/2\n    phi_4(t) =  sqrt(10)*(84*x**(1/5) - 210*x**(1/4) + 175*x**(1/3) - 50*sqrt(x))/5\n    phi_5(t) =  sqrt(3)*(330*x**(1/6) - 1008*x**(1/5) + 1134*x**(1/4) - 560*x**(1/3) + 105*sqrt(x))/3\n    phi_6(t) =  sqrt(14)*(1287*x**(1/7) - 4620*x**(1/6) + 6468*x**(1/5) - 4410*x**(1/4) + 1470*x**(1/3) - 196*sqrt(x))/7\n    phi_7(t) =  5005*x**(1/8)/2 - 10296*x**(1/7) + 17160*x**(1/6) - 14784*x**(1/5) + 6930*x**(1/4) - 1680*x**(1/3) + 168*sqrt(x)\n    phi_8(t) =  sqrt(2)*(19448*x**(1/9) - 90090*x**(1/8) + 173745*x**(1/7) - 180180*x**(1/6) + 108108*x**(1/5) - 37422*x**(1/4) + 6930*x**(1/3) - 540*sqrt(x))/3\n    phi_9(t) =  sqrt(5)*(75582*x**(1/10) - 388960*x**(1/9) + 850850*x**(1/8) - 1029600*x**(1/7) + 750750*x**(1/6) - 336336*x**(1/5) + 90090*x**(1/4) - 13200*x**(1/3) + 825*sqrt(x))/5\n\n-  Displays readable coefficients, |image09| and |image10| of the functions. For instance,\n\n::\n\n      i      alpha_i                                    a_[ij]\n    ------  ----------   -----------------------------------------------------------------------\n    i = 1:  +sqrt(2/2)   [1                                                                    ]\n    i = 2:  -sqrt(2/3)   [6,   -5                                                              ]\n    i = 3:  +sqrt(2/4)   [20,  -40,    21                                                      ]\n    i = 4:  -sqrt(2/5)   [50,  -175,   210,   -84                                              ]\n    i = 5:  +sqrt(2/6)   [105, -560,   1134,  -1008,   330                                     ]\n    i = 6:  -sqrt(2/7)   [196, -1470,  4410,  -6468,   4620,   -1287                           ]\n    i = 7:  +sqrt(2/8)   [336, -3360,  13860, -29568,  34320,  -20592,   5005                  ]\n    i = 8:  -sqrt(2/9)   [540, -6930,  37422, -108108, 180180, -173745,  90090,  -19448        ]\n    i = 9:  +sqrt(2/10)  [825, -13200, 90090, -336336, 750750, -1029600, 850850, -388960, 75582]\n\n-  Displays the matrix of the mutual inner product of functions to check orthogonality (using option ``-c``). An example of the generated matrix of the mutual inner product of functions is shown below.\n\n::\n\n    [[1 0 0 0 0 0 0 0 0]\n     [0 1 0 0 0 0 0 0 0]\n     [0 0 1 0 0 0 0 0 0]\n     [0 0 0 1 0 0 0 0 0]\n     [0 0 0 0 1 0 0 0 0]\n     [0 0 0 0 0 1 0 0 0]\n     [0 0 0 0 0 0 1 0 0]\n     [0 0 0 0 0 0 0 1 0]\n     [0 0 0 0 0 0 0 0 1]]\n\n-  Plots the set of functions (using option ``-p``) and saves the plot in the current directory. An example of a generated plot is shown below.\n\n.. image:: https://raw.githubusercontent.com/ameli/ortho/main/docs/source/images/orthogonal_functions.svg\n    :align: center\n\n--------\nCitation\n--------\n\n.. [1] Ameli, S., and Shadden. S. C. (2022). Interpolating Log-Determinant and Trace of the Powers of Matrix **A** + t **B**. *Statistics and Computing* 32, 108. |paper-doi| |paper-arxiv|\n.. [2] Ameli, S. (2022). ameli/ortho: (v0.2.0). Zenodo. |code-doi|\n\n.. |travis-devel| image:: https://img.shields.io/travis/com/ameli/ortho\n   :target: https://travis-ci.com/github/ameli/ortho\n.. |codecov-devel| image:: https://img.shields.io/codecov/c/github/ameli/ortho\n   :target: https://codecov.io/gh/ameli/ortho\n.. |licence| image:: https://img.shields.io/github/license/ameli/ortho\n   :target: https://opensource.org/licenses/BSD-3-Clause\n.. |travis-devel-linux| image:: https://img.shields.io/travis/com/ameli/ortho?env=BADGE=linux&label=build&branch=main\n   :target: https://travis-ci.com/github/ameli/ortho\n.. |travis-devel-osx| image:: https://img.shields.io/travis/com/ameli/ortho?env=BADGE=osx&label=build&branch=main\n   :target: https://travis-ci.com/github/ameli/ortho\n.. |travis-devel-windows| image:: https://img.shields.io/travis/com/ameli/ortho?env=BADGE=windows&label=build&branch=main\n   :target: https://travis-ci.com/github/ameli/ortho\n.. |implementation| image:: https://img.shields.io/pypi/implementation/ortho\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/ortho\n.. |format| image:: https://img.shields.io/pypi/format/ortho\n.. |pypi| image:: https://img.shields.io/pypi/v/ortho\n.. |conda| image:: https://anaconda.org/s-ameli/ortho/badges/installer/conda.svg\n   :target: https://anaconda.org/s-ameli/ortho\n.. |platforms| image:: https://img.shields.io/conda/pn/s-ameli/ortho?color=orange?label=platforms\n   :target: https://anaconda.org/s-ameli/ortho\n.. |conda-version| image:: https://img.shields.io/conda/v/s-ameli/ortho\n   :target: https://anaconda.org/s-ameli/ortho\n.. |release| image:: https://img.shields.io/github/v/tag/ameli/ortho\n   :target: https://github.com/ameli/ortho/releases/\n.. |conda-platform| image:: https://anaconda.org/s-ameli/ortho/badges/platforms.svg\n   :target: https://anaconda.org/s-ameli/ortho\n.. |code-doi| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6395268.svg\n   :target: https://doi.org/10.5281/zenodo.6395268\n.. |paper-doi| image:: https://img.shields.io/badge/doi-10.1007%2Fs11222--022--10173--4-green\n   :target: https://doi.org/10.1007/s11222-022-10173-4\n.. |paper-arxiv| image:: https://img.shields.io/badge/arXiv-2009.07385 [math.NA]-%23B31B1B\n   :target: https://doi.org/10.48550/arXiv.2009.07385\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Generate orthogonal set of functions",
    "version": "0.4.1",
    "project_urls": {
        "Documentation": "https://github.com/ameli/ortho/blob/main/README.rst",
        "Download": "https://github.com/ameli/ortho/archive/main.zip",
        "Homepage": "https://github.com/ameli/ortho",
        "Source": "https://github.com/ameli/ortho",
        "Tracker": "https://github.com/ameli/ortho/issues"
    },
    "split_keywords": [
        "orthogonal-functions",
        "regression",
        "sympy",
        "computer-algebragram-schmidt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "973ce9bec8caeaed5720b876850697763028464a764c70834801c1dc415b3b89",
                "md5": "f14fb974e9891a63158ffbd8db81e4e4",
                "sha256": "36356051f7fe8cabc6dcfc4bcccfec973c0a106cb6dc913119104841324795b2"
            },
            "downloads": -1,
            "filename": "ortho-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f14fb974e9891a63158ffbd8db81e4e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 24374,
            "upload_time": "2024-02-08T02:44:26",
            "upload_time_iso_8601": "2024-02-08T02:44:26.301166Z",
            "url": "https://files.pythonhosted.org/packages/97/3c/e9bec8caeaed5720b876850697763028464a764c70834801c1dc415b3b89/ortho-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "516cd5f8cb5413dc1e789359e7173de07fd79da3dc8595895164e7bdc3fa03c1",
                "md5": "52c1434c50f8900cd6d482ef69a46d46",
                "sha256": "cb4b9b327771e5cf9a54ec13d74f3a551d8a28523d5c169a6335a61c634e8987"
            },
            "downloads": -1,
            "filename": "ortho-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "52c1434c50f8900cd6d482ef69a46d46",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 25198,
            "upload_time": "2024-02-08T02:44:28",
            "upload_time_iso_8601": "2024-02-08T02:44:28.286294Z",
            "url": "https://files.pythonhosted.org/packages/51/6c/d5f8cb5413dc1e789359e7173de07fd79da3dc8595895164e7bdc3fa03c1/ortho-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-08 02:44:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ameli",
    "github_project": "ortho",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "ortho"
}
        
Elapsed time: 0.64449s