Showing posts with label interpolation. Show all posts
Showing posts with label interpolation. Show all posts

2025-07-07

stellar twins vs synthetic stellar twins

In the Milky Way meeting at MPIA today, a bit of a discussion broke out about using stellar twins, inspired by work by Yuan-Sen Ting (OSU). The idea is: If you have two stars with very similar overall metallicity, and very similar temperature and surface gravity, then it should be possible to measure accurate element abundnace anomalies between the two stars, even in the absence of an extremely accurate spectral synthesis code.

My view, which does not contradict this point, is that an even better way to use this stellar-twin idea is to synthesize a twin for every star, using stars that are similar in (either) parameters or else spectral space. After all, an interpolation to your target star should more accurately represent it than even the most similar individual comparison star. That idea, fundamentally, is the main idea behind The Cannon.

2022-09-30

writing an interpolator in jax

Today I pair-coded with Matt Daunt (NYU) a general kernel-based interpolator in jax. Actually, I am not certain that what we wrote can be handled by jax gracefully, because I don't understand the functional programming model. But I learned that interpolation is harder than I thought: If your interpolator is higher-order than linear, the interpolation involves solving an inverse problem. The fast interpolators (like spline) have such solutions coded with clever iteration schemes that require only one pass through the data, like the fast GPs we love. But if you want to write something general, you might have to suck up some (sparse) linear algebra. Daunt and I discussed strategies for our spectroscopic model, given these realities.

2022-09-29

never shift-and-coadd your data!

I had a great (weekly) call with Andy Casey (Monash) today. We discussed many things, including a hilarious idea for April Fools' that Matt Daunt (NYU) and I conceived. But one of my action items out of the meeting is to start a short note on how to avoid ever shifting and stacking your data (think spectra taken at different times of year, so at different Doppler shifts relative to the Earth). How can you combine data without doing any interpolation of the data? The answer is simple: You forward-model your data with a model that (by optimization) becomes the average of those data. (And the optimization is often closed-form.) Then you only ever shift the model, and you don't have to deal with shifting noise arrays or mask arrays, or anything else. I'll try to write a stub this weekend.

2021-04-26

the theory is a grid

I had a great conversation with Andy Casey (Monash) at the end of the day. We discussed many things related to APOGEE and SDSS-V. One of the things I need is the code that makes the synthetic (physical model) spectra for the purposes of obtaining parameter estimates in APOGEE and the derivatives of that model with respect to stellar parameters. That is, I want the physical-model derivatives of spectral expectation with respect to parameters (like temperature, surface gravity, and composition). It turns out that, at this point, the model is a set of synthetic spectra generated on a grid in parameter space! So the model is the grid, and the derivatives are the slopes of a cubic-spline interpolation (or something like that). I have various issues with this, but I'll be fine.

2020-01-10

interpolation

It was a low-research day (job season) but I worked a bit with Lily Zhao (Yale) on interpolation methods and comparing interpolations. This for our hierarchical, non-parametric wavelength calibration method.

2019-11-07

interpolation duh

As my loyal reader knows, I am working with Lily Zhao (Yale) to calibrate the EXPRES spectrograph. Our approach is non-parametric: We can beat any polynomial calibration with an interpolation (we are using splines, but one could also use a Gaussian Process or any other method, I think). The funniest thing happened today, which surprised me, but shouldn't have! When Zhao plotted a histogram of the differences between our predicted line locations (from our interpolation) and the observed line locations (of held-out lines, held out from the interpolation), they were always redshifted! There was a systematic bias everywhere. We did all sorts of experiments but could find no bug. What gives? And then we had a realization which is pretty much Duh:

If you are doing linear interpolation (and we were at this point), and if your function is monotonically varying, and if your function's first derivative is also monotonically varying, the linear interpolator will always be biased to the same side! Hahaha. We switched to a cubic spline and everything went unbiased.

In detail, of course, interpolation will always be biased. After all, it does not represent your beliefs about how the data are generated, and it certainly does not represent the truth about how your data were generated. So it is always biased. It's just that once we go to a cubic spline, that bias is way below our precision and accuracy (under cross-validation). At least for now.

2018-07-30

spiral arms? and model-grid troubleshooting

The excitement of the day is that we looked at velocity-tensor maps (maps of the means of average velocity-velocity products) across the disk with Eilers (MPIA): We see lots of structure, including possible evidence of spiral arms or bar resonances on the off-diagonal tensor components. Reminder: If the Galaxy is axisymmetric, there will only be diagonal tensor components in the R, phi, z coordinate system. If we find off-diagonal components: Non-axisymmetry. Could be interesting. Rix (MPIA) encouraged us to stay on target for a Jeans model and leave these hints of complex disk morphology for later investigations.

In addition to this, I had a great chat with Maria Bergemann (MPIA) and Mikhail Kovalev (MPIA) about fitting spectra with spectral models, given that the models are amazingly expensive to compute. They do a (random) grid and then interpolate using The Payne. They are getting some results they aren't happy with, so I walked through basic tests that can be done in these situations.

