eztaox.kernel_stat2
===================

.. py:module:: eztaox.kernel_stat2

.. autoapi-nested-parse::

   Second-Order statistic functions for kernels in kernels.quasisep.



Classes
-------

.. autoapisummary::

   eztaox.kernel_stat2.gpStat2


Functions
---------

.. autoapisummary::

   eztaox.kernel_stat2.carma_rms
   eztaox.kernel_stat2.carma_psd
   eztaox.kernel_stat2.carma_acf
   eztaox.kernel_stat2.carma_sf


Module Contents
---------------

.. py:class:: gpStat2(kernel: collections.abc.Callable)

   Bases: :py:obj:`equinox.Module`


   Base class for second-order statistics of GP kernels.

   :param kernel: A kernel function from kernels.quasisep.
   :type kernel: Callable

   .. attribute:: kernel_def

      A function to reconstruct kernel objects from
      its parameters

      :type: Callable

   .. attribute:: kernel_params

      parameters for kernel function

      :type: JAXArray


   .. py:method:: acf(ts: tinygp.helpers.JAXArray | numpy.typing.NDArray, params: tinygp.helpers.JAXArray | numpy.typing.NDArray | None = None) -> tinygp.helpers.JAXArray

      Compute the autocorrelation function (ACF) for given time lags.

      :param ts: Time lags for which to compute the ACF.
      :type ts: JAXArray | NDArray
      :param params: Parameters of the GP kernel if
                     different from those used to initialize the object. Defaults to None.
      :type params: JAXArray | NDArray | None, optional

      :returns: The computed ACF values for the given time lags.
      :rtype: JAXArray



   .. py:method:: sf(ts: tinygp.helpers.JAXArray | numpy.typing.NDArray, params: tinygp.helpers.JAXArray | numpy.typing.NDArray | None = None) -> tinygp.helpers.JAXArray

      Compute the structure function (SF) for given time lags.

      :param ts: Time lags for which to compute the SF.
      :type ts: JAXArray | NDArray
      :param params: Parameters of the GP kernel if
                     different from those used to initialize the object. Defaults to None.
      :type params: JAXArray | NDArray | None, optional

      :returns: The computed SF values for the given time lags.
      :rtype: JAXArray



   .. py:method:: psd(fs: tinygp.helpers.JAXArray | numpy.typing.NDArray, params: tinygp.helpers.JAXArray | numpy.typing.NDArray | None = None, df: float | tinygp.helpers.JAXArray | None = 0.01) -> tinygp.helpers.JAXArray

      Compute the power spectral density (PSD) for given frequencies.

      :param fs: Frequencies for which to compute the PSD.
      :type fs: JAXArray | NDArray
      :param params: Parameters of the GP kernel if
                     different from those used to initialize the object. Defaults to None.
      :type params: JAXArray | NDArray | None, optional
      :param df: Frequency width for create convolved
                 PSDs (not in use). Defaults to 0.01.
      :type df: float | JAXArray | None, optional

      :returns: The computed PSD values for the given frequencies.
      :rtype: JAXArray



.. py:function:: carma_rms(alpha: tinygp.helpers.JAXArray | numpy.typing.NDArray, beta: tinygp.helpers.JAXArray | numpy.typing.NDArray) -> tinygp.helpers.JAXArray

   Return a function that computes CARMA root-mean-squared (RMS).

   :param alpha: kernel alpha coefficients.
   :type alpha: JAXArray | NDArray
   :param beta: kernel beta coefficients
   :type beta: JAXArray | NDArray

   :returns: A function that takes in frequencies and returns RMS for the given
             coefficients.
   :rtype: JAXArray


.. py:function:: carma_psd(f: tinygp.helpers.JAXArray | numpy.typing.NDArray, arparams: tinygp.helpers.JAXArray | numpy.typing.NDArray, maparams: tinygp.helpers.JAXArray | numpy.typing.NDArray) -> tinygp.helpers.JAXArray

   Return a function that computes CARMA power spectral density (PSD).

   :param f: frequencies.
   :type f: JAXArray | NDArray
   :param arparams: AR coefficients.
   :type arparams: JAXArray | NDArray
   :param maparams: MA coefficients
   :type maparams: JAXArray | NDArray

   :returns: A function that takes in frequencies and returns PSD at the given
             frequencies.
   :rtype: JAXArray


.. py:function:: carma_acf(t: tinygp.helpers.JAXArray | numpy.typing.NDArray, arparams: tinygp.helpers.JAXArray | numpy.typing.NDArray, maparams: tinygp.helpers.JAXArray | numpy.typing.NDArray) -> tinygp.helpers.JAXArray

   Return a function to compute the model autocorrelation function (ACF) of CARMA.

   :param t: times.
   :type t: JAXArray | NDArray
   :param arparams: AR coefficients.
   :type arparams: JAXArray | NDArray
   :param maparams: MA coefficients.
   :type maparams: JAXArray | NDArray

   :returns: A function that takes in time lags and returns ACF at the given lags.
   :rtype: JAXArray


.. py:function:: carma_sf(t: tinygp.helpers.JAXArray | numpy.typing.NDArray, arparams: tinygp.helpers.JAXArray | numpy.typing.NDArray, maparams: tinygp.helpers.JAXArray | numpy.typing.NDArray) -> tinygp.helpers.JAXArray

   Return a function that computes the CARMA structure function (SF).

   :param t: times.
   :type t: JAXArray | NDArray
   :param arparams: AR coefficients.
   :type arparams: JAXArray | NDArray
   :param maparams: MA coefficients.
   :type maparams: JAXArray | NDArray

   :returns: A function that takes in time lags and returns CARMA SF at the
             given lags.
   :rtype: JAXArray


