Hi everyone,
Please, I need some help. I don't know how to formulate a linear
program in GLPK for fitting a curve with b-splines with a smoothing
factor lambda, specifically the Constrained Smoothing B-Splines as
described in the following paper in pages 5 (for linear basis) and 6
(for quadratic basis):
http://franke.nau.edu/pin-ng/working/cobs_cs.pdf
I was able to formulate the linear program for fitting the b-spline as
a interpolation function, but I have no idea how to penalize it with a
lambda factor for both cases linear and quadratic as described in the
paper.
I'm working with GLS API (for B-Spline evaluation) and GLPK API for C,
but what I did in C so far is more or less like this:
###############################################
set I; # dataset
set J; # coefficients
param x {i in I};
param y {i in I};
var u {i in I}, >= 0;
var v {i in I}, >= 0;
minimize error: sum {i in I} u[i] + sum {i in I} v[i];
s.t. equation {i in I} : sum {j in J} B(x[i])[j] + u[i] - v[i] = y[i];
solve;
###############################################
Thanks!
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk