New homework

Find a dataset form 1) ?Data*, 2) the net 3) your measurements (e.g. beer diary) and apply at least one function from each branch of statistics we discussed.

Solutions of the homeworks

Play a simple melody using Play, Sound, the packages Audio and Music.

Xuan Tran Thi

SetDirectory[NotebookDirectory[]]
mysong = Import["testsong.mp3"]
Sound[mysong]

Bence Bogdola

EmitSound[Sound[{SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["G",0.9],SoundNote["G",0.5],SoundNote[None,0.3],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["G",0.9],SoundNote["G",0.5],SoundNote[None,0.3],SoundNote["F5",0.5],SoundNote["E5",0.5],SoundNote["D5",0.5],SoundNote["C5",0.5],SoundNote["A4",0.3],SoundNote[None,0.5],SoundNote["C5",0.2],SoundNote[None,0.5],SoundNote["G4",0.2],SoundNote[None,0.2],SoundNote["F4",0.3],SoundNote[None,0.2],SoundNote["E4",0.1],SoundNote[None,0.1],SoundNote["D4",0.5],SoundNote["C4",0.5],SoundNote[None,0.1],SoundNote["C4",0.1]}]]

Panel[Grid[{{Sound[{SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["G",0.9],SoundNote["G",0.5],SoundNote[None,0.3],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["G",0.9],SoundNote["G",0.5],SoundNote[None,0.3],SoundNote["F5",0.5],SoundNote["E5",0.5],SoundNote["D5",0.5],SoundNote["C5",0.5],SoundNote["A4",0.3],SoundNote[None,0.5],SoundNote["C5",0.2],SoundNote[None,0.5],SoundNote["G4",0.2],SoundNote[None,0.2],SoundNote["F4",0.3],SoundNote[None,0.2],SoundNote["E4",0.1],SoundNote[None,0.1],SoundNote["D4",0.5],SoundNote["C4",0.5],SoundNote[None,0.1],SoundNote["C4",0.1]}]},{EmitSound[Sound[{SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["G",0.9],SoundNote["G",0.5],SoundNote[None,0.3],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["C",0.5],SoundNote["E",0.5],SoundNote["G",0.9],SoundNote["G",0.5],SoundNote[None,0.3],SoundNote["F5",0.5],SoundNote["E5",0.5],SoundNote["D5",0.5],SoundNote["C5",0.5],SoundNote["A4",0.3],SoundNote[None,0.5],SoundNote["C5",0.2],SoundNote[None,0.5],SoundNote["G4",0.2],SoundNote[None,0.2],SoundNote["F4",0.3],SoundNote[None,0.2],SoundNote["E4",0.1],SoundNote[None,0.1],SoundNote["D4",0.5],SoundNote["C4",0.5],SoundNote[None,0.1],SoundNote["C4",0.1]}]]},{ExampleData[{"Geometry3D","Cow"}]}}]]

Tamás Mezei

Short version of ‘Tubular Bells’ by Mike Oldfield, (From the movie ‘The Exorcist’)

T=60/160;
T1=4T;
T2=2T;
T4=T;
T8=(T/2);
S[note_, rythm_]:=SoundNote[note, rythm];
B[note_, from_, to_]:=Sound[SoundNote[note], {from, to}];


Sound[{"MusicBox", 
S[16, T8],

Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16}}],
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16,23,16}}],

Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16}}],
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16,23,16}}],



"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}], "Piano", B[-15, 61T8,61T8+T4], B[-15, 61T8+T4,61T8+2T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,26,16,23,24,16}}], "Piano", B[-15, 61T8+3T4, 61T8+3T4+1.5T4], B[-15, 61T8+4.5T4, 61T8+4.5T4+(1/3)T8], B[-13, 61T8+4.5T4+(1/3)T8, 61T8+4.5T4+(2/3)T8],B[-12, 61T8+4.5T4+(2/3)T8, 61T8+4.5T4+(3/3)T8], B[-10, 61T8+5T4, 61T8+5T4+T8], B[-8, 61T8+5T4+T8, 61T8+5T4+2T8], B[-10, 61T8+5T4+2T8, 61T8+5T4+3T8], B[-5, 61T8+5T4+3T8, 61T8+5T4+4T8],
"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}], "Piano", B[-17, 61T8+7T4, 61T8+8T4], B[-17, 61T8+8T4, 61T8+10T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,26,16,23,24,16,23,16}}], "Piano", B[-5, 61T8+10T4, 61T8+12T4], B[-10, 61T8+12T4, 61T8+12T4+(1/3)T4], B[-5, 61T8+12T4+(1/3)T4, 61T8+12T4+(2/3)T4], B[-10, 61T8+12T4+(2/3)T4, 61T8+12T4+(3/3)T4], B[-12, 61T8+13T4, 61T8+13T4+T8], B[-13, 61T8+13T4+T8, 61T8+13T4+2T8], B[-17, 61T8+14T4, 61T8+15T4],



