Skip to content

Modifying the design matrix X in GAMS to suit data assimilation

3 messages · Ateljevich, Eli, Simon Wood, esatel

#
I have a data assimilation problem that might be amenable to the use of GAMS, but I am not sure how feasible it is to implement. I was told the R mailing list was a great resource.

My observations are spatiotemporal salinity in the San Francisco Bay at a number of instruments over a few days. The thing that I want to fit is the initial condition for a salt transport model at the beginning of this time period. The spline basis functions, parameters and curvature penalties would all be purely spatial, though the cross-validation would be in the space of the data.

The modification I need to make is as follows:
1. evaluate each spatial basis function at every computational point in my mesh (dense, but not part of the GAM)
2. use the bases members as individual initial conditions and integrate the PDE.
3. evaluate the salinity results at the (sparse) time and locations where I have observations.
4. construct a replacement model matrix X that reflects the influence at (x,t) of each spatial basis member. Summing these will works due to the linearity of the PDE.
5. The curvature penalty would remain in the spatial, not the spatio-temporal, space.

My concerns are: whether, say with mgcv, I can halt the process (probably set "fit" to false) and then evaluate at a large number of arbitrary points, then replace the matrix X and continue on. I am also concerned whether this is hopeless in the sense that at the point in the algorithm where I might inject the new X precalculations might have been made using the old matrix X that would be hard to reverse.



Can anyone give me some advice how to do this?


Thanks,
Eli
#
Eli,

I think that this should be possible. If your integration allows you to 
express the salinity as a weighted sum of evaluated values of the 
spatial smooth function (where the weights are known), then you could 
use the summation convention for smooths described in 
?linear.functional.terms.

If that is not possible, then it is possible to use mgcv to set up a 
smoothing basis in at least 2 ways.
i) You can use the ?smooth.construct functions, to set up model matrices 
and penalties, or
ii) You can set up, but not fit, a GAM model using gam(...,fit=FALSE)

Once you have rolled your own model matrix, you can either modify what 
was returned by option ii) and get `gam' to proceed with fitting, or use 
the paraPen argument to `gam' to fit a model with your model matrix, 
penalized according to the contents of `paraPen' (?gam.models has some 
example code using paraPen).

best,
Simon
On 11/07/12 15:56, Ateljevich, Eli wrote:

  
    
#
Thanks Simon!  I can use the functional approach to bridge the gap between
this and more traditional forms of data assimilation.

At the moment, though, what I am doing is related to your work with soap
films, in which your response comes from linearly combine solutions of a PDE
evaluated at the point of the observation:
y = PDE ( weighed_sum_j( IC(j) ) ) = weighted_sum_j( PDE (IC(j)) )

I take it that your other ideas will allow me to do that, and in any event
they give me some material to digest.

Thanks,
Eli


--
View this message in context: http://r.789695.n4.nabble.com/Modifying-the-design-matrix-X-in-GAMS-to-suit-data-assimilation-tp4636189p4636311.html
Sent from the R help mailing list archive at Nabble.com.