metacountregressor 0.1.71__tar.gz → 0.1.81__tar.gz
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.
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/PKG-INFO +254 -33
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/README.rst +271 -34
- metacountregressor-0.1.81/metacountregressor/app_main.py +258 -0
- metacountregressor-0.1.81/metacountregressor/data_split_helper.py +90 -0
- metacountregressor-0.1.81/metacountregressor/helperprocess.py +584 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/main.py +297 -117
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/metaheuristics.py +43 -31
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/setup.py +3 -2
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/solution.py +734 -832
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor.egg-info/PKG-INFO +254 -33
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor.egg-info/SOURCES.txt +2 -0
- metacountregressor-0.1.81/metacountregressor.egg-info/requires.txt +8 -0
- metacountregressor-0.1.81/setup.py +77 -0
- metacountregressor-0.1.71/metacountregressor/helperprocess.py +0 -217
- metacountregressor-0.1.71/metacountregressor.egg-info/requires.txt +0 -2
- metacountregressor-0.1.71/setup.py +0 -43
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/LICENSE.txt +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/__init__.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/_device_cust.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/halton.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/main_old.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/pareto_file.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/pareto_logger__plot.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/single_objective_finder.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor/test_generated_paper2.py +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor.egg-info/dependency_links.txt +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor.egg-info/not-zip-safe +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/metacountregressor.egg-info/top_level.txt +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/setup.cfg +0 -0
- {metacountregressor-0.1.71 → metacountregressor-0.1.81}/tests/test.py +0 -0
|
@@ -1,26 +1,60 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: metacountregressor
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.81
|
|
4
|
+
Summary: Extensive Testing for Estimation of Data Count Models
|
|
5
5
|
Home-page: https://github.com/zahern/CountDataEstimation
|
|
6
6
|
Author: Zeke Ahern
|
|
7
|
-
Author-email:
|
|
8
|
-
License:
|
|
7
|
+
Author-email: z.ahern@qut.edu.au
|
|
8
|
+
License: MIT
|
|
9
9
|
Requires-Python: >=3.10
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE.txt
|
|
12
12
|
Requires-Dist: numpy>=1.13.1
|
|
13
13
|
Requires-Dist: scipy>=1.0.0
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: latextable
|
|
16
|
+
Requires-Dist: pandas
|
|
17
|
+
Requires-Dist: scikit_learn>=1.4.1.post1
|
|
18
|
+
Requires-Dist: statsmodels
|
|
19
|
+
Requires-Dist: psustil
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: description
|
|
23
|
+
Dynamic: description-content-type
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: license
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
Dynamic: summary
|
|
14
29
|
|
|
15
30
|
<div style="display: flex; align-items: center;">
|
|
16
|
-
<img src="https://github.com/zahern/data/raw/main/m.png" alt="My Image" style="width:
|
|
31
|
+
<img src="https://github.com/zahern/data/raw/main/m.png" alt="My Image" style="width: 100px; margin-right: 20px;">
|
|
17
32
|
<p><span style="font-size: 60px;"><strong>MetaCountRegressor</strong></span></p>
|
|
18
33
|
</div>
|
|
19
34
|
|
|
20
|
-
|
|
35
|
+
# Tutorial also available as a jupyter notebook
|
|
36
|
+
[Download Example Notebook](https://github.com/zahern/CountDataEstimation/blob/main/Tutorial.ipynb)
|
|
37
|
+
|
|
38
|
+
The tutorial provides more extensive examples on how to run the code and perform experiments. Further documentation is currently in development.
|
|
39
|
+
|
|
40
|
+
# For an Application Setup Download the following GUI
|
|
41
|
+
[Download Application](https://github.com/zahern/MetaCount/tree/master/metacountregressor/application_gui/dist/meta_app)
|
|
42
|
+
|
|
43
|
+
The application involves setting up a problem instance to run the models.
|
|
44
|
+
|
|
45
|
+
### Entire [Git Repository](https://github.com/zahern/MetaCount.git) is available to clone.
|
|
46
|
+
#### Steps
|
|
47
|
+
1. Clone Project
|
|
48
|
+
2. Navigate to "metacountregressor/application_gui/dist/meta_app"
|
|
49
|
+
3. Run meta_app.exe
|
|
50
|
+
4. Navigate to metacountregressor/app_main.py
|
|
51
|
+
5. Run app_main.py
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Setup For Python Package Approach
|
|
21
55
|
The Below code demonstrates how to set up automatic optimization assisted by the harmony search algorithm. References to the Differential Evolution and Simulated Annealing has been mentioned (change accordingly)
|
|
22
56
|
|
|
23
|
-
##
|
|
57
|
+
## Install: Requires Python 3.10
|
|
24
58
|
|
|
25
59
|
Install `metacountregressor` using pip as follows:
|
|
26
60
|
|
|
@@ -35,8 +69,15 @@ from metacountregressor.solution import ObjectiveFunction
|
|
|
35
69
|
from metacountregressor.metaheuristics import (harmony_search,
|
|
36
70
|
differential_evolution,
|
|
37
71
|
simulated_annealing)
|
|
72
|
+
|
|
73
|
+
|
|
38
74
|
```
|
|
39
75
|
|
|
76
|
+
loaded standard packages
|
|
77
|
+
loaded helper
|
|
78
|
+
testing
|
|
79
|
+
|
|
80
|
+
|
|
40
81
|
#### Basic setup.
|
|
41
82
|
The initial setup involves reading in the data and selecting an optimization algorithm. As the runtime progresses, new solutions will be continually evaluated. Finally, at the end of the runtime, the best solution will be identified and printed out. In the case of multiple objectives all of the best solutions will be printed out that belong to the Pareto frontier.
|
|
42
83
|
|
|
@@ -53,7 +94,7 @@ X = df.drop(columns=['FREQ', 'ID', 'AADT'])
|
|
|
53
94
|
|
|
54
95
|
#some example argument, these are defualt so the following line is just for claritity. See the later agruments section for detials.
|
|
55
96
|
arguments = {'algorithm': 'hs', 'test_percentage': 0.15, 'test_complexity': 6, 'instance_number':1,
|
|
56
|
-
'val_percentage':0.15, 'obj_1': 'bic', '_obj_2': 'RMSE_TEST', "
|
|
97
|
+
'val_percentage':0.15, 'obj_1': 'bic', '_obj_2': 'RMSE_TEST', "_max_time": 6}
|
|
57
98
|
# Fit the model with metacountregressor
|
|
58
99
|
obj_fun = ObjectiveFunction(X, y, **arguments)
|
|
59
100
|
#replace with other metaheuristics if desired
|
|
@@ -71,7 +112,7 @@ Note: Please Consider the main arguments to change.
|
|
|
71
112
|
- `val_percentage`: This parameter represents the percentage of data used to validate the model. The value 0.15 corresponds to 15% of the data.
|
|
72
113
|
- `test_complexity`: This parameter defines the complexity level for testing. The value 6 tests all complexities. Alternatively, you can provide a list of numbers to consider different complexities. The complexities are further explained later in this document.
|
|
73
114
|
- `instance_number`: This parameter is used to give a name to the outputs.
|
|
74
|
-
- `
|
|
115
|
+
- `_obj_1`: This parameter has multiple choices for obj_1, such as 'bic', 'aic', and 'hqic'. Only one choice should be defined as a string value.
|
|
75
116
|
- `_obj_2`: This parameter has multiple choices for objective 2, such as 'RMSE_TEST', 'MSE_TEST', and 'MAE_TEST'.
|
|
76
117
|
- `_max_time`: This parameter specifies the maximum number of seconds for the total estimation before stopping.
|
|
77
118
|
- `distribution`: This parameter is a list of distributions to consider. Please select all of the available options and put them into a list of valid options if you want to to consider the distribution type for use when modellign with random parameters. The valid options include: 'Normal', 'LnNormal', 'Triangular', and 'Uniform'.
|
|
@@ -80,7 +121,7 @@ Note: Please Consider the main arguments to change.
|
|
|
80
121
|
|
|
81
122
|
|
|
82
123
|
|
|
83
|
-
###
|
|
124
|
+
### Example of changing the arguments:
|
|
84
125
|
Modify the arguments according to your preferences using the commented code as a guide.
|
|
85
126
|
|
|
86
127
|
|
|
@@ -108,16 +149,18 @@ Listed below is an example of how to specify an initial solution within the fram
|
|
|
108
149
|
|
|
109
150
|
|
|
110
151
|
```python
|
|
111
|
-
#Model Decisions, Specify for
|
|
152
|
+
#Model Decisions, Specify for initial solution that will be optimised.
|
|
112
153
|
manual_fit_spec = {
|
|
113
154
|
'fixed_terms': ['SINGLE', 'LENGTH'],
|
|
114
155
|
'rdm_terms': ['AADT:normal'],
|
|
115
|
-
'rdm_cor_terms': ['GRADEBR:
|
|
156
|
+
'rdm_cor_terms': ['GRADEBR:normal', 'CURVES:normal'],
|
|
116
157
|
'grouped_terms': [],
|
|
117
158
|
'hetro_in_means': ['ACCESS:normal', 'MINRAD:normal'],
|
|
118
159
|
'transformations': ['no', 'no', 'log', 'no', 'no', 'no', 'no'],
|
|
119
|
-
'dispersion':
|
|
160
|
+
'dispersion': 0
|
|
120
161
|
}
|
|
162
|
+
|
|
163
|
+
|
|
121
164
|
#Search Arguments
|
|
122
165
|
arguments = {
|
|
123
166
|
'algorithm': 'hs',
|
|
@@ -129,7 +172,47 @@ arguments = {
|
|
|
129
172
|
obj_fun = ObjectiveFunction(X, y, **arguments)
|
|
130
173
|
```
|
|
131
174
|
|
|
132
|
-
|
|
175
|
+
Setup Complete...
|
|
176
|
+
Benchmaking test with Seed 42
|
|
177
|
+
--------------------------------------------------------------------------------
|
|
178
|
+
Log-Likelihood: -1339.1862434675106
|
|
179
|
+
--------------------------------------------------------------------------------
|
|
180
|
+
bic: 2732.31
|
|
181
|
+
--------------------------------------------------------------------------------
|
|
182
|
+
MSE: 650856.32
|
|
183
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
184
|
+
| Effect | $\tau$ | Coeff | Std. Err | z-values | Prob |z|>Z |
|
|
185
|
+
+==========================+========+=======+==========+==========+============+
|
|
186
|
+
| LENGTH | no | -0.15 | 0.01 | -12.98 | 0.00*** |
|
|
187
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
188
|
+
| SINGLE | no | -2.46 | 0.04 | -50.00 | 0.00*** |
|
|
189
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
190
|
+
| GRADEBR | log | 4.23 | 0.10 | 42.17 | 0.00*** |
|
|
191
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
192
|
+
| CURVES | no | 0.51 | 0.01 | 34.78 | 0.00*** |
|
|
193
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
194
|
+
| Chol: GRADEBR (Std. | | 2.21 | 0.00 | 50.00 | 0.00*** |
|
|
195
|
+
| Dev. normal) ) | | | | | |
|
|
196
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
197
|
+
| Chol: CURVES (Std. Dev. | | -0.51 | 0.00 | -50.00 | 0.00*** |
|
|
198
|
+
| normal) ) | | | | | |
|
|
199
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
200
|
+
| Chol: CURVES (Std. Dev. | no | 0.55 | 0.00 | 50.00 | 0.00*** |
|
|
201
|
+
| normal) . GRADEBR (Std. | | | | | |
|
|
202
|
+
| Dev. normal ) | | | | | |
|
|
203
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
204
|
+
| main: MINRAD: hetro | no | -0.00 | 0.00 | -44.36 | 0.00*** |
|
|
205
|
+
| group 0 | | | | | |
|
|
206
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
207
|
+
| ACCESS: hetro group 0 | | 0.68 | 0.09 | 7.68 | 0.00*** |
|
|
208
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
209
|
+
| main: MINRAD: hetro | | -0.00 | 0.00 | -44.86 | 0.00*** |
|
|
210
|
+
| group 0:normal:sd hetro | | | | | |
|
|
211
|
+
| group 0 | | | | | |
|
|
212
|
+
+--------------------------+--------+-------+----------+----------+------------+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
Simarly to return the results feed the objective function into a metaheuristic solution algorithm. An example of this is provided below:
|
|
133
216
|
|
|
134
217
|
|
|
135
218
|
```python
|
|
@@ -137,7 +220,7 @@ results = harmony_search(obj_fun)
|
|
|
137
220
|
print(results)
|
|
138
221
|
```
|
|
139
222
|
|
|
140
|
-
|
|
223
|
+
# Notes:
|
|
141
224
|
### Capabilities of the software include:
|
|
142
225
|
* Handling of Panel Data
|
|
143
226
|
* Support for Data Transformations
|
|
@@ -155,11 +238,11 @@ Capability to handle heterogeneity in the means of the random parameters
|
|
|
155
238
|
* Customization of Hyper-parameters to solve problems tailored to your dataset
|
|
156
239
|
* Out-of-the-box optimization capability using default metaheuristics
|
|
157
240
|
|
|
158
|
-
###
|
|
241
|
+
### Intepreting the output of the model:
|
|
159
242
|
A regression table is produced. The following text elements are explained:
|
|
160
243
|
- Std. Dev.: This column appears for effects that are related to random paramters and displays the assument distributional assumption next to it
|
|
161
244
|
- Chol: This term refers to Cholesky decomposition element, to show the correlation between two random paramaters. The combination of the cholesky element on iyself is equivalent to a normal random parameter.
|
|
162
|
-
- hetro group
|
|
245
|
+
- hetro group: This term represents the heterogeneity group number, which refers all of the contributing factors that share hetrogentiy in the means to each other under the same numbered value.
|
|
163
246
|
- $\tau$: This column, displays the type of transformation that was applied to the specific contributing factor in the data.
|
|
164
247
|
|
|
165
248
|
|
|
@@ -211,14 +294,16 @@ The following list describes the arguments available in this function. By defaul
|
|
|
211
294
|
|
|
212
295
|
8. **`_max_time`**: This argument is used to add a termination time in the algorithm. It takes values as seconds. Note the time is only dependenant on the time after intial population of solutions are generated.
|
|
213
296
|
|
|
214
|
-
|
|
297
|
+
## Example: Assistance by Harmony Search
|
|
215
298
|
|
|
216
299
|
|
|
217
|
-
Let's
|
|
300
|
+
Let's begin by fitting very simple models and use the structure of these models to define our objectives. Then, we can conduct a more extensive search on the variables that are more frequently identified. For instance, in the case below, the complexity is level 3, indicating that we will consider, at most randomly correlated parameters. This approach is useful for initially identifying a suitable set of contributing factors for our search.
|
|
218
301
|
|
|
219
302
|
|
|
220
303
|
|
|
221
304
|
```python
|
|
305
|
+
|
|
306
|
+
'''Setup Data'''
|
|
222
307
|
df = pd.read_csv(
|
|
223
308
|
"https://raw.githubusercontent.com/zahern/data/main/Ex-16-3.csv")
|
|
224
309
|
X = df
|
|
@@ -226,42 +311,178 @@ y = df['FREQ'] # Frequency of crashes
|
|
|
226
311
|
X['Offset'] = np.log(df['AADT']) # Explicitley define how to offset the data, no offset otherwise
|
|
227
312
|
# Drop Y, selected offset term and ID as there are no panels
|
|
228
313
|
X = df.drop(columns=['FREQ', 'ID', 'AADT'])
|
|
229
|
-
|
|
314
|
+
'''Aguments for Solution'''
|
|
230
315
|
arguments = {
|
|
231
|
-
'
|
|
232
|
-
'is_multi': 1,
|
|
316
|
+
'is_multi': 1, #is two objectives considered
|
|
233
317
|
'test_percentage': 0.2, # used in multi-objective optimisation only. Saves 20% of data for testing.
|
|
234
318
|
'val_percentage:': 0.2, # Saves 20% of data for testing.
|
|
235
319
|
'test_complexity': 3, # For Very simple Models
|
|
236
320
|
'obj_1': 'BIC', '_obj_2': 'RMSE_TEST',
|
|
237
|
-
'instance_number': '
|
|
321
|
+
'instance_number': 'hs_run', # used for creeating a named folder where your models are saved into from the directory
|
|
238
322
|
'distribution': ['Normal'],
|
|
239
|
-
'Model': [0], # or equivalently ['POS', 'NB']
|
|
323
|
+
'Model': [0, 1], # or equivalently ['POS', 'NB']
|
|
240
324
|
'transformations': ['no', 'sqrt', 'archsinh'],
|
|
241
325
|
'_max_time': 10000
|
|
242
|
-
|
|
326
|
+
} '''Arguments for the solution algorithm'''
|
|
327
|
+
argument_hs = {
|
|
328
|
+
'_hms': 20, #harmony memory size,
|
|
329
|
+
'_mpai': 1, #adjustement inded
|
|
330
|
+
'_par': 0.3,
|
|
331
|
+
'_hmcr': .5
|
|
332
|
+
}
|
|
243
333
|
obj_fun = ObjectiveFunction(X, y, **arguments)
|
|
244
|
-
|
|
245
|
-
results = harmony_search(obj_fun)
|
|
334
|
+
results = harmony_search(obj_fun, None, argument_hs)
|
|
246
335
|
print(results)
|
|
247
336
|
```
|
|
248
337
|
|
|
338
|
+
## Example: Assistance by Differential Evololution and Simulated Annealing
|
|
339
|
+
Similiar to the above example we only need to change the hyperparamaters, the obj_fun can remane the same
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
```python
|
|
343
|
+
argument_de = {'_AI': 2,
|
|
344
|
+
'_crossover_perc': .2,
|
|
345
|
+
'_max_iter': 1000,
|
|
346
|
+
'_pop_size': 25
|
|
347
|
+
}
|
|
348
|
+
de_results = differential_evolution(obj_fun, None, **argument_de)
|
|
349
|
+
print(de_results)
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
args_sa = {'alpha': .99,
|
|
353
|
+
'STEPS_PER_TEMP': 10,
|
|
354
|
+
'INTL_ACPT': 0.5,
|
|
355
|
+
'_crossover_perc': .3,
|
|
356
|
+
'MAX_ITERATIONS': 1000,
|
|
357
|
+
'_num_intl_slns': 25,
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
sa_results = simulated_annealing(obj_fun, None, **args_sa)
|
|
361
|
+
print(sa_results)
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Comparing to statsmodels
|
|
365
|
+
The following example illustrates how the output compares to well-known packages, including Statsmodels."
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
```python
|
|
369
|
+
# Load modules and data
|
|
370
|
+
import statsmodels.api as sm
|
|
371
|
+
|
|
372
|
+
data = sm.datasets.sunspots.load_pandas().data
|
|
373
|
+
#print(data.exog)
|
|
374
|
+
data_exog = data['YEAR']
|
|
375
|
+
data_exog = sm.add_constant(data_exog)
|
|
376
|
+
data_endog = data['SUNACTIVITY']
|
|
377
|
+
|
|
378
|
+
# Instantiate a gamma family model with the default link function.
|
|
379
|
+
import numpy as np
|
|
380
|
+
|
|
381
|
+
gamma_model = sm.NegativeBinomial(data_endog, data_exog)
|
|
382
|
+
gamma_results = gamma_model.fit()
|
|
383
|
+
|
|
384
|
+
print(gamma_results.summary())
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
#NOW LET's COMPARE THIS TO METACOUNTREGRESSOR
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
#Model Decisions,
|
|
395
|
+
manual_fit_spec = {
|
|
396
|
+
'fixed_terms': ['const','YEAR'],
|
|
397
|
+
'rdm_terms': [],
|
|
398
|
+
'rdm_cor_terms': [],
|
|
399
|
+
'grouped_terms': [],
|
|
400
|
+
'hetro_in_means': [],
|
|
401
|
+
'transformations': ['no', 'no'],
|
|
402
|
+
'dispersion': 1 #Negative Binomial
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
#Arguments
|
|
407
|
+
arguments = {
|
|
408
|
+
'algorithm': 'hs',
|
|
409
|
+
'test_percentage': 0,
|
|
410
|
+
'test_complexity': 6,
|
|
411
|
+
'instance_number': 'name',
|
|
412
|
+
'Manual_Fit': manual_fit_spec
|
|
413
|
+
}
|
|
414
|
+
obj_fun = ObjectiveFunction(data_exog, data_endog, **arguments)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Optimization terminated successfully.
|
|
425
|
+
Current function value: 4.877748
|
|
426
|
+
Iterations: 22
|
|
427
|
+
Function evaluations: 71
|
|
428
|
+
Gradient evaluations: 70
|
|
429
|
+
NegativeBinomial Regression Results
|
|
430
|
+
==============================================================================
|
|
431
|
+
Dep. Variable: SUNACTIVITY No. Observations: 309
|
|
432
|
+
Model: NegativeBinomial Df Residuals: 307
|
|
433
|
+
Method: MLE Df Model: 1
|
|
434
|
+
Date: Tue, 13 Aug 2024 Pseudo R-squ.: 0.004087
|
|
435
|
+
Time: 14:13:22 Log-Likelihood: -1507.2
|
|
436
|
+
converged: True LL-Null: -1513.4
|
|
437
|
+
Covariance Type: nonrobust LLR p-value: 0.0004363
|
|
438
|
+
==============================================================================
|
|
439
|
+
coef std err z P>|z| [0.025 0.975]
|
|
440
|
+
------------------------------------------------------------------------------
|
|
441
|
+
const 0.2913 1.017 0.287 0.774 -1.701 2.284
|
|
442
|
+
YEAR 0.0019 0.001 3.546 0.000 0.001 0.003
|
|
443
|
+
alpha 0.7339 0.057 12.910 0.000 0.622 0.845
|
|
444
|
+
==============================================================================
|
|
445
|
+
0.1.88
|
|
446
|
+
Setup Complete...
|
|
447
|
+
Benchmaking test with Seed 42
|
|
448
|
+
1
|
|
449
|
+
--------------------------------------------------------------------------------
|
|
450
|
+
Log-Likelihood: -1509.0683662284273
|
|
451
|
+
--------------------------------------------------------------------------------
|
|
452
|
+
bic: 3035.84
|
|
453
|
+
--------------------------------------------------------------------------------
|
|
454
|
+
MSE: 10000000.00
|
|
455
|
+
+--------+--------+-------+----------+----------+------------+
|
|
456
|
+
| Effect | $\tau$ | Coeff | Std. Err | z-values | Prob |z|>Z |
|
|
457
|
+
+========+========+=======+==========+==========+============+
|
|
458
|
+
| const | no | 0.10 | 0.25 | 0.39 | 0.70 |
|
|
459
|
+
+--------+--------+-------+----------+----------+------------+
|
|
460
|
+
| YEAR | no | 0.00 | 0.00 | 20.39 | 0.00*** |
|
|
461
|
+
+--------+--------+-------+----------+----------+------------+
|
|
462
|
+
| nb | | 1.33 | 0.00 | 50.00 | 0.00*** |
|
|
463
|
+
+--------+--------+-------+----------+----------+------------+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
## Paper
|
|
467
|
+
|
|
468
|
+
The following tutorial is in conjunction with our latest paper. A link the current paper can be found here [MetaCountRegressor](https://www.overleaf.com/read/mszwpwzcxsng#c5eb0c)
|
|
469
|
+
|
|
249
470
|
## Contact
|
|
250
471
|
If you have any questions, ideas to improve MetaCountRegressor, or want to report a bug, just open a new issue in [GitHub repository](https://github.com/zahern/CountDataEstimation).
|
|
251
472
|
|
|
252
473
|
## Citing MetaCountRegressor
|
|
253
474
|
Please cite MetaCountRegressor as follows:
|
|
254
475
|
|
|
255
|
-
Ahern, Z., Corry P., Paz A. (
|
|
476
|
+
Ahern, Z., Corry P., Paz A. (2024). MetaCountRegressor [Computer software]. [https://pypi.org/project/metacounregressor/](https://pypi.org/project/metacounregressor/)
|
|
256
477
|
|
|
257
478
|
Or using BibTex as follows:
|
|
258
479
|
|
|
259
480
|
```bibtex
|
|
260
|
-
@misc{
|
|
261
|
-
author = {Zeke Ahern
|
|
481
|
+
@misc{Ahern2024Meta,
|
|
482
|
+
author = {Zeke Ahern, Paul Corry and Alexander Paz},
|
|
262
483
|
journal = {PyPi},
|
|
263
484
|
title = {metacountregressor · PyPI},
|
|
264
|
-
url = {https://pypi.org/project/metacountregressor/0.1.
|
|
265
|
-
year = {
|
|
485
|
+
url = {https://pypi.org/project/metacountregressor/0.1.80/},
|
|
486
|
+
year = {2024},
|
|
266
487
|
}
|
|
267
488
|
|