git.schokokeks.org
Repositories
Help
Report an Issue
SS2012-StatisticalMethods.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6b93c51
Branches
Tags
master
SS2012-StatisticalMethods.git
3
speczeroing.r
new fiels
Michi
commited
6b93c51
at 2012-06-03 16:52:14
speczeroing.r
Blame
History
Raw
#1 spec = read.table("M100_spec.txt",header=FALSE) spec.boolmask = (21 > spec[,2]) & (spec[,2] >17) spec.zero = spec spec.notnull = (spec[,2] != 0) spec.fit <- lm(spec[spec.boolmask,2] ~ spec[spec.boolmask,1]) spec.zero[,2]=(spec[,2])-coef(spec.fit)[1] #2 y=spec.zero[622:646,2] x=spec.zero[622:646,1] gbin <- cbind(spec.zero[622:646,]) Sigma= var(gbin) mu = apply(gbin,2,mean) gcoeffs <-nls(y~(b/a)*exp(-(x-6599.2820)^2/(2*a**2)),start=list(a=1,b=200), trace=TRUE) yg=(231.24/1.73)*exp(-(x-6599.2820)^2/(2*1.73**2)) plot(spec.zero[spec.notNull,1],spec.zero[spec.notNull,2],'l') lines(x,yg,col='red')