CARMA
CARMA GP kernels
Note
term is a celerite nomenclature, a term is just a GP kernel. For example, a DRW_term object defines a DRW kernel.
A collection of GP kernels that express the autovariance structure of CARMA models using celerite.
- class eztao.carma.CARMATerm.CARMA_term(log_arpars, log_mapars, *args, **kwargs)
A general-purpose CARMA term (kernel)
- Parameters:
log_arpars (array(float)) – Natural log of the AR coefficients.
log_mapars (array(float)) – Natural log of the MA coefficients.
- static carma2fcoeffs(log_arpars, log_mapars)
Get the representation of a CARMA kernel in the factored polynomial space
A wrapper of CARMA_term.carma2fcoeffs_log for backward compatibility. This function will be deprecated in future releases.
- static carma2fcoeffs_log(log_arpars, log_mapars)
Get the representation of a CARMA kernel in the factored polynomial space
- Parameters:
log_arpars (array(float)) – Natural log of the AR coefficients.
log_mapars (array(float)) – Natural log of the MA coefficients.
- Returns:
- The coefficients (in natural log) of the factored polymoical
for the CARMA kernel specified by the input parameters. The last coeff is a multiplying factor of the returned polynomial.
- Return type:
array(float)
- static fcoeffs2carma(log_fcoeffs, p)
Get the representation of a CARMA kernel in the nominal CARMA parameter space
A wrapper of CARMA_term.fcoeffs2carma_log for backward compatibility. This function will be deprecated in future releases.
- static fcoeffs2carma_log(log_fcoeffs, p)
Get the representation of a CARMA kernel in the nominal CARMA parameter space
- Parameters:
log_coeffs (array(float)) – The array of coefficients for the factored polynomial with the last coeff being a multiplying factor of the polynomial.
p (int) – The p order of the CARMA kernel.
- Returns:
Natural log of the AR and MA parameters in two separate arrays.
- get_carma_parameter()
Return CARMA parameters in the natural sacle.
- get_complex_coefficients(params)
Get arrays of
alpha_complex_real,alpha_complex_imag,beta_complex_realandbeta_complex_imag(coefficients of celerite’s complex kernel)- Parameters:
params (array(float)) – Parameters of this kernel.
- Returns:
Arrays of
alpha_complex_real,alpha_complex_imag,beta_complex_realandbeta_complex_imag, one for each.
- get_real_coefficients(params)
Get arrays of
alpha_realandbeta_real(coefficients of celerite’s real kernel)- Parameters:
params (array(float)) – Parameters of this kernel.
- Returns:
Arrays of
alpha_realandbeta_real, one for each.
- get_rms_amp()
Get the RMS amplitude of this CARMA kernel
- Returns:
The RMS amplitude of this CARMA kernel.
- static rms_amp(log_arpars, log_mapars)
Compute the RMS amplitude of a CARMA kernel
- Parameters:
log_arpars (array(float)) – Natural log of the AR coefficients.
log_mapars (array(float)) – Natural log of the MA coefficients.
- Returns:
The RMS amplitude of the CARMA kernel specified by the input parameters.
- set_log_fcoeffs(log_fcoeffs)
Set kernel parameters
Use coeffs of the factored polynomial to set CARMA paramters, note that the last input coeff is always the coeff for the highest-order MA differential. While performing the conversion, 1 is added to the AR coeffs to maintain the same formatting (AR polynomials always have the highest order coeff to be 1).
- Parameters:
log_fcoeffs (array(float)) – Natural log of the coefficients for the factored characteristic polynomial, with the last coeff being an additional multiplying factor on this polynomial.
- class eztao.carma.CARMATerm.DHO_term(log_a1, log_a2, log_b0, log_b1, *args, **kwargs)
Damped Harmonic Oscillator (DHO) term (kernel)
- Parameters:
log_a1 (float) – Natural log of the DHO parameter a1.
log_a2 (float) – Natural log of the DHO parameter a2.
log_b0 (float) – Natural log of the DHO parameter b0.
log_b1 (float) – Natural log of the DHO parameter b1.
- class eztao.carma.CARMATerm.DRW_term(*args, **kwargs)
Damped Random Walk (DRW) term (kernel)
\[k_{DRW}(\Delta t) = \sigma^2\,e^{-\Delta t/\tau}\]with the parameters
log_ampandlog_tau.- Parameters:
log_amp (float) – The natural log of the RMS amplitude of the DRW process.
log_tau (float) – The natural log of the characteristic timescale of the DRW process.
Note
Conversions between EzTao DRW parameters and some other DRW representations seen in the literature:
\[\mathrm{SF_{\infty}^2} = 2*\sigma^2\]\[\sigma^2 = \tau*\sigma_{KBS}^2/2\]\[\tau = 1/\alpha_1; \,\sigma_{KBS} = \beta_0\]see MacLeod et al. (2010) for SF_{infty}} and Kelly et al. (2009) for sigma_{KBS}. alpha_1 and beta_0 are the AR and MA parameters for a CARMA(1,0) model, respectively.
- get_carma_parameter()
Get DRW parameters in CARMA notation (alpha_*/beta_*).
- Returns:
[alpha_1, beta_0].
- get_perturb_amp()
Get the amplitude of the perturbing noise (beta_0) in DRW
- Returns:
The amplitude of the perturbing noise (beta_0) in the current DRW.
- get_real_coefficients(params)
Get
alpha_realandbeta_real(coeffs of celerite’s real kernel)- Parameters:
params (array(float)) – Parameters of this kernel.
- Returns:
(
alpha_real,beta_real).
- get_rms_amp()
Get the RMS amplitude of this DRW process.
- Returns:
The RMS amplitude of this DRW process.
- static perturb_amp(log_amp, log_tau)
Compute the amplitude of the perturbing noise (beta_0) in DRW.
- Parameters:
log_amp (float) – The natural log of the RMS amplitude of the DRW process.
log_tau (float) – The natural log of the characteristic timescale of the DRW process.
- Returns:
The amplitude of the perturbing noise (beta_0) in the DRW specified by the input parameters.
- eztao.carma.CARMATerm.acf(arroots, arparam, maparam)
Get ACVF coefficients given CARMA parameters
The CARMA noation (index) folows that in Brockwell et al. (2001).
- Parameters:
arroots (array(complex)) – AR roots in a numpy array
arparam (array(float)) – AR parameters in a numpy array
maparam (array(float)) – MA parameters in a numpy array
- Returns:
ACVF coefficients, each element correspond to a root.
- Return type:
array(complex)
CARMA utility functions
A set of functions to computer 2nd order statistics of CARMA models.
- eztao.carma.model_utils.carma_acf(arparams, maparams)
Return a function that computes the model autocorrelation function (ACF) of CARMA.
- Parameters:
arparams (array(float)) – AR coefficients.
maparams (array(float)) – MA coefficients.
- Returns:
A function that takes in time lags and returns ACF at the given lags.
- eztao.carma.model_utils.carma_psd(arparams, maparams)
Return a function that computes CARMA Power Spectral Density (PSD).
- Parameters:
arparams (array(float)) – AR coefficients.
maparams (array(float)) – MA coefficients
- Returns:
A function that takes in frequencies and returns PSD at the given frequencies.
- eztao.carma.model_utils.carma_sf(arparams, maparams)
Return a function that computes the CARMA structure function (SF).
- Parameters:
arparams (array(float)) – AR coefficients.
maparams (array(float)) – MA coefficients.
- Returns:
A function that takes in time lags and returns CARMA SF at the given lags.
- eztao.carma.model_utils.drw_acf(tau)
Return a function that computes the DRW autocorrelation function (ACF).
- Parameters:
tau (float) – DRW decorrelation/characteristic timescale.
- Returns:
A function that takes in time lags and returns ACF at the given lags.
- eztao.carma.model_utils.drw_psd(amp, tau)
Return a function that computes DRW Power Spectral Density (PSD).
- Parameters:
amp (float) – DRW RMS amplitude
tau (float) – DRW decorrelation/characteristic timescale
- Returns:
A function that takes in frequencies and returns PSD at the given frequencies.
- eztao.carma.model_utils.drw_sf(amp, tau)
Return a function that computes the structure function (SF) of DRW.
- Parameters:
amp (float) – DRW RMS amplitude
tau (float) – DRW decorrelation/characteristic timescale.
- Returns:
A function that takes in time lags and returns DRW SF at the given lags.
- eztao.carma.model_utils.gp_psd(carmaTerm)
Return a function that computes native GP Power Spectral Density (PSD).
- Parameters:
carmaTerm (object) – A celerite CARMA term.
- Returns:
A function that takes in frequencies and returns PSD at the given frequencies.