"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}], "Piano", B[-15, 91T8,91T8+T4], B[-15, 91T8+T4,91T8+2T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,26,16,23,24,16}}], "Piano", B[-15, 91T8+3T4, 91T8+3T4+1.5T4], B[-15, 91T8+4.5T4, 91T8+4.5T4+(1/3)T8], B[-13, 91T8+4.5T4+(1/3)T8, 91T8+4.5T4+(2/3)T8],B[-12, 91T8+4.5T4+(2/3)T8, 91T8+4.5T4+(3/3)T8], B[-10, 91T8+5T4, 91T8+5T4+T8], B[-8, 91T8+5T4+T8, 91T8+5T4+2T8], B[-10, 91T8+5T4+2T8, 91T8+5T4+3T8], B[-5, 91T8+5T4+3T8, 91T8+5T4+4T8],
"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}], "Piano", B[-17, 91T8+7T4, 91T8+8T4], B[-17, 91T8+8T4, 91T8+10T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,26,16,23,24,16,23,16}}], "Piano", B[-5, 91T8+10T4, 91T8+12T4], B[-10, 91T8+12T4, 91T8+12T4+(1/3)T4], B[-5, 91T8+12T4+(1/3)T4, 91T8+12T4+(2/3)T4], B[-10, 91T8+12T4+(2/3)T4, 91T8+12T4+(3/3)T4], B[-12, 91T8+13T4, 91T8+13T4+T8], B[-13, 91T8+13T4+T8, 91T8+13T4+2T8], B[-17, 91T8+14T4, 91T8+15T4],



"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21}}], B[12, 121T8, 121T8+2T4], B[12, 121T8+2T4, 121T8+3T4], B[16, 121T8+2T4, 121T8+3T4], "Piano", B[-15, 121T8, 121T8+T4], B[-15, 121T8+T4, 121T8+3T4],
"MusicBox",
Table[S[i, T8], {i, {16,24,16,26,16,23}}], B[12, 121T8+3T4, 121T8+5T4], B[12, 121T8+5T4, 121T8+6T4], "Piano", B[-15, 121T8+3T4, 121T8+6T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,21,16,23,16}}], B[12, 121T8+6T4, 121T8+8T4], B[{12, 11}, 121T8+8T4, 121T8+9T4], "Piano", B[-15, 121T8+6T4, 121T8+8T4], B[-17, 121T8+8T4, 121T8+9T4],
"MusicBox",
Table[S[i, T8], {i, {19,21,16,24,16,26}}], B[{11,12}, 121T8+9T4, 121T8+11T4], B[{11,12}, 121T8+11T4, 121T8+12T4], "Piano", B[-17, 121T8+9T4, 121T8+12T4],
"MusicBox",
Table[S[i, T8], {i, {16,23,24,16,23,16}}], B[{11,12}, 121T8+12T4, 121T8+14T4], B[{11,12}, 121T8+14T4, 121T8+15T4], "Piano", B[-17, 121T8+12T4, 121T8+15T4],



