Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create plot routine for extractor feets.extractors.ext_car.CAR #46

Open
leliel12 opened this issue Jan 21, 2020 · 0 comments
Open

Create plot routine for extractor feets.extractors.ext_car.CAR #46

leliel12 opened this issue Jan 21, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@leliel12
Copy link
Contributor

Create plot routine for extractor CAR.

Path: feets.extractors.ext_car.py

Features

  • CAR_mean

  • CAR_sigma

  • CAR_tau

Extractor Documentation

In order to model the irregular sampled times series we use CAR
(Brockwell and Davis, 2002), a continious time auto regressive model.

CAR process has three parameters, it provides a natural and consistent way of estimating a characteristic time scale and variance of light-curves. CAR process is described by the following stochastic differential equation:

$$dX(t) = - \frac{1}{\tau} X(t)dt + \sigma_C \sqrt{dt} \epsilon(t) + bdt, \\\ for \: \tau, \sigma_C, t \geq 0$$

where the mean value of the lightcurve X(t) is b**τ and the variance is $\frac{\tau\sigma_C^2}{2}$. τ is the relaxation time of the process X(t), it can be interpreted as describing the variability amplitude of the time series. σC can be interpreted as describing the variability of the time series on time scales shorter than τ. ϵ(t) is a white noise process with zero mean and variance equal to one.

The likelihood function of a CAR model for a light-curve with observations x − {x1, …, xn} observed at times {t1, …, tn} with measurements error variances {δ12, …, δn2} is:

$$p (x|b,\sigma_C,\tau) = \prod_{i=1}^n \frac{1}{ [2 \pi (\Omega_i + \delta_i^2 )]^{1/2}} exp \{-\frac{1}{2} \frac{(\hat{x}_i - x^*_i )^2}{\Omega_i + \delta^2_i}\} \\$$ $$x_i^* = x_i - b\tau \\$$ $$\hat{x}_0 = 0 \\$$ $$\Omega_0 = \frac{\tau \sigma^2_C}{2} \\$$ $$\hat{x}_i = a_i\hat{x}_{i-1} + \frac{a_i \Omega_{i-1}}{\Omega_{i-1} + \delta^2_{i-1}} (x^*_{i-1} + \hat{x}_{i-1}) \\$$ $$\Omega_i = \Omega_0 (1- a_i^2 ) + a_i^2 \Omega_{i-1} (1 - \frac{\Omega_{i-1}}{\Omega_{i-1} + \delta^2_{i-1}} )$$

To find the optimal parameters we maximize the likelihood with respect to σC and τ and calculate b as the mean magnitude of the light-curve divided by τ.

>>> fs = feets.FeatureSpace(
...     only=['CAR_sigma', 'CAR_tau','CAR_mean'])
>>> features, values = fs.extract(**lc_periodic)
>>> dict(zip(features, values))
{'CAR_mean': -9.230698873903961,
 'CAR_sigma': -0.21928049298842511,
 'CAR_tau': 0.64112037377348619}

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants