[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] GLPK and Smoothing Splines
From: |
Mineo, Eduardo Phillipe |
Subject: |
[Help-glpk] GLPK and Smoothing Splines |
Date: |
Sun, 2 Oct 2016 22:53:58 -0300 |
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] GLPK and Smoothing Splines,
Mineo, Eduardo Phillipe <=