Search code examples
maplecurvesmoothing

How do I smooth data in maple?


In maple, what is the best way to smooth a data set, similar to one shown in the diagram, to get a regular(smooth) curve without affecting overall statistical properties? I am using Maple 16.

xdata has 120 bins from 0.05 to 6.00


Solution

  • I would recommend having a look at the data smoothing commands in the Statistics package. Something like an exponential smoothing model could be applied to your data in order to smooth out the trend line.

    If you have a recent copy of Maple, you can experiment with this using something like the following:

    with(Statistics):
    Z := Sample(Normal(0, 1), 50): #Generate some data
    Y := CumulativeSum(Z):
    ESmodel := Constant -> ExponentialSmoothing(Y, 0.1*Constant):
    

    The Explore command creates an interface where you can try out different values for a smoothing constant:

    Explore( plots[display]( LineChart(Y, color=blue), 
                             LineChart(ESmodel(Constant), thickness=3, color=red),  
              gridlines=true),
    parameters=[Constant=1..10] );
    

    Explore_Smoothing_Example