sarahf60
10-24-2013, 04:01 AM
hi
I'm writing a code to fit some values with one standard function which I have to use Levenberg method (mrqmin subroutine) my function is
fi_expected(I)=D*fi_star*10**(0.4*(alpha+1)*(M_sta r-Magbin(I)))*exp(-10**(0.4*(M_star-Magbin(I))))
and I need to estimate the " fi_star , alpha , M_star "
has any one run this subroutine and help me precisely how I should define the "a , covar, maska ... " parameters for this subroutine?
do I=1,b
read (1,*) Nrow(I),iz(I),Nbin(I),fi(I),fiStdDev(I),fiAvr(I),M agbin(I),zup(I)
fiStdDev2(I)=fiStdDev(I)*fiStdDev(I)
RfiStdDev2(I)=1/fiStdDev2(I)
fi_expected(I)=D*fi_star*10**(0.4*(alpha+1)*(M_sta r-Magbin(I)))*exp(-10**(0.4*(M_star-Magbin(I))))
DFI(I)=fi_expected(I)-FI(I)
CHISQ(I)=DFI(I)*DFI(I)*RfiStdDev2(I)
call mrqmin(Magbin(I),fi(I),fiStdDev(I),a,maska,covar,a lpha,CHISQ(I),funcs,alamda)
end do
I'm writing a code to fit some values with one standard function which I have to use Levenberg method (mrqmin subroutine) my function is
fi_expected(I)=D*fi_star*10**(0.4*(alpha+1)*(M_sta r-Magbin(I)))*exp(-10**(0.4*(M_star-Magbin(I))))
and I need to estimate the " fi_star , alpha , M_star "
has any one run this subroutine and help me precisely how I should define the "a , covar, maska ... " parameters for this subroutine?
do I=1,b
read (1,*) Nrow(I),iz(I),Nbin(I),fi(I),fiStdDev(I),fiAvr(I),M agbin(I),zup(I)
fiStdDev2(I)=fiStdDev(I)*fiStdDev(I)
RfiStdDev2(I)=1/fiStdDev2(I)
fi_expected(I)=D*fi_star*10**(0.4*(alpha+1)*(M_sta r-Magbin(I)))*exp(-10**(0.4*(M_star-Magbin(I))))
DFI(I)=fi_expected(I)-FI(I)
CHISQ(I)=DFI(I)*DFI(I)*RfiStdDev2(I)
call mrqmin(Magbin(I),fi(I),fiStdDev(I),a,maska,covar,a lpha,CHISQ(I),funcs,alamda)
end do