Basic sanity checks—when you are fitting data using an interpolation of a grid or random assemblage of model predictions—are the following: Find the closest model point in the grid, and then the K next closest, where K is larger than the dimensionality of the model parameter space. Is the best-fit model in the convex hull of the K? Are the K in one group or multiple groups? Do the K look like they hit the edge of the grid? And what are the chi-squared values? And is the interpolated best point also in the convex hull? All these pieces of information go into an analysis of whether you have enough model evaluations and how to interpolate them.

2018-05-14

integral-field spectroscopy

Today Dou Liu (NYU) gave a presentation of his thesis research as part of his candidacy exam. His first project has been to adapt the ideas in spectro-perfectionism from the spectral domain to the spatial domain to combine irregular, dithered imaging. He is applying this to integral-field spectroscopic data in MaNGA, which is part of SDSS-IV. He showed that he can get better angular resolution than the standard data-analysis methods, which are generally radial-basis-function interpolations of the data. One of his goals is to produce generally useful tools. Another is to re-process all of the MaNGA data. A great contribution, betterizing existing data that have already been hugely productive.

2017-10-13

calibration of ZTF; interpolation

I am loving the Friday-morning parallel working sessions in my office. I am not sure that anyone else is getting anything out of them! Today Anna Ho (Caltech) and I discussed things in my work on calibration and data-driven models (two extremely closely related subjects) that might be of use to the ZTF and SEDM projects going on at Caltech.

Late in the morning, an argument broke out about using deep learning to interpolate model grids. Many projects are doing this, and it is interesting (and odd) to me that you would choose a hard-to-control deep network when you could use an easy-to-control function space (like a Gaussian Process, stationary or non-stationary). But the deep-learning toothpaste is hard to put back into the tube! That said, it does have its uses. One of my medium-term goals is to write something about what those uses are.

2017-02-08

velocities for APOGEE stars

At stars group meeting, run by Lauren Anderson (Flatiron), new graduate student Jason Cao (NYU) showed us his work on measuring radial velocities for individual-visit APOGEE spectra. He has a method for determining the radial velocity that does not involve interpolating either the data or the model. During his presentation, Jo Bovy (Toronto) pointed out that, actually, the APOGEE team appears to do an interpolation of the data after the one-d spectral extraction. That's unfortunate! But anyway, we have a method that doesn't involve any interpolation which could be used on a survey that doesn't ever do interpolation before or after extraction. And yes, you can extract a spectrum on any wavelength grid you like, from any two-d data you like, without doing interpolation! The group-meeting attendees had many constructive comments for Cao.

2017-02-02

#JudyFest, day 2

Today was the second day of The Galactic Renaissance. Two scientific themes of the day were globular-cluster star abundance patterns, and stellar models that account for 3-d and non-thermal-equilibrium (NLTE) effects. On the former, it was even suggested by one speaker that the existence of chemical-abundance variations of certain kinds might be part of the definition of a globular cluster! There are some extreme cases, and various claims that the most extreme examples might be the stripped centers of ancient accreted galaxies!

On the stellar modeling front, there were impressive demonstrations from Frebel (MIT), Bergemann (MPIA), and Thygesen (Caltech) that improving the realism of the physical inputs to stellar models improves their precision and their accuracy. Thygesen did a very nice thing of using (relatively cheap) 1-D models to inform functional forms for interpolation across grid points of a (relatively expensive) 3-D model grid. That got me interested in thinking about physics-motivated or physics-constrained interpolation methods, which could have value in lots of domains.

In a session about Judy's scientific and intellectual life, Steve Shectman (OCIW) described what the world was like in 1967, when Judy Cohen (Caltech) started graduate school. It was a time of optimisim, disruption, and violence. This resonated with things I know about Cohen, because she and I used to discuss the historical context of her origins as an astronomer back when I was a graduate student.

Another highlight of the day was a discussion with Kim Venn (Victoria) and Matt Shetrone (Texas) about persistence effects that damage a significant fraction of spectra in a significant fraction of APOGEE exposures. We discussed the trade-offs between correction and avoidance, and what it might take to fix the problem.

Over dinner, I and others delivered tributes to Judy Cohen. She really has had an amazing scientific impact, and also been a wonderful person, and had a big influence on me. She also said nice things about me in her own speech!

2015-11-09

The Cannon is an interpolator

In a day wrecked by health issues—I was supposed to be spending the day with visiting researchers from Northrop Grumman–I did manage to write a few equations and words into the method section of the document describing our plans for a compressed-sensing upgrade of The Cannon. It is so simple! And I realize we have to correct our argument (in the first paper) that we need exponentially large training sets to go to large numbers of labels. That argument was just plain wrong; it was based on an assumption that The Cannon is effectively a density estimator. It is not; it is essentially an interpolator.