"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21}}], B[{9,12}, 151T8, 151T8+2T4], B[{9,12}, 151T8+2T4, 151T8+3T4], B[16, 151T8+2T4, 151T8+3T4], "Piano", B[-19, 151T8, 151T8+T4], B[-19, 151T8+T4, 151T8+3T4],
"MusicBox",
Table[S[i, T8], {i, {16,24,16,26,16,23}}], B[{9,12}, 151T8+3T4, 151T8+5T4], B[{9,12}, 151T8+5T4, 151T8+6T4], "Piano", B[-19, 151T8+3T4, 151T8+6T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,21,16,23,16}}], B[12, 151T8+6T4, 151T8+8T4], B[{12, 11}, 151T8+8T4, 151T8+9T4], "Piano", B[-19, 151T8+6T4, 151T8+8T4], B[-20, 151T8+8T4, 151T8+9T4],
"MusicBox",
Table[S[i, T8], {i, {19,21,16,24,16,26}}], B[{11,12}, 151T8+9T4, 151T8+11T4], B[{7,11}, 151T8+11T4, 151T8+12T4], "Piano", B[-20, 151T8+9T4, 151T8+12T4],
"MusicBox",
Table[S[i, T8], {i, {16,23,24,16,23,16}}], B[{7,11}, 151T8+12T4, 151T8+14T4], B[11, 151T8+14T4, 151T8+15T4], "Piano", B[-20, 151T8+12T4, 151T8+15T4],



"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21}}], "Piano", B[{2,7,9}, 181T8, 181T8+2T4], B[{2,7,9}, 181T8+2T4, 181T8+3T4],
"MusicBox",
Table[S[i, T8], {i, {16,24,16,26,16,23}}], "Piano", B[{2,5,9}, 181T8+3T4, 181T8+5T4], B[{2,5,9}, 181T8+5T4, 181T8+6T4],
"MusicBox",
Table[S[i, T8], {i, {24,16,21,16,23,16}}], "Piano", B[{2,5,9}, 181T8+6T4, 181T8+8T4], B[{0,4,9}, 181T8+8T4, 181T8+9T4],
"MusicBox",
Table[S[i, T8], {i, {19,21,16,24,16,26}}], "Piano", B[{0,4,9}, 181T8+9T4, 181T8+11T4], B[{0,4,9}, 181T8+11T4, 181T8+12T4],
"MusicBox",
Table[S[i, T8], {i, {16,23,24,16,23,16}}], "Piano", B[{0,4,9}, 181T8+12T4, 181T8+14T4], B[{0,4,9}, 181T8+14T4, 181T8+15T4],



"MusicBox",
Table[S[i, T8], {i, {23,16,24,16,21,23}}], "Piano", B[{-1, 2,4}, 211T8, 211T8+2T4], B[{-1, 2,4}, 211T8+2T4, 211T8+3T4],
"MusicBox",
Table[S[i, T8], {i, {16,26,16,28,16,24}}], "Piano", B[{-1, 2,4}, 211T8+3T4, 211T8+5T4], B[{-1, 2,4}, 211T8+5T4, 211T8+6T4],
"MusicBox",
Table[S[i, T8], {i, {26,16,21,16,23,16}}], "Piano", B[{-1, 2,4}, 211T8+6T4, 211T8+8T4], B[{-3, 0, 4}, 211T8+8T4, 211T8+9T4],
"MusicBox",
Table[S[i, T8], {i, {19,21,16,24,16,26}}], "Piano", B[{-3, 0, 4}, 211T8+9T4, 211T8+11T4], B[{-5,-1,4}, 211T8+11T4, 211T8+12T4],
"MusicBox",
Table[S[i, T8], {i, {16,23,24,16,23,16}}], "Piano", B[{-5,-1,4}, 211T8+12T4, 211T8+14T4], B[{-5,-1,4}, 211T8+14T4, 211T8+15T4],


"MusicBox",
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16}}],
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16,23,16}}],
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23,24,16}}],
Table[S[i, T8], {i, {21,16,23,16,19,21,16}}],
Table[S[i, T8], {i, {24,16,26,16,23}}],
S[24, T4],
S[23, T2]
}]

Bence Tipary

