solving power-law fit coefficient

validate the result of excel trend analysis.

scatter plot ==>

load OCTAVE in linux


octave:1> x=load ./octx.dat
x =

   31.180
   46.770
   62.070
   78.690
   93.990
   31.330
   46.550
   62.660
   77.590
   94.430
   31.180
   46.550
   62.960
   76.850
   93.100
   31.630
   46.770
   62.960
   79.800
   94.430
   30.440
   44.330
   60.300
   74.630
   90.000
   31.630
   48.770
   63.550
   79.800
   96.650

octave:2> y=load ./octy.dat
y =

   43.0000
   16.5000
    8.0000
    6.0000
    4.5000
   20.0000
    8.5000
    5.5000
    4.5000
    3.5000
   16.0000
    8.0000
    7.0000
    6.0000
    4.5000
   29.5000
   12.5000
    5.5000
    3.5000
    5.0000
   41.5000
   15.0000
    9.0000
    6.5000
    5.5000
   22.0000
   11.0000
    6.0000
    5.5000
    3.5000

octave:3> x
x =

   31.180
   46.770
   62.070
   78.690
   93.990
   31.330
   46.550
   62.660
   77.590
   94.430
   31.180
   46.550
   62.960
   76.850
   93.100
   31.630
   46.770
   62.960
   79.800
   94.430
   30.440
   44.330
octave:4> y
y =

   43.0000
   16.5000
    8.0000
    6.0000
    4.5000
   20.0000
    8.5000
    5.5000
    4.5000
    3.5000
   16.0000
    8.0000
    7.0000
    6.0000
    4.5000
   29.5000
   12.5000
    5.5000
    3.5000
    5.0000
   41.5000
   15.0000
octave:5> P=polyfit(log(x),log(y),1)
P =

  -1.6823   8.9860

octave:6> c=exp(P(2))
c =  7990.5
octave:7>

댓글

가장 많이 본 글