Re: Averaging
- To: mathgroup at smc.vnet.net
- Subject: [mg41956] Re: Averaging
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 11 Jun 2003 13:17:43 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bc6nok$2i3$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
I suppose, that the data are in lst1,lst2,lst3
I will construct a Interpolation[] function for every
data set and than average the interpolations.
Your data sets iclude multiple x values and the repeated
values must be removed with
ave[{{a_, b_}}] := {a, b}
ave[a : {{_, _} ..}] := Module[{x, y},
{x, y} = Transpose[a];
x = First[x];
y = Plus @@ y/Length[y];
{x, y}
]
list1 = ave /@ Split[lst1, First[#1] == First[#2] &];
list2 = ave /@ Split[lst2, First[#1] == First[#2] &];
list3 = ave /@ Split[lst3, First[#1] == First[#2] &];
Now a Interpolation[] can constructed with
ip1 = Interpolation[list1];
ip2 = Interpolation[list2];
ip3 = Interpolation[list3];
and the average can be plotted with
Plot[Evaluate[(ip1[x] + ip2[x] + ip3[x])/3], {x, 0, 320}]
Regards
Jens
C B wrote:
>
> Hello,
>
> Three repetitions of an experiment were carried out. The data is copy pated
> below. I hope the main contributors on this email list are able to import
> this data into a spread sheet program and have a look at it. If you are not
> let me know and I should be able to send that data to you in some other
> format of your preference.
>
> In the data,
>
> X coordinate is 'Time' expressed in minutes.
> Y coordinate is 'Gas concentration' expressed in PPM.
>
> If you look and plot the data for all the repetitions, you will see that all
> the plots are not exactly the same. The difference is mainly due to the
> inherrent errors and variance factors in any experiment.
>
> What I am looking for is a mathematical tool or a treatment or some way of
> coming up with one data set representing the average effect of all the three
> repetions.