t=0.3;
x=5;
Sound[{
SoundNote[9-x,t,"Piano"],SoundNote[21-x,t,"Piano"],SoundNote[24-x,t,"Piano"],SoundNote[23-x,t,"Piano"],
SoundNote[7-x,t,"Piano"],SoundNote[19-x,t,"Piano"],SoundNote[23-x,t,"Piano"],SoundNote[24-x,t,"Piano"],
SoundNote[12-x,t,"Piano"],SoundNote[19-x,t,"Piano"],SoundNote[24-x,t,"Piano"],SoundNote[26-x,t,"Piano"],
SoundNote[5-x,t,"Piano"],SoundNote[19-x,t,"Piano"],SoundNote[26-x,t,"Piano"],SoundNote[28-x,t,"Piano"],
SoundNote[9-x,t,"Piano"],SoundNote[21-x,t,"Piano"],SoundNote[28-x,t,"Piano"],SoundNote[26-x,t,"Piano"],
SoundNote[7-x,t,"Piano"],SoundNote[19-x,t,"Piano"],SoundNote[23-x,t,"Piano"],SoundNote[24-x,t,"Piano"],
SoundNote[12-x,t,"Piano"],SoundNote[19-x,t,"Piano"],SoundNote[24-x,t,"Piano"],SoundNote[26-x,t,"Piano"],
SoundNote[5-x,t,"Piano"],SoundNote[26-x,t,"Piano"],SoundNote[24-x,t,"Piano"],SoundNote[23-x,t,"Piano"]}]
ClearAll[x,t];

Tamás Pölöskei

Squire: Tarantella

Length of one beat in seconds.

k=0.3;

Sound[{SoundNote[2,k*1/2,"Cello"],SoundNote[4,k*1/2,"Cello"],SoundNote[5,k*1/2,"Cello"],SoundNote[7,k*1/2,"Cello"],SoundNote[5,k*1/2,"Cello"],SoundNote[4,k*1/2,"Cello"],SoundNote[5,k*1,"Cello"],SoundNote[9,k*1/2,"Cello"],SoundNote[14,k*1,"Cello"],SoundNote[14,k*1/2,"Cello"],SoundNote[13,k*1,"Cello"],SoundNote[13,k*1/2,"Cello"],SoundNote[16,k*1,"Cello"],SoundNote[16,k*1/2,"Cello"],SoundNote[14,k*3/2,"Cello"],SoundNote[9,k*3/2,"Cello"],SoundNote[10,k*1/2,"Cello"],SoundNote[9,k*1/2,"Cello"],SoundNote[10,k*1/2,"Cello"],SoundNote[12,k*1/2,"Cello"],SoundNote[10,k*1/2,"Cello"],SoundNote[9,k*1/2,"Cello"],SoundNote[7,k*1/2,"Cello"],SoundNote[5,k*1/2,"Cello"],SoundNote[4,k*1/2,"Cello"],SoundNote[2,k*1/2,"Cello"],SoundNote[4,k*1/2,"Cello"],SoundNote[5,k*1/2,"Cello"],SoundNote[7,k*1,"Cello"],SoundNote[7,k*1/2,"Cello"],SoundNote[5,k*1,"Cello"],SoundNote[5,k*1/2,"Cello"],SoundNote[4,k*3/2,"Cello"],SoundNote[9,k*3/2,"Cello"]}]

Hyperlink["Youtube video","http://youtu.be/elHIkzKWcPI"]

I sincerely hope, that they will not remove from the website until next Monday.

Hyperlink["The cello score","https://drive.google.com/viewerng/viewer?a=v&pid=sites&srcid=ZnJlZHBhcnJ5Lm5ldHxjZWxsby1sZXNzb25zfGd4OjYzYzUyM2QwNjk5Y2VmN2Q"]

Carsten Olm

note={"C3","D3","E3","F3","G3","G3","A3","A3","A3","A3","G3","A3","A3","A3","A3","G3","F3","F3","F3","F3","E3","E3","G3","G3","G3","G3","C3"};
len={1/4,1/4,1/4,1/4,1/2,1/2,1/4,1/4,1/4,1/4,1,1/4,1/4,1/4,1/4,1,1/4,1/4,1/4,1/4,1/2,1/2,1/4,1/4,1/4,1/4,1};

freq=note;freq=ReplacePart[freq,Position[freq,x_/;x=="C3"]->130.813];
freq=ReplacePart[freq,Position[freq,x_/;x=="D3"]->146.832];
freq=ReplacePart[freq,Position[freq,x_/;x=="E3"]->164.814];
freq=ReplacePart[freq,Position[freq,x_/;x=="F3"]->174.614];
freq=ReplacePart[freq,Position[freq,x_/;x=="G3"]->198.998];
freq=ReplacePart[freq,Position[freq,x_/;x=="A3"]->220.000];

Length[note]
Length[len]
Sum[len[[i]],{i,1,Length[len],1}]

