8

A quick and dirty proof-of-concept implementation of my QuadraticOptimization idea. I haven't given it much thought, and the algorithm may require improvements, such as irregular grid, logarithmic scale, deciding how much and what type of smothness penalty is needed etc. The part I'm unsure about the most is requiring the smoothed curve to be above 1. There ...


4

Here is an approach that estimates the multiplicative constants by taking the log of the response variable and estimates the resulting additive constants. (* Take the log of the response so that the adjustment is additive and include the adjustments for each set of data *) (* Force the last data set to have an adjustment of 0 *) data2 = data; n = Length[...


3

I do not know if it is a bug, or by design NIntegrate does not support these options or does not "look" for them. Notice they are shown in red color as well. Which means they are not officially known But you could always do it explicitly g = Interpolation[Transpose[{{1, 2, 3, 4, 5}, {1, 2, 4, 1, 4}}]]; With[{left = g["Domain"][[1, 1]], right = g["Domain"]...


3

Using @CarlWoll's InterpolationToPiecewise will work. ElementWiseLayer complains that the InterpolatingFunction does not "symbolically evaluate." I take that to mean that it accepts only certain expressions as symbolic expressions. (* https://mathematica.stackexchange.com/a/212753 *) InterpolationToPiecewise[if_, x_] := Module[{main, default, grid}, grid ...


3

You can define a function that does the job (here an older one from me used in lectures 2015), this goes over the Lagrange base polynomials. Nominators and denominators fo the base-polynomials are calculated and used to build ab the interpolation polynomial. So the function delivers all the Lagrange base-polynomials. lagrangeInterpolation[values_, var_] := ...


2

Clear["Global`*"] Your specified points are pts = {{xi - 1, 0}, {xi, 1}, {xi + 1, 0}}; InterpolatingPolynomial finds the lowest degree polynomial fitting the points. For three points this is a second degree polynomial. f[x_] = InterpolatingPolynomial[pts, x] (* (1 + x - xi) (1 - x + xi) *) To find a higher degree polynomial add additional points at ...


2

This has to do with how Plot evaluates its arguments and the difference in how the arguments evaluate. Clearly the OP knows there is a difference between a pattern t_ and a literal symbol t. ifun2[t] = ifun[t] ifun3[t_] = ifun[t] The two codes below show the difference in evaluation. On the one hand ifun2[t] is defined only when the argument is literally ...


1

To get this off the unanswered list: as I mentioned in the comments, the main idea is to put in symbolic third derivatives in InterpolatingPolynomial[], and see what happens when the third criterion is applied: Integrate[InterpolatingPolynomial[{{{-a}, 0, 0, C[1]}, {{0}, 1, 0, C[2]}}, x], {x, -a, 0}] == 1/2 // Simplify ...


Only top voted, non community-wiki answers of a minimum length are eligible