[R] lmom - Estimating Normal Distribution Parameters using lmom package

J. R. M. Hosking JRMH001 at gmail.com
Tue Jul 21 16:13:03 CEST 2009


Maithili Shiva wrote:
> Dear R helpers,
>  
> I have a data of 2102 observations (consisting of 0's also), to which I am trying to fit Normal distribution using "lmom" pacakage. If I use Excel, its easy to estimate the parameters of Normal distribution as simple mean and standard devaition. The results I get if I use teh excel are as 
>  
> Parameters of Normal distribution :-
>  
> Mean = 22986.44 and standard deviation = 223452.88
>  
> However, if I use the R code using the lmom package, I get the mean as 22986.39 and standard deviation as 39029.79.
>  
> Regards
>  
> Maithili
>  
> My R code is as follows. (Actually its a two line code, but since I am representing data using 'c', the code looks too big.)
>  
>  
> library(lmom)
>  
> amounts <-
>  c(0,0,18561.9,0,0,0,34400,0,0,0,0,2190,0,0,0,0,60000,0,0,0,19583,0,0,0,109872.87,0,0,0,0,0,0,1244,0,0,25150,0,500,0,0,0,0,0,0,0,100,0,0,0,0,0,0,500,41533.94,1365,0,0,11400,0,0,0,0,0,10000,0,0,11000,0,0,0,0,0,0,11600,0,0,0,21530,0,2000,0,10100,4500,5000,0,0,10000,0,28667,0,0,0,45000,0,0,0,0,0,100,0,0,2100,0,0,0,1000,0,0,0,0,17000,0,0,0,0,0,0,0,0,140270,2000,0,1900678.25,19450,0,0,4400,0,0,0,6136,0,0,0,0,0,0,0,0,0,0,0,0,0,20900,0,0,525,8306,0,0,0,0,0,9497,0,291264,0,0,0,0,0,2825,0,0,0,0,0,75000,0,0,0,0,0,6000,4300,3062,0,0,159649,0,0,61329,0,0,0,0,0,0,0,0,0,214816,0,0,0,0,0,0,0,1200,0,0,10364,0,0,0,300,0,0,0,0,0,156888,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,1164.55,0,0,0,0,0,0,0,0,540,0,0,0,460.52,0,0,0,0,0,0,0,0,0,0,0,500,0,0,0,0,540,500,15000,0,0,0,0,6400,0,0,0,2900,7200,0,0,0,0,400,0,800,0,500,0,0,0,0,0,0,13550,0,0,40410,100,0,0,0,0,5818,50700,0,0,0,0,0,0,0,0,4800,0,0,0,0,0,0,0,0,0,0,0,500,0,0,0,0,0,0,0,0,0,0,0,0,0,133.29,0,5750,100,0,0,0,0,0,0,0,2116,3165.7
> 4,0,0,14554,2700,0,151869,0,0,0,0,6400,0,0,15827.73,0,0,0,0,0,0,0,235607.56,0,0,0,0,225.65,0,0,0,0,725.04,0,0,0,0,151869,0,0,0,0,0,0,0,46800,0,0,0,0,0,3520,50000,0,0,0,0,2790,0,0,800,0,0,0,0,0,0,0,0,156.66,0,0,0,0,0,0,2200,0,357,0,283205,3466.26,0,503875,0,328681.27,0,0,0,0,1000,3600,12050,1000,0,0,0,0,0,0,0,0,0,0,0,0,121.44,0,1485,0,0,5100,0,937675,0,0,0,0,0,356.87,0,12923.56,9576,0,0,207879,0,0,0,1989,0,0,10233,207.55,1322,0,0,0,0,2320.38,0,0,6440,6111,82463,0,0,0,132.84,0,0,0,0,0,0,96161.74,0,0,0,0,0,0,271.16,0,0,0,0,225.83,0,0,0,0,0,0,0,0,0,17398,0,0,0,0,0,0,0,0,0,0,0,260.61,0,0,0,0,0,0,0,0,412.14,0,0,0,0,102.21,170420,29465,0,0,0,0,0,20819.21,0,10056,26200,0,2975.81,7199.83,0,0,0,2650,0,0,0,0,0,0,0,0,101.57,9000,0,0,105,0,774099.69,0,235.28,0,247.63,0,0,0,0,25761.56,13483,0,0,170.72,0,0,137.3,180.02,0,17555,0,0,0,468.29,0,0,0,154.51,0,0,11200,0,0,0,0,0,130.89,0,3927.38,0,0,0,0,0,1307.78,0,0,2869.32,1642.74,0,0,0,0,401.41,0,0,0,0,12503.86,10366.19,0
> ,124358,0,0,37953.17,0,1009.74,0,12110,1046.9,0,5610,3118.39,0,5682.04,0,0,0,1905.77,7707.59,0,3264.68,0,797.7,0,2371.42,0,0,7279.16,1093.15,0,0,1066510.66,8979.86,2989.93,129.92,0,1095.61,0,1125.01,20499.51,2240.99,0,0,3353.65,0,0,1129.23,0,2155.72,4000,800.56,0,0,0,1736.44,5584.1,1899.55,1334.25,239925,200768.55,560.61,11037,4739.74,1953.09,174.18,0,112.53,0,0,831.75,0,800.78,0,23877.68,0,1235.74,950,73796.05,9065.76,0,828.12,0,112.12,94637.19,0,1565.34,0,0,27121.17,53940,84872.23,0,0,0,0,0,0,116.83,0,0,0,0,114.17,0,0,886.28,5820,0,0,0,0,4888,0,0,0,0,0,1138.89,0,621.47,177513.55,0,531.32,50000,0,0,897,0,0,0,0,0,20000,0,0,0,188474,0,743.24,0,0,958.16,0,0,12321,561.36,0,0,1947.76,0,4262.85,2478632.75,0,0,0,4671.33,0,0,2985.59,0,0,0,0,0,0,0,0,0,0,10952.18,0,0,0,63505.07,5656.89,0,1609.95,0,0,1267,0,6355.59,1350,1708.71,0,951.67,0,0,0,0,908.81,0,0,0,0,0,0,1130.1,0,0,0,4453.55,0,0,12394,0,0,0,0,2886.8,0,0,81147,0,0,0,0,13958.46,1440,112453.28,11800,0,0,0,5
> 00,2399.96,0,0,2953,0,2000,0,0,0,6288.88,1375.95,13093,38726.88,0,122.8,0,2455.27,0,233549.36,0,0,0,0,0,0,0,0,4906.52,0,0,0,26160,0,309.22,0,0,0,0,0,21500,7257.68,0,0,0,18069,0,23625,0,28673.9,0,0,200000,0,0,5031.4,1096.59,0,0,836.39,8818,0,0,0,0,0,227.65,48775.83,0,0,124.8,3870.2,0,2596.91,203.44,0,0,0,0,0,352643.58,0,792.92,5000,0,417.93,0,0,0,1900,0,0,309.41,0,0,0,214.71,0,405.84,0,0,0,0,0,324.63,133.96,0,0,806.64,500,245258.43,210,0,0,0,0,0,2638.06,0,0,0,0,34914,32571,0,0,0,0,0,42925.37,1979.87,1667,0,7546.64,0,0,
> 0,0,0,500,1667,3079877.63,0,0,0,186500,0,201.18,0,0,392.88,0,0,8780.5,20424..14,272284.9,0,10822,2871.27,0,0,0,1450,0,0,28,4164,0,1571.74,0,0,839.56,259278.95,12880,0,0,319,0,7287,0,0,0,0,0,0,0,110,0,40968.56,442,0,0,0,255,0,168.57,0,2500,0,0,375652.22,2222.12,0,0,0,0,9485,1332,0,116.02,16552.68,0,0,8700.94,0,0,0,2587.5,50445.97,0,257.09,0,0,0,0,2118.77,0,0,0,3239.59,0,7122756.78,0,0,0,0,1300,0,0,0,0,0,0,600,1250,0,0,0,0,400,180,0,0,0,0,3592,0,0,0,0,0,20350,0,5030,203371,1850,0,1000,0,0,100,4290.71,87400,3400,0,0,200,0,0,600,5000,1050,0,0,0,0,1500,0,11838,0,700,18005,229183.22,0,9753,200,0,5059..74,3784,10638,1850,0,500,0,0,3000,8330,600,1480,0,0,0,38508,500,0,0,1000,0,0,0,46527,700,979470.35,500,0,2500,0,100,6964.04,0,500,0,0,100,0,650,12150,0,0,2643,100,1230,0,10000,2523,0,0,400,182279.03,0,0,0,0,37678.09,900,0,1600,600,500,0,1310,500,100,2400,0,700,0,0,0,0,500,1382.5,0,0,230,0,0,0,500,0,0,1200,100,0,134173,19550,3300,0,0,59928.59,9900,0,7100.13,8600,0,
> 3658,100,1000,3000,0,200,0,2750,27611,26700,500,0,1267,0,26818.54,0,4625,1020,0,0,0,0,200,6726,982,2500,200,0,1200,1600,29552,1000,16500,0,0,0,1000,1130,600,0,0,0,2300,0,1000,2050,0,18000,5900,716.53,0,0,0,4875.79,2130,0,3000,9675,9351,0,0,141550,0,17885,4052.74,17893.81,2325,47308,16034,0,0,11626,310,450,2300,300,0,100,0,203383.5,118.11,5500,100,0,4100,25100,3215.39,2650,2200,11702,0,500,98911.38,6450,203,500,3563,0,118110,8975,53173.2,5080,161.51,100,0,0,500,1226,100,1000,0,0,7100,844.32,4390,0,900,3057,0,0,1100,3561,19263,1150,0,0,0,0,1000,0,138905,0,0,41921,1502.13,26990,11484.89,0,1000,0,2146,0,2500,1017,500,6500,200,50100,1428,1100,730,19080,1000,0,239257.68,22546.07,5814.02,0,0,2000,0,300,18936.16,3656.1,4934167.89,77926.55,0,0,600,303210,6445,550,16550.75,4339.1,0,57115.03,0,3773.12,2173.38,5029.74,32822.68,0,500,12140.41,12890,20000,2500,900,0,0,19475,3924,13706.82,18574,500,0,1162361.91,0,1000,4416.24,11629.2,500,0,0,100,2980,6475.6,0,802573.7
> ,0,3550,30377.5,12810,500,0,0,0,2800,12490,834,1000,300,0,0,2290,0,9689.7,0,300,22260,0,0,20450,0,100000,100,5217.7,0,766.37,2200,523.9,1000,0,0,0,0,5469.94,0,5800,1750,500,0,0,3000,1100,0,5400,107.3,0,1294.34,20684,0,14740,589726.02,0,0,1800,3200,3700,0,20000,8000,0,1000,794.1,120,31214.16,7505.69,7070.71,0,9787.46,27858.04,3400,106.3,1426.97,2500,0,2634.91,2500,2500,8570..85,41168.6,262.63,0,0,61052,500,331306,231505,2327.06,0,1500,1993.87,0,23000,17494.64,715.11,0,3650,1500,0,24375.77,0,1102.18,0,612.28,123902.53,0,5220,0,0,0,17170.19,500,12378.1,2325.21,127.77,7310.31,0,197044.03,211.28,600..15,500,12832.09,1021.41,0,3275.95,0,0,204200,3500,717.33,0,0,283.66,379.78,900,5453.36,4906.52,0,5100,1774.33,2600,30046.35,25344.1,347.26,0,600,18500,6070.8,27200,9237.34,2000,0,0,0,2449.83,1314.1,2190.26,900,0,0,1105.31,55008.81,699.68,16248.34,3814.63,0,2050,1786.64,3090.3,7020.92,1494.15,170.14,0,20100,0,169.36,200741.43,103825.98,11100,0,501.45,46993.69,3403.
> 67,1727.96,2627.81,1001.9,0,2903.86,117.06,0,12002.84,2169.79,700,0,16006.42,1152.92,1316.44,824.22,502300,902.73,0,11547.47,142.01,205,3547,175.69,7000,0,2008.14,0,5456.13,500,156.97,12500.32,0,7852,12200,0,4954.39,1246.83,116.41,0,787.95,1611.2,212.82,794.99,39054.92,1417.08,0,630.93,500,115.7,2699.66,389.24,100,0,5793.59,2000,193.98,14100,10436.69,320,0,2173.94,6500,0,3698.53,610,0,0,167.69,2586.19,26080,1044,0,10370.71,0,1000,0,3002.48,368,26522.27,1860.7,0,0,4000,12383.9,3100,1145.22,176.12,0,7900,5178.7,1643.57,2505.25,267.16,11116.5,0,1988.38,2100,0,1577.42,401.46,0,0,0,3815.61,117.9,1041.99,249.13,0,0,454.89,54482.18,193352.4,0,14775.57,12000,0,605.14,158.57,3450,734816.68,200,33780.05,0,837.08,2980,4063.54,400.18,1761.91,0,0,300,1882.82,3601.6,51741.94,668.69,1126.85,0,100,25552.11,109081.43,16951.1,2653.36,373.18,0,3800,2024.48,8259,107.07,4190,183.6,0,0,13290.22,3258.9,4480,300,0,0,1948.43,85932.57,5361.34,200,0,208.32,0,2400,19229,138067,248
> 499.2,1500.49,34514,0,557345.18,0,1716.28,1686.29,667.35,1400,1000,1000,3754.95,1001.19,752.45,4762.14,1000,0,0,270.11,639.87,3245.39,400,924.08,0,1500,226.21,3281.6,1169.6,6466,0,0,1808.94,320.79,0,0,2089,100,1400,400,625.03,111.2,668.76,1144.52,274.06,0,380.15,3529,0,2626.79,3498.75,829.76,0,36884..17,44650,84357.17,15417.36,39612.48,9297.96,0,8716.95,7428.41,38019.06,12908.65,139072.48,20049.35,500000,2654.55,371.62,1718,5000,1000,403.28,0,500,0,125.34,8841,14543.77,151.03,0,105.95,30293.83,100,1995.35,131.66,0,0,15121.11,10146.3,2740.96,1342.92,1302.66,314.91,0,280.25,0,2934,387.61,152.48,5378.71,1350,1853.93,158.98,1390.74,5328.39,1770,12165,0,500,500,1960,9500,4425,212172.95,0,0,3137.88,0,510,1000,788.84,0,7628,1218,6500,8913.28,0,0,0,3500,21850,0,3700,0,300,0,0,0,7107.32,1800,0,16951.55,0,6244.62,250,2340,8104,1400,2500,0,1630.99,24239.29,25060.16,4100,4820,250,0,72579,0,0,18409.85,250,6498,0,548,1100,0,500,617,700,0,11921.75,200,113528.31,5500,0,
> 163813,
> 0,15990,6933.03,2500,100,200,1233542.42,0,400,0,0,0,0,0,0,0,0,0,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,0,33928,2360,2510,0,177000,0,12490,500,0,1750,0,2100,600,0,13139.58,115777,1400,0,5800,4000,0,1500,1608,11199,14050,42295.49,10900,0,76688,204400,8947.2,4900,4850,3300,0,2000,0,3000,1650,5400,4354,0,0,10070,22457.95,0,100,0,0,4000,1100,1500,0,3992.83,19100,0,4626.65,500,17332)
>  
>  lmom                          <- samlmu(amounts); lmom
>  
>  parameters_of_Normal  <- pelnor(lmom); 
>  
> parameters_of_Normal
>  
>  
>  
> Please guide as o why there is so much of a difference in standard deviation i.e. .

The sample standard deviation is one estimate of the sigma parameter
of the normal distribution.  The value returned by pelnor() is another.
There is no guarantee that the two estimates will be the same.  For
data that are so skew that fitting a normal distribution is grossly
inappropriate, they can be very far apart.  Your data, which have
sample skewness 22 and sample L-skewness 0.93, fall into this category.


J. R. M. Hosking




More information about the R-help mailing list