Speak["Dear teacher! Can you show me how do generate a melody from notes or frequencies with a certain length? I tried to use SoundNote and Do loops, but I wasn't succesful. I often realized in the last few weeks that counting"]
Speak[HoldForm[1+1]]
Speak["together, doesn't equal 2 in Mathematica"]

Sound@{SoundNote["C3",1/4],SoundNote["D3",1/4], SoundNote["E3",1/4],SoundNote["F3",1/4], SoundNote["G3",1/2],SoundNote["G3",1/2],SoundNote["A3",1/4],SoundNote["A3",1/4],SoundNote["A3",1/4],SoundNote["A3",1/4],SoundNote["G3"],SoundNote["A3",1/4],SoundNote["A3",1/4],SoundNote["A3",1/4],SoundNote["A3",1/4],SoundNote["G3"],SoundNote["F3",1/4],SoundNote["F3",1/4],SoundNote["F3",1/4],SoundNote["F3",1/4],SoundNote["E3",1/2],SoundNote["E3",1/2],SoundNote["G3",1/4],SoundNote["G3",1/4],SoundNote["G3",1/4],SoundNote["G3",1/4],SoundNote["C3"]}

As the help function shows, you can do fancy sounds with Play, but I found it too tedious to create melodies with this. However, it’s nice for sound manipulation, e.g.:

Manipulate[Play[Sin[ 2Pi fr t]Cos[r t],{t,0,l}],{{r,0,Button["'Waviness'",Speak["Waviness. It ranges from 0 to 5 in steps of 1. Modify and see what happens."]]},0,5,1},{{fr,400,Button["Frequency",Speak["Frequency. Its unit is Hertz and it ranges from 100 to 1000 in steps of 100."]]},100,1000,100},{{l,5,Button["Length",Speak["Length. It ranges from 1 to 10 in steps of 1."]]},1,10}]

Remarks

Always attach the necessary data files.

Include your name into any file you are sending me.

sn[X_,epoch_]:=SoundNote[ToString[X],epoch]

EmitSound[Sound[sn[C,0.5]]]

Inner[sn,{C,E,C},{0.5,0.5,1.5},List]

EmitSound@Sound@%

Inner[ff,{q,w,e},{r,t,u},gg]

Have a look at this:

Hyperlink["music","http://demonstrations.wolfram.com/search.html?query=music&start=41&limit=20"]

Try to rewrite in the most possibly concise way some of the above programs.

What about sol-fa?

Could you create a polyphonic tune?

Study the options of Speak.

Xuan Tran Thi

outspeak1 =  Speak["Count number 1 2 3 4 5"]

outspeak2 = Speak[Pause[5] Exp[x^2]+ 1]

outspeak3 = Speak[ Exp[x^2]+ 1]

outspeak4= Speak[x^2+ 1]

outspeak5= Speak[x^2]

Carsten Olm

I used some Speak in the above task. Unfortunately I was too lazy and rather liked to listen to some pop songs like Rihanna’s

u="Under my Umbrella";
Speak[u]

Do[Speak[StringTrim[u,("Under my Umbr")]],{2}]

Do[Speak[StringTrim[u,("Under my Umbr"|"lla")]<>"h"],{3}]

Bence Bogdola

Button["Press for the solution of this task!",Speak["I have inspected the options of the speak command thoroughly. I found out that it can be useful if it is utilized with the SpokenString command."]]

Bence Tipary

Options@Speak

Speak["I can read this text aloud"]

Speak[Log[x]+((Sin[x])^2)]

Speak[HoldForm[1+1]]

Speak[1+1]

Speak[HoldForm["string one string two string three"],"StringLengthLimit"->6]

Speak[N[Pi],"RealPrecisionLimit"->4]

Speak[123457/234567,"IntegerLimit"->1000]

Speak[Sqrt[x/(y+z)],"IncludeParentheses"->True]

Speak[Sqrt[x/(y+z)]]

Speak[HoldForm[1 2 3 4 5 6 7 8 9 10],"ArraySizeLimit"->4]

Speak[Graphics3D[Disk[]],"DetailedGraphics"->True]

Speak[{{{a,b,c},{d,e,f}}}]

Speak[{{{a,b,c},{d,e,f}}},"ExpressionDepthLimit"->2]

Remark

