Chapter 32 Parameters dependence on g
32.0.1 2par Kiso 1 Kcot
Kisodf=P[0]M20E2−M2r
kmcotδ=1a0m
fitting Γ=gn
χ2= 0.499318
n= 1.731639
fitting M2R=gn
<- nls(MR2~a+b*g/(1 +d*g) ,data=df, weights=df$dMR2, start=list(a=9.2, b=-0.05 , d=1))
fit <- myggplot()
gg<- geom_error(gg=gg, x=df$g, y=df$MR2, dy=df$dMR2, width=0.7)
gg
<-data.frame("g"=c(0:20))
sp<- gg+ geom_line(aes(x=sp$g, y=predict(fit,sp)), color="red")
gg<- sum(((residuals(fit)/weights(fit))^2)/df.residual(fit))
chi2
cat("$\\chi^2=$",chi2,"\n\n")
χ2= 1.031278
<-myplotly(gg,"","g","$M_R^2$", to_print = TRUE) fig
32.0.2 3par Kiso 1 Kcot
Kisodf=P[0]M20E2−M2r+P[2]
kmcotδ=1a0m
fitting Γ=gn
χ2= 1.185918
n= 1.78097
fitting M2R=gn
<- nls(MR2~a+b*g/(1 +d*g) ,data=df, weights=df$dMR2, start=list(a=9.2, b=-0.05 , d=1))
fit <- myggplot()
gg<- geom_error(gg=gg, x=df$g, y=df$MR2, dy=df$dMR2, width=0.7)
gg
<-data.frame("g"=c(0:20))
sp<- gg+ geom_line(aes(x=sp$g, y=predict(fit,sp)), color="red")
gg<- sum(((residuals(fit)/weights(fit))^2)/df.residual(fit))
chi2
cat("$\\chi^2=$",chi2,"\n\n")
χ2= 0.297934
<-myplotly(gg,"","g","$M_R^2$", to_print = TRUE) fig