# generate this whole file by running the following command:
# rake regression:generate_calculated_deduct_coefficients_file > lib/pavement_condition_index/lookups/calculated_deduct_coefficients.rb

module PavementConditionIndex
  module Lookups
    class CalculatedDeductCoefficients

# Output of `rake regression:generate_deduct_coefficients`
COEFFICIENTS = 
{:asphalt=>
  {:alligator_cracking=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[11.81030706543641, 14.716555458137659, 5.254969146645571],
       :medium=>[21.641468980402742, 19.850106754347717, 4.129291159183641],
       :high=>
        [30.698348853111792,
         26.819142548270502,
         5.653897800825902,
         -2.0562458038186975]}},
   :bleeding=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [0.322105531453021,
         -0.174525478036764,
         1.504981533364469,
         1.7947851128512355],
       :medium=>
        [3.3241213258799234,
         4.4914393599717854,
         3.3913394399693146,
         1.7791635264801178],
       :high=>
        [5.739963736596728,
         7.319479502282341,
         7.086578195546586,
         3.075398183100246]}},
   :block_cracking=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[-0.24506618985589634, 3.5865225127793514, 4.864809264954378],
       :medium=>[2.0044867717721253, 7.656841349922775, 6.197308536458376],
       :high=>[6.054836363905478, 14.23908143225682, 9.26078972426816]}},
   :bumps_and_sags=>
    {:valid_min=>0.1,
     :valid_max=>10.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [7.432162927047138,
         13.039704473951343,
         12.681378093050206,
         5.724727901683913],
       :medium=>
        [24.0510616920146,
         24.990801854094467,
         17.775330890078287,
         10.801916366371941],
       :high=>[53.60256635094115, 38.448582442650476, 6.043250542072165]}},
   :corrugation=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[2.079645270606063, 6.171432244797827, 6.315591279321682],
       :medium=>[16.00629930412681, 17.42721794385406, 5.877793175640937],
       :high=>[33.3926340071105, 25.16870941731629, 2.8124490453717783]}},
   :depression=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [3.289661412212115,
         0.6252836980242593,
         10.964451357494776,
         6.985101871322738,
         -3.5060456381316634],
       :medium=>
        [7.614400618717246,
         3.769091495110122,
         15.559272647446328,
         7.4759184063961435,
         -4.844857281255507],
       :high=>
        [15.948684201140967,
         9.394030228694518,
         15.510038701741792,
         6.024061067798476,
         -4.422031207577385]}},
   :edge_cracking=>
    {:valid_min=>0.1,
     :valid_max=>20.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[3.211409886900335, 4.962171357579026, 2.4025247047022504],
       :medium=>[9.38292671744566, 9.608124129013511, 4.3396040463768015],
       :high=>[15.664668848033116, 15.377839697997818, 7.293639747414968]}},
   :joint_reflection_cracking=>
    {:valid_min=>0.1,
     :valid_max=>30.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[2.599637864741199, 7.548320214895041, 6.035620574755107],
       :medium=>
        [7.381829148226155,
         13.409513965059839,
         14.487037415701224,
         2.604980254156252,
         -4.850878879939305],
       :high=>
        [15.708313735606989,
         21.751135896400438,
         22.35224402708013,
         12.321810537440612,
         -6.404620335343928,
         -4.635950974262599]}},
   :lane_shoulder_drop_off=>
    {:valid_min=>0.5,
     :valid_max=>15.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[1.7330434661503789, 2.2479876898054147, 8.492414136167602],
       :medium=>[3.1018055744999637, 0.9748217115112947, 15.880585262031168],
       :high=>[5.588313880268777, 5.140183474398842, 22.853461108687]}},
   :longitudinal_transverse_cracking=>
    {:valid_min=>0.1,
     :valid_max=>30.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[2.1831950830355784, 8.216281290902756, 6.454535216997481],
       :medium=>[8.67907975505781, 15.31510859022643, 6.266899017617167],
       :high=>
        [17.723256518500968,
         24.494224894065376,
         19.119102009732657,
         4.182799471044728,
         -4.54528270804704]}},
   :patching_and_utility_cut_patching=>
    {:valid_min=>0.1,
     :valid_max=>50.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[1.8384973325128793, 7.632382033226324, 6.507032451977727],
       :medium=>[8.929258996532853, 14.056348057074333, 8.632199015982204],
       :high=>
        [18.05379050800971,
         18.570848940912526,
         15.195881745184764,
         4.634730303593308,
         -4.282412070934171]}},
   :polished_aggregate=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [0.16789523734739448,
         -0.1540196727901293,
         1.3119789947979732,
         1.8893029190226103],
       :medium=>
        [0.16789523734739448,
         -0.1540196727901293,
         1.3119789947979732,
         1.8893029190226103],
       :high=>
        [0.16789523734739448,
         -0.1540196727901293,
         1.3119789947979732,
         1.8893029190226103]}},
   :potholes=>
    {:valid_min=>0.01,
     :valid_max=>10.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [58.574736886209024,
         41.33443795417745,
         2.307796828048822,
         -2.1009955078236295],
       :medium=>
        [91.64010353001909,
         65.40209466565399,
         5.262639941411422,
         -3.0315939096971647],
       :high=>
        [109.3323221736685,
         56.29275767507379,
         -0.3934988005267144,
         -3.0772594822340906]}},
   :railroad_crossing=>
    {:valid_min=>1.0,
     :valid_max=>40.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[0.5029257285845483, 5.749904110236876, 3.9821246564884927],
       :medium=>
        [5.254000147362391,
         11.422544085878982,
         37.11519773645627,
         -16.910805393020667],
       :high=>
        [19.340445737998966,
         18.23862361469355,
         53.47893872454435,
         -25.833753655092053]}},
   :raveling=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[1.3364599508023929, 2.5381741896122354, 2.2521180739800015],
       :medium=>
        [8.547489838241672,
         5.50999488268751,
         2.8976928296955693,
         1.6574499250743635],
       :high=>
        [15.287212880590612,
         12.713212203226831,
         11.470876324575428,
         5.038585870016526,
         -3.053732169374685]}},
   :rutting=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [7.166892989037484,
         15.480212329682374,
         7.204541988003889,
         -2.056356612335577],
       :medium=>
        [17.07939650585985,
         23.042120387468632,
         7.267187817332259,
         -2.992255156045317],
       :high=>
        [26.55168225206831,
         25.25096737467123,
         9.616695504985966,
         2.709242740203141,
         -2.9515698599184823]}},
   :shoving=>
    {:valid_min=>0.1,
     :valid_max=>50.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[4.413031420403843, 10.016571238629226, 5.535372489599174],
       :medium=>[9.294794348392088, 16.13985140155734, 10.13135831372187],
       :high=>
        [17.76171628163815,
         19.396982653439373,
         15.785981300450224,
         3.016185582467493,
         -3.721051791249142]}},
   :slippage_cracking=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>
        [4.248092940884805,
         14.667313248550373,
         9.293396804566436,
         -2.1419610585945215],
       :medium=>
        [10.838179259718574,
         20.247013730206078,
         13.130140952344512,
         -0.24505223183555103,
         -2.039447457156605],
       :high=>
        [17.75416989366112,
         32.470845743485654,
         29.87775942697452,
         -5.259819524132407,
         -13.039225691175872,
         4.346079607761759]}},
   :swell=>
    {:valid_min=>1.0,
     :valid_max=>30.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[0.2776553410390519, 12.183535319307815],
       :medium=>[9.7262404794108, 26.04919313918952],
       :high=>[33.021164499056795, 9.27090451459351, 10.656396250845475]}},
   :weathering=>
    {:valid_min=>0.1,
     :valid_max=>100.0,
     :chart_type=>:log,
     :coefficients=>
      {:low=>[1.3364599508023929, 2.5381741896122354, 2.2521180739800015],
       :medium=>
        [8.547489838241672,
         5.50999488268751,
         2.8976928296955693,
         1.6574499250743635],
       :high=>
        [15.287212880590612,
         12.713212203226831,
         11.470876324575428,
         5.038585870016526,
         -3.053732169374685]}}},
 :concrete=>
  {:blow_ups=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>
        [-0.13356643356627984, 0.9327226107226047, -0.0049254079254079045],
       :medium=>
        [2.4678321678324604, 1.7452051282051162, -0.009509324009323961],
       :high=>
        [16.460695189802276,
         6.6234309223033865,
         -0.32266835566470364,
         0.00886184309861393,
         -0.00012927981986135247,
         9.488216405626576e-07,
         -2.75408495568297e-09]}},
   :durability_cracking=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[-0.4342657342656646, 0.4144662004661978, -0.0018228438228438133],
       :medium=>
        [1.162237762237912, 0.8913053613053554, -0.0047948717948717735],
       :high=>
        [1.078321678321716,
         2.3633139083138457,
         -0.030009906759907102,
         0.00013358585858586812]}},
   :corner_break=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[-0.3293706293704677, 0.9791701631701566, -0.004722610722610701],
       :medium=>
        [-0.2783216783214355,
         1.7891647241646425,
         -0.018065268065267835,
         6.592851592852108e-05],
       :high=>
        [1.288811188811378,
         2.4348756798755913,
         -0.027701631701631733,
         0.00011231546231547056]}},
   :faulting=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>
        [-0.3461538461541296,
         0.1409790209795434,
         0.017863053613043127,
         -0.00030944055944033804,
         1.4743589743585815e-06],
       :medium=>
        [-0.41468531468475955,
         0.8501670551669466,
         0.00022144522144634804,
         -3.360528360528539e-05],
       :high=>
        [0.3237762237764841, 1.5706270396270294, -0.007441724941724908]}},
   :divided_slab=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.05061547720434412, 1.0602363029053457, -0.005630494431710011],
       :medium=>
        [0.03647951619436718,
         3.3746231782018343,
         -0.1114761630583947,
         0.0021410940640768225,
         -1.957710432519595e-05,
         6.694382078015655e-08],
       :high=>
        [0.46219912502630667,
         3.7822323563200992,
         -0.07844357814094624,
         0.000796815874702947,
         -2.9932729934080204e-06]}},
   :joint_seal_damage=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[1.9999999999999998, 1.734723475976807e-17],
       :medium=>[3.9999999999999996, 3.469446951953614e-17],
       :high=>[7.999999999999999, 6.938893903907228e-17]}},
   :lane_shoulder_drop_off=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.8045454545454546, 0.05318181818181822],
       :medium=>[1.0020979020979717, 0.412799533799531, -0.002383449883449871],
       :high=>
        [1.5426573426574572, 0.6763379953379907, -0.003817016317016299]}},
   :patching_small=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.290909090909091, 0.04890909090909093],
       :medium=>
        [-0.9902097902097355, 0.3280745920745899, -0.0015571095571095491],
       :high=>
        [-0.0433566433565602, 0.5040722610722577, -0.002474358974358961]}},
   :linear_cracking=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.5398601398602301, 0.540675990675987, -0.003179487179487164],
       :medium=>
        [1.3741258741259887, 0.6791188811188766, -0.0031748251748251613],
       :high=>
        [0.42867132866409063,
         2.1563908313932947,
         -0.044027972028047216,
         0.00047105672105791094,
         -1.8181818181858345e-06]}},
   :polished_aggregate=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[1.6272727272727279, 0.09527272727272733],
       :medium=>[1.6272727272727279, 0.09527272727272733],
       :high=>[1.6272727272727279, 0.09527272727272733]}},
   :patching_large_and_utility_cuts=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[-1.3692307692306875, 0.4911305361305329, -0.001952214452214441],
       :medium=>
        [-1.6265734265732865, 0.8520745920745864, -0.003466200466200449],
       :high=>
        [0.31328671328703894,
         1.736814296814201,
         -0.017210372960372575,
         7.107614607615057e-05]}},
   :popouts=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.959090909090909, 0.163909090909091],
       :medium=>[0.959090909090909, 0.163909090909091],
       :high=>[0.959090909090909, 0.163909090909091]}},
   :pumping=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>
        [-0.21048951048939823, 0.6700326340326295, -0.0028857808857808715],
       :medium=>
        [-0.21048951048939823, 0.6700326340326295, -0.0028857808857808715],
       :high=>
        [-0.21048951048939823, 0.6700326340326295, -0.0028857808857808715]}},
   :punchouts=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>
        [0.23916083916105269,
         1.5800194250193544,
         -0.015674825174824977,
         5.3302253302257776e-05],
       :medium=>
        [0.39300699299788633,
         2.807282439785469,
         -0.05446882284391663,
         0.0005626068376083245,
         -2.281468531473641e-06],
       :high=>
        [0.41538461537338645,
         3.5455419580456358,
         -0.07212266899778302,
         0.0007346736596754574,
         -2.8175990676052593e-06]}},
   :railroad_crossing=>
    {:valid_min=>0.0,
     :valid_max=>60.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.6833333333333371, 0.8607142857142842, -0.006476190476190441],
       :medium=>
        [0.1285714285707984,
         2.2037301587302798,
         -0.04358333333333836,
         0.0003472222222222999],
       :high=>
        [0.33809523809302156,
         8.013373015879024,
         -0.3216250000004167,
         0.005897222222234228,
         -3.8750000000108535e-05]}},
   :scaling_map_cracking_crazing=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[-0.06853146853142666, 0.248659673659672, -0.001327505827505821],
       :medium=>
        [0.46013986013996666,
         0.8226573426573058,
         -0.008888694638694558,
         3.712121212121473e-05],
       :high=>
        [0.29160839160132745,
         2.0888636363660593,
         -0.04204050116557495,
         0.00045110722610839597,
         -1.7511655011694358e-06]}},
   :shrinkage_cracks=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[-0.17727272727272714, 0.045727272727272755],
       :medium=>[-0.17727272727272714, 0.045727272727272755],
       :high=>[-0.17727272727272714, 0.045727272727272755]}},
   :spalling_corner=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>[0.5636363636363639, 0.16127272727272735],
       :medium=>
        [-1.039160839160767, 0.44085314685314403, -0.002013986013986005],
       :high=>[0.945454545454647, 0.605181818181814, -0.003136363636363623]}},
   :spalling_joint=>
    {:valid_min=>0.0,
     :valid_max=>100.0,
     :chart_type=>:linear,
     :coefficients=>
      {:low=>
        [-0.2825174825174346, 0.28762237762237564, -0.0015944055944055865],
       :medium=>
        [-0.09580419580411226, 0.5094778554778521, -0.0025547785547785406],
       :high=>
        [1.0006993006994707,
         1.482397047396983,
         -0.016978438228438142,
         7.73698523698574e-05]}}}}
    end
  end
end
