フィルターのクリア

Identify Grid Data Required during Intepolation

2 ビュー (過去 30 日間)
Zach
Zach 2014 年 5 月 15 日
回答済み: Prateekshya 約4時間 前
I'm trying to figure out a way to identify which grid points are queried when doing a n-D interpolation. The general problem is:
I have a large n-Dimensional hypercube bounding the data I need. Since it is very expensive to fill in a fine grid across that whole hypercube, I wish to initially generate a very coarse grid over the hypercube and get data points. I will then use that data to run through the simulations for which the interpolation is needed. From that, I want to identify what points on a finer grid would be required by the simulation. Ideally, I could generate something like a heat map, where I can count the number of times each data point gets called, so I could determine to what fidelity I need to obtain data. In addition, this will let me identify which points in the cube can be ignored, which I expect to be 90-95% of the total.
My first thought is to dig into the interpn function and find where it queries the grid and modify it for my purposes, but I'm open to an existing or more elegant approach.

回答 (1 件)

Prateekshya
Prateekshya 約4時間 前
Hello Zach,
To tackle the problem of identifying which grid points are queried during an n-D interpolation and potentially generating a heat map of those queries, you can use a combination of MATLAB's interpolation capabilities and some custom logic to track the queries. Here is how to do it:
  1. Create a Coarse Grid: Define your n-dimensional coarse grid over the hypercube using ndgrid or meshgrid for lower dimensions.
  2. Simulate Data on the Coarse Grid: Obtain or simulate the data values at these coarse grid points.
  3. Define the Fine Grid: Create a finer grid that represents the potential query points. This grid should be much denser than the coarse grid.
  4. Track Interpolation Queries: Use a custom wrapper around the interpn function to track which points on the coarse grid are being queried during interpolation. You can achieve this by modifying the interpolation process to log the indices of the coarse grid points used for each interpolation call.
  5. Generate Heat Map: Initialize an n-dimensional array (of the same size as your coarse grid) to zero. Every time a grid point is used in interpolation, increment its corresponding value in this array. Optionally, normalize the heat map to visualize the frequency of queries.
I hope it helps!

カテゴリ

Help Center および File ExchangeIndustrial Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by