Interesting demonstrations: Book Reader, Nonsense Sequence Generator

Statistics

Statistics: 1) Branch of science 2) Function defined on samples

Sampling

Methods of sampling, representativity

Hyperlink["representsativity","http://www.math.upenn.edu/~deturck/m170/wk4/lecture/case1.html"]

Simple, random sampling, two-stage, layered, grouped etc.

Abraham Wald : sequential sampling

Hyperlink["Abraham Wald","http://en.wikipedia.org/wiki/Sequential_analysis"]

RandomSample

{BlockRandom[RandomSample[Range[10]]],RandomSample[Range[10]]}

RandomChoice[ConstantArray[1/6,6]->Range[6],8]

Statistics

EmpiricalDistribution

data=RandomVariate[NormalDistribution[],50];

𝒟=EmpiricalDistribution[data];

{DiscretePlot[PDF[𝒟,x],{x,data}],DiscretePlot[CDF[𝒟,x],{x,-4,4,.01}]}

The first figure above should not be the histogram!

Histogram[data,7]

Sample mean, ordered statistics, s. median, emp. variance, corrected, mean deviation, rel deviation, moments, s. range

orderedStatistics[dat_]:=Sort[dat]

ListPlot[orderedStatistics[data]]

Relative deviation:= (s/(OverTilde[x])) (useful for the experimentalist, not easy to deal with for the mathematician)

Location parameters

Mode,Mean,HarmonicMean

Wages: use Median

Times: use HarmonicMean

Dispersion parameters

Variance

?*Range*

?*Deviation

sampleRange[l_List]:=Max[l]-Min[l]

QuartileDeviation[NormalDistribution[]]

N[%]

Mode

Estimation

We have a normal variable. How do we estimate its expected value or its variance? Corrected empirical variance.

We have a binomial variable. How do we estimate its parameter?

m, σ, p

Properties

Whe do we say that an estimate is good?

Unbiased, efficient, consistent, sufficient

Methods

How do we construct statistics?

Maximim likelihood method

Suppose we had k successes among n trials. How do we estimate the parameter of the binomial distribution? Let the estimate (OverHat[p]) be chosen so as to maximize the probability of the actual outcome of the experiment, i.e. let

f[p_]:=Binomial[n,k](p^k)(((1-p))^(n-k))

and find the maximum of f. It turns out to be (k/n), quite a natural choice, isn´t it?

Method of moments

Interval estimates (confidence or fiducial intervals)

Hypothesis testing

(Subscript[H, 0]):E(ξ)=m   σ is known.

Quartiles

qlow=Quantile[NormalDistribution[17.,1],0.025]

qhigh=Quantile[NormalDistribution[17.,1],0.975]

Integrate[PDF[NormalDistribution[17,1],x],{x,qlow,qhigh}]

Plot[PDF[NormalDistribution[17,1],x],{x,10,24},AspectRatio->1/5,Filling->Axis, Epilog->{Line[{{qlow,0},{qlow,PDF[NormalDistribution[17,1],qlow]}}],Line[{{qhigh,0},{qhigh,PDF[NormalDistribution[17,1],qhigh]}}]}]

If the sample mean lies between qlow and qhigh then we accept the null hypothesis, otherwise we reject it.

For the comparison of two continuouos distributions use this :

KolmogorovSmirnovTest

?*Test

Programming notes

Lists (Period doubling bifurcation)

How to create the cobweb of the discrete logistic equation?

Riffle[{aa,bb,cc,dd},{ee,ff,gg,hh}]

palya={x0,fx0,ffx0,fffx0};

t1=Transpose[{palya,palya}]

Drop[palya,-1]

Drop[palya,1]

t2=Transpose[{Drop[palya,-1],Drop[palya,1]}]

Riffle[Most[t1],t2]

An even simpler solution follows.

Partition[Flatten[t1],2,1]

palya will be constructed using NestList.

Hyperlink["A good introductory paper about chaos with more biology than mathematics.","http://isites.harvard.edu/fs/docs/icb.topic1313269.files/Lecture22/May_Simple%20mathematical%20models%20with%20very_76.pdf"]

Magyarul : Nagyon bonyolult dinamikájú egyszerű matematikai modellek, Alkalmazott Matematikai Lapok 8 (1982), 427-446.

See also Pick and Distribute.