LSMS_Library 0.2.3__py3-none-any.whl → 0.2.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lsms_library-0.2.3.dist-info → lsms_library-0.2.5.dist-info}/METADATA +13 -2
- {lsms_library-0.2.3.dist-info → lsms_library-0.2.5.dist-info}/RECORD +4 -5
- lsms_library/countries/Nigeria/_/predicted_prices.py +0 -66
- {lsms_library-0.2.3.dist-info → lsms_library-0.2.5.dist-info}/LICENSE.txt +0 -0
- {lsms_library-0.2.3.dist-info → lsms_library-0.2.5.dist-info}/WHEEL +0 -0
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: LSMS_Library
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Abstraction layer for Living Standards Measurement Survey data
|
|
5
5
|
License: CC-BY-4.0
|
|
6
6
|
Author: Ethan Ligon
|
|
7
7
|
Author-email: ligon@berkeley.edu
|
|
8
|
-
Requires-Python: >=3.11
|
|
8
|
+
Requires-Python: >=3.11, <4.0
|
|
9
9
|
Classifier: License :: Other/Proprietary License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Requires-Dist: CFEDemands (>=0.7.0)
|
|
15
|
+
Requires-Dist: PyYAML
|
|
16
|
+
Requires-Dist: dvc[s3] (>=3.61.0,<4.0.0)
|
|
17
|
+
Requires-Dist: ligonlibrary (>=0.1.1,<0.2.0)
|
|
18
|
+
Requires-Dist: lsms (>=0.4.7,<0.5.0)
|
|
19
|
+
Requires-Dist: openai (>=1.99.5,<2.0.0)
|
|
20
|
+
Requires-Dist: pandas (>=2.2,<3.0)
|
|
21
|
+
Requires-Dist: pyarrow (>=21.0.0,<22.0.0)
|
|
22
|
+
Requires-Dist: pyreadstat (>=1.3.0,<2.0.0)
|
|
23
|
+
Requires-Dist: scikit-learn (>=1.7.1,<2.0.0)
|
|
24
|
+
Requires-Dist: xarray (>=2025.7.1,<2026.0.0)
|
|
14
25
|
Description-Content-Type: text/plain
|
|
15
26
|
|
|
16
27
|
* Streaming dvc files
|
|
@@ -7309,7 +7309,6 @@ lsms_library/countries/Nigeria/_/household_roster.py,sha256=CezzWwnXj-2KluD0PtYe
|
|
|
7309
7309
|
lsms_library/countries/Nigeria/_/nigeria.py,sha256=VrFJfQHQtx22siFINUaCv1KIW2A5lrBeLIRR4W-WFTk,227
|
|
7310
7310
|
lsms_library/countries/Nigeria/_/nonfood_expenditures.py,sha256=dL2vh928a3g-G29uH2Eki6Aaq6Bs6_kJtYaen6nMmXw,584
|
|
7311
7311
|
lsms_library/countries/Nigeria/_/nonfood_items.json,sha256=77fSHMuKy1pSbpNgwK0ZZJaEj9coiGvg_3ktfImQL8o,18785
|
|
7312
|
-
lsms_library/countries/Nigeria/_/predicted_prices.py,sha256=u8rGKsQKR2he1I4HhhfoLyPhEPnvXfd-nFwSjUpVjdo,1930
|
|
7313
7312
|
lsms_library/countries/Nigeria/_/unitvalues.py,sha256=4J3FlLWgN3BS-IZl6d26gFFw6N9ANXRIQXbEsMz_LmA,611
|
|
7314
7313
|
lsms_library/countries/Nigeria/var/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7315
7314
|
lsms_library/countries/Pakistan/1991/Data/.gitignore,sha256=_mNlocngcNbGaSLbmMPn3e76as1iWisON-BsRnpG76U,2068
|
|
@@ -10540,7 +10539,7 @@ lsms_library/demands.py,sha256=UCnUTjoE6FHt32XvRm4hZdIBryOj_YQU4im0-Wu9y7U,749
|
|
|
10540
10539
|
lsms_library/harmony.py,sha256=hEGLJUnWBXdyGeAAr7qgCFZ0Q-KsiqjBxHrtYbZ8Ngs,2742
|
|
10541
10540
|
lsms_library/local_tools.py,sha256=YXqowOUzW4U61CtkDeRlNB2XSNWhW0s9SQwyFpN9O5o,40712
|
|
10542
10541
|
lsms_library/transformations.py,sha256=uBSGfUAjWMrqSOmxdYYzi9csf8WvjaGCC7lzflJObtU,3661
|
|
10543
|
-
lsms_library-0.2.
|
|
10544
|
-
lsms_library-0.2.
|
|
10545
|
-
lsms_library-0.2.
|
|
10546
|
-
lsms_library-0.2.
|
|
10542
|
+
lsms_library-0.2.5.dist-info/LICENSE.txt,sha256=qImFXcRJwxIHS80FE7uOx6FhmLY8apd4Y12aR54QU7w,282
|
|
10543
|
+
lsms_library-0.2.5.dist-info/METADATA,sha256=jQdIIOiIt7VYWK17J3d1xe1R1tx2KF3dOjZCsJf_GLo,5214
|
|
10544
|
+
lsms_library-0.2.5.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
10545
|
+
lsms_library-0.2.5.dist-info/RECORD,,
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
"""
|
|
3
|
-
Use methods of Summer (1973) to predict prices for different goods, units, places, and times.
|
|
4
|
-
"""
|
|
5
|
-
import numpy as np
|
|
6
|
-
import pandas as pd
|
|
7
|
-
import pylab as pl
|
|
8
|
-
import matplotlib.cm as cm
|
|
9
|
-
from cfe.estimation import ols
|
|
10
|
-
|
|
11
|
-
P = []
|
|
12
|
-
for t in ['2010-11','2012-13','2015-16','2018-19']:
|
|
13
|
-
P.append(pd.read_pickle('../%s/_/individual_unit_values.pickle' % t))
|
|
14
|
-
|
|
15
|
-
p = pd.concat(P,axis=0)
|
|
16
|
-
|
|
17
|
-
# Eliminate infinities & zeros
|
|
18
|
-
p = p.replace(np.inf,np.nan)
|
|
19
|
-
p = p.replace(-np.inf,np.nan)
|
|
20
|
-
p = p.replace(0,np.nan)
|
|
21
|
-
|
|
22
|
-
logp = np.log(p)
|
|
23
|
-
|
|
24
|
-
# Construct different "settings"
|
|
25
|
-
s=pd.DataFrame({'Good-Setting':list(zip(logp.index.get_level_values('t'),
|
|
26
|
-
logp.index.get_level_values('m'),
|
|
27
|
-
logp.index.get_level_values('i')))},index=logp.index).squeeze()
|
|
28
|
-
|
|
29
|
-
Settings = pd.get_dummies(s)
|
|
30
|
-
|
|
31
|
-
Units = pd.get_dummies(logp.index.get_level_values('u'))
|
|
32
|
-
Units.index = logp.index
|
|
33
|
-
del Units['Kg'] # Reference prices in Kgs.
|
|
34
|
-
|
|
35
|
-
X = pd.concat([Settings.reset_index(drop=True),
|
|
36
|
-
Units.reset_index(drop=True)],axis=1)
|
|
37
|
-
|
|
38
|
-
X.index = logp.index
|
|
39
|
-
|
|
40
|
-
bhat=ols(X,logp,return_se=False)[0]
|
|
41
|
-
logphat=X.dot(bhat.T)
|
|
42
|
-
logphat.index=logp.index
|
|
43
|
-
|
|
44
|
-
prices=logphat.groupby(level=['t','m','i']).median().unstack()
|
|
45
|
-
prices.columns=prices.T.index.droplevel(0)
|
|
46
|
-
prices0=logp.groupby(level=['t','m','i']).median().unstack()
|
|
47
|
-
prices0.columns=prices0.T.index.droplevel(0)
|
|
48
|
-
|
|
49
|
-
pl.figure(1,figsize=(10,10))
|
|
50
|
-
pl.clf()
|
|
51
|
-
|
|
52
|
-
colors = iter(cm.rainbow(np.linspace(0, 1, prices.shape[1])))
|
|
53
|
-
|
|
54
|
-
for i in prices:
|
|
55
|
-
pl.scatter(prices[i],prices0[i],color=next(colors))
|
|
56
|
-
|
|
57
|
-
pl.legend(prices.columns, loc='lower right', ncol=2,scatterpoints=2)
|
|
58
|
-
v=pl.axis()
|
|
59
|
-
pl.axis((v[0],v[1]*1.1,v[2],v[3]))
|
|
60
|
-
|
|
61
|
-
pl.xlabel('Predicted log prices')
|
|
62
|
-
pl.ylabel('Observed log prices')
|
|
63
|
-
pl.savefig('/tmp/predicted_prices_scatter.png')
|
|
64
|
-
|
|
65
|
-
V=pd.concat([prices.stack(),prices0.stack()],axis=1).dropna(how='any').cov()
|
|
66
|
-
print("R^2=%6.4f" % (V.iloc[0,0]/V.iloc[1,1],))
|
|
File without changes
|
|
File without changes
|