Talk:Hypergamy: Difference between revisions

Jump to navigation Jump to search
54 bytes added ,  28 September 2021
Line 73: Line 73:


<code>
<code>
from numpy import exp
  from numpy import exp
def rhode(x,b): return x*(b-1)/(b-x)
  def rhode(x,b): return x*(b-1)/(b-x)
def chotikapanich(x,b): return (exp(b*x)-1)/(exp(b)-1)
  def chotikapanich(x,b): return (exp(b*x)-1)/(exp(b)-1)
def pareto(x,b): return 1-(1-x)**(1-1/b)
  def pareto(x,b): return 1-(1-x)**(1-1/b)
import matplotlib.pyplot as plt
 
from scipy.optimize import curve_fit
  import matplotlib.pyplot as plt
from numpy import array
  from scipy.optimize import curve_fit
xdata = array([0,0.5,0.9,0.95,0.99,1])
  from numpy import array
ydata = array([0,0.043,0.42,0.589,0.836,1])
 
def demo(func):
  xdata = array([0,0.5,0.9,0.95,0.99,1])
  plt.plot(xdata, ydata, 'b-', label='data')
  ydata = array([0,0.043,0.42,0.589,0.836,1])
  popt, pcov = curve_fit(func, xdata, ydata, bounds=(0, 1000))
 
  plt.plot(xdata, func(xdata, *popt), 'r-',
  def demo(func):
          label='fit: b=%5.3f' % tuple(popt))
    plt.plot(xdata, ydata, 'b-', label='data')
  plt.xlabel('x')
    popt, pcov = curve_fit(func, xdata, ydata, bounds=(0, 1000))
  plt.ylabel('y')
    plt.plot(xdata, func(xdata, *popt), 'r-',
  plt.legend()
            label='fit: b=%5.3f' % tuple(popt))
  plt.show()
    plt.xlabel('x')
demo(rhode)
    plt.ylabel('y')
demo(chotikapanich)
    plt.legend()
demo(pareto)
    plt.show()
 
  demo(rhode)
  demo(chotikapanich)
  demo(pareto)
</code>
</code>


Also extending this to the Tinder Distribution Study, 5.952 C-index works better than 1.119 as Rhode's coefficient, as Rhode's often underpredict the power of the top 20% of men.
Also extending this to the Tinder Distribution Study, 5.952 C-index works better than 1.119 as Rhode's coefficient, as Rhode's often underpredict the power of the top 20% of men.
398

edits

Navigation menu