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

advection constrain #47

Closed
JianghuiDu opened this issue Nov 26, 2019 · 12 comments
Closed

advection constrain #47

JianghuiDu opened this issue Nov 26, 2019 · 12 comments

Comments

@JianghuiDu
Copy link

JianghuiDu commented Nov 26, 2019

I read from the paper that the degree of advection constrain can be varied using a parameter but I couldn't find how to specifiy/tune this parameter in the documentation/examples. DIVAndrun accepts a velocity argument but not a parameter for this constrain.

@jmbeckers
Copy link
Member

I'm not on my main computer and cannot check, but I think in DIVAnd you can simply change the intensity of the velocity field. We will try to add a notebook with examples.

@JianghuiDu
Copy link
Author

Like multiply the velocity components with a constant? Is there a way to optimize the parameter?

@Alexander-Barth
Copy link
Member

Yes, this is correct. Increasing the advection constrain, is achieved by scaling it up:

scale = 2.
DIVAndrun(mask,(pm,pn),(xi,yi),(x,y),f,len,epsilon2; velocity = (scale * u,scale * v))

@Alexander-Barth
Copy link
Member

Alexander-Barth commented Nov 26, 2019

... Is there a way to optimize the parameter?

There is no tool (currently) in DIVAnd.jl to optimize this parameter. But one can do this with cross-validation by calling DIVAnd with different values of scale and comparing the analysis RMS error with a validation dataset.

The important (and somewhat difficult) think is the choice of the cross-validation dataset. Ideally you do want to have it independent from the dataset that you are using for the analysis (for example by excluding whole cruises)

@jmbeckers
Copy link
Member

If you are brave and you do not have a sufficiently large data set from which to set aside a validation set, you can try to understand how DIVAnd_cv works and adapt it to optimize the "scale" value; but the method(s) rely on quite some hypothesis which are difficult to control and you might end up tuning the parameter by "hand".

@JianghuiDu
Copy link
Author

Understood. I will do some tests. Thanks!

@JianghuiDu
Copy link
Author

More questions about the velocity in DIVAndrun:

  1. is it a tuple of (u,v) or (v, u)? My (xi,yi) are (lat,lon) and I feel the result using (u,v) is not consistent with my intuition...
  2. velocity is defined on analysis grid rather than observation locations, right?

@jmbeckers
Copy link
Member

  1. u is along the direction of the first coordinate, v in the direction of the second coordinate etc. If you decide to use latitude as first coordinate , u would be the meridional velocity

  2. yes, defined on the analysis grid. If you have it on another grid, you can use DIVAnd to interpolate ;-).

@JianghuiDu
Copy link
Author

Thanks for answering these questions. It would be nice if those things are in the documentations.

@jmbeckers
Copy link
Member

Maybe we still need some advice on how to roughly estimate the scale for velocities, or in other words how to estimate the penalzation importance compared to other penalizations ?

@JianghuiDu
Copy link
Author

Yes. That's my question in the other thread. In my case adding advection constrain only increases the root mean square, but it has an (flipped) L shape that until certain point increasing scale has minimal impact on RMS, but still appears to affect the analysis results visually. I feel it still makes sense to add advection constrain because my data is really sparse, but to what point is my question. That's why I'd like to know the costs due to advection relative to the other constrains.

@jmbeckers
Copy link
Member

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

No branches or pull requests

3 participants