Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)

I am having the below data frame:

X   Y

3.53    0

4.93    50

5.53    60

6.21    70

7.37    80

9.98    90

16.56   100

From the above, I need to get the n so that this can be fit to a function of the form:

enter image description here

I am working on to get the value of n by Box-Cox transformation. How can this be achieved in Python?

1 Answer

0 votes
by (108k points)

I believe you want something like scipy.stats.boxcox.

from scipy import stats

import numpy as np

data = np.fromstring('3.53    0 4.93    50 5.53    60 6.21    70 7.37    80 9.98    90 16.56   100', sep=' ').reshape(7, 2)

stats.boxcox(data[0,])

(array([ 0.91024309,  1.06300488,  1.10938333,  1.15334193,  1.213348  ,

     1.30668122,  1.43178909]), -0.54874593147877893)

Interested in learning Python? Enroll in our Python training course!

 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...