MNGuenther / allesfitter

allesfitter is a convenient wrapper around the packages ellc (light curve and RV models), dynesty (static and dynamic nested sampling) emcee (Markov Chain Monte Carlo sampling) and celerite (Gaussian Process models).
MIT License
60 stars 36 forks source link

how to fit RV stellar variation for different RV datasets #71

Open zjwhale opened 11 months ago

zjwhale commented 11 months ago

I have RVs taken from three instruments. I want to fit planet orbit+stellar variability for one RV dataset, and only planet orbit for the other two. Is there any way to do that with allesfitter? Thanks

MNGuenther commented 11 months ago

Hi @zjwhale - The way to go is use the "baseline" param/setting, which is instrument-specific. See, for example:

zjwhale commented 11 months ago

Hi @MNGuenther, many thanks! I have another question regarding fitting the stellar variation. I'm currently working on fitting a Rossiter-McLaughlin (RM) model along with p-mode oscillations to my radial velocity (RV) data. For the oscillations, I've selected a Simple Harmonic Oscillator (SHO) kernel as the baseline parameter. However, due to a gap in the middle of the RM observation data, the fitting is producing weird results (see the attached figure). Is there a method to enable the Gaussian Process (GP) fitting to overlook or accommodate this gap? Thanks again!

Screen Shot 2023-11-21 at 10 21 57 AM
MNGuenther commented 11 months ago

Hi @zjwhale - Without having looked at the details and just judging from the plot I see here, what you have looks good.

What you see the SHO doing in the middle (where there is no data) is only a plotting feature. Since there is no data, but the plotting happens on a fine time grid (not on the data time grid), you see what the GP extrapolates into a regime of unknown data.

For a publication plot, you will anyway want to make your own plots, e.g. using the allesclass options or your custom scripts. There you can plot the baseline only on sub-grids covering only the data ranges.

(Now, one could ponder why the GP thinks the amplitude in this extrapolated range is bigger than in the real data, but that would require a very thorough analysis of all details.)

zjwhale commented 10 months ago

Hi Max, thanks for your answer! I've solved the issue. It turns out that the Gaussian Process model overestimated the amplitude in the extrapolated range because I provided incorrect initial guess and range for the amplitude, which were significantly higher than the actual amplitude in the data. After correcting this initial guess and widen the range, the fitting results now appear reasonable.