Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test project - Stratify solutions #31

Open
dill opened this issue Dec 18, 2015 · 2 comments
Open

Test project - Stratify solutions #31

dill opened this issue Dec 18, 2015 · 2 comments

Comments

@dill
Copy link
Contributor

dill commented Dec 18, 2015

Here is a summary of the current state of this project's conversion:

> cc <- convert_project("inst/Stratify-solutions/Stratify\\ solutions")
Warning messages:
1: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
2: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
3: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
> lapply(cc, test_stats, 1:2)
$`Full geog stratification`
        Statistic Distance_value       mrds_value       Difference Pass
1               n             88               88                0    ✓
2      parameters              4                4                0    ✓
3             AIC      315.78949 315.789556669798   0.000000211121    ✓
4  log-likelihood      -153.8947        -153.8948                0    ✓
5         density       0.020906       0.02754065        0.3173562
6     CV(density)      0.2778745       0.25884407       0.06848571
7     individuals          14954    19700.2664079        0.3173911
8 CV(individuals)      0.2778745       0.25884407       0.06848571

$`Pooled f(0)`
         Statistic Distance_value       mrds_value       Difference Pass
1                n             88               88                0    ✓
2       parameters              2                2                0    ✓
3              AIC     318.723114 318.723592371443   0.000001544825    ✓
4          Chi^2 p    0.910453618    0.91039363727    0.00006586028    ✓
5              P_a     0.60346657     0.6033303633     0.0002257569    ✓
6          CV(P_a)    0.115353502      0.116068874      0.006201585    ✓
7   log-likelihood      -157.3616        -157.3618                0    ✓
8          density     0.02283272       0.03028356        0.3263227
9      CV(density)     0.30821091       0.28221084       0.08435801
10     individuals          16333     21662.311527         0.326291
11 CV(individuals)     0.30821091       0.28221084       0.08435801

$`No stratification`
         Statistic Distance_value       mrds_value       Difference Pass
1                n             88               88                0    ✓
2       parameters              2                2                0    ✓
3              AIC     318.723114 318.723592371443   0.000001544825    ✓
4          Chi^2 p    0.910453618    0.91039363727    0.00006586028    ✓
5              P_a     0.60346657     0.6033303633     0.0002257569    ✓
6          CV(P_a)    0.115353502      0.116068874      0.006201585    ✓
7   log-likelihood      -157.3616        -157.3618                0    ✓
8          density     0.02637742       0.03028356        0.1480863
9      CV(density)     0.26317999       0.28221084       0.07231112
10     individuals          18868    21662.3115267        0.1480979
11 CV(individuals)     0.26317999       0.28221084       0.07231112

Comments:

  • Still some fairly big discrepencies here between the abundance/density estimates. Probably a good idea to check manually the study area size and the covered area (these don't appear to be stored in the Distance database).
@dill
Copy link
Contributor Author

dill commented May 26, 2018

Still some issues here but a significant bug in calculation of effort was squashed in 8b1278c

Current state:

>  cc <- convert_project("inst/Stratify-solutions/Stratify\\ solutions")
Warning messages:
1: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
2: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
3: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
> lapply(cc, test_stats, 1:2)
$`Full geog stratification`
        Statistic Distance_value       mrds_value       Difference Pass
1               n             88               88                0    ✓
2      parameters              4                4                0    ✓
3             AIC      315.78949 315.789836548511   0.000001097404    ✓
4  log-likelihood      -153.8947        -153.8949                0    ✓
5         density   0.0209059995      0.020916126     0.0004843565    ✓
6     CV(density)      0.2778745        0.2704705       0.02664511
7     individuals          14954 14961.6395546544     0.0005108703    ✓
8 CV(individuals)      0.2778745        0.2704705       0.02664511

$`Pooled f(0)`
         Statistic Distance_value       mrds_value        Difference Pass
1                n             88               88                 0    ✓
2       parameters              2                2                 0    ✓
3              AIC     318.723114 318.723263111991   0.0000005117671    ✓
4          Chi^2 p    0.910453618     0.9104321066     0.00002360736    ✓
5              P_a     0.60346657       0.60370731       0.000398879    ✓
6          CV(P_a)    0.115353502      0.115885468       0.004611636    ✓
7   log-likelihood      -157.3616        -157.3616                 0    ✓
8          density   0.0228327196     0.0228236167      0.0003986955    ✓
9      CV(density)    0.308210909     0.3084104337      0.0006473934    ✓
10     individuals          16333 16326.0982006826      0.0004225678    ✓
11 CV(individuals)    0.308210909     0.3084104337      0.0006473934    ✓

$`No stratification`
         Statistic Distance_value       mrds_value        Difference Pass
1                n             88               88                 0    ✓
2       parameters              2                2                 0    ✓
3              AIC     318.723114 318.723263111991   0.0000005117671    ✓
4          Chi^2 p    0.910453618     0.9104321066     0.00002360736    ✓
5              P_a     0.60346657       0.60370731       0.000398879    ✓
6          CV(P_a)    0.115353502      0.115885468       0.004611636    ✓
7   log-likelihood      -157.3616        -157.3616                 0    ✓
8          density     0.02637742       0.02282362          0.134729
9      CV(density)        0.26318        0.3084104         0.1718612
10     individuals          18868    16326.0982007         0.1347203
11 CV(individuals)        0.26318        0.3084104         0.1718612

@dill
Copy link
Contributor Author

dill commented May 26, 2018

f6d22f1 uses the Dhat/Nhat formulation as in Distance (n/(2wLp)) rather than mrds (H-T estimator), this then gives:

> cc <- convert_project("inst/Stratify-solutions/Stratify\\ solutions")
Warning messages:
1: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
2: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
3: In create_bins(data, cuts) :
  Some distances were outside bins and have been removed.
> lapply(cc, test_stats, 1:2)
$`Full geog stratification`
        Statistic Distance_value       mrds_value       Difference Pass
1               n             88               88                0    ✓
2      parameters              4                4                0    ✓
3             AIC      315.78949 315.789836548511   0.000001097404    ✓
4  log-likelihood      -153.8947        -153.8949                0    ✓
5         density       0.020906       0.03391789        0.6223998
6     CV(density)      0.2778745        0.2704705       0.02664511
7     individuals          14954    24262.0101637        0.6224428
8 CV(individuals)      0.2778745        0.2704705       0.02664511

$`Pooled f(0)`
         Statistic Distance_value       mrds_value        Difference Pass
1                n             88               88                 0    ✓
2       parameters              2                2                 0    ✓
3              AIC     318.723114 318.723263111991   0.0000005117671    ✓
4          Chi^2 p    0.910453618     0.9104321066     0.00002360736    ✓
5              P_a     0.60346657       0.60370731       0.000398879    ✓
6          CV(P_a)    0.115353502      0.115885468       0.004611636    ✓
7   log-likelihood      -157.3616        -157.3616                 0    ✓
8          density     0.02283272        0.0263669         0.1547859
9      CV(density)    0.308210909     0.3084104337      0.0006473934    ✓
10     individuals          16333    18860.6682341         0.1547584
11 CV(individuals)    0.308210909     0.3084104337      0.0006473934    ✓

$`No stratification`
         Statistic Distance_value       mrds_value        Difference Pass
1                n             88               88                 0    ✓
2       parameters              2                2                 0    ✓
3              AIC     318.723114 318.723263111991   0.0000005117671    ✓
4          Chi^2 p    0.910453618     0.9104321066     0.00002360736    ✓
5              P_a     0.60346657       0.60370731       0.000398879    ✓
6          CV(P_a)    0.115353502      0.115885468       0.004611636    ✓
7   log-likelihood      -157.3616        -157.3616                 0    ✓
8          density   0.0263774209     0.0263669039      0.0003986779    ✓
9      CV(density)        0.26318        0.3084104         0.1718612
10     individuals          18868  18860.668234144       0.000388582    ✓
11 CV(individuals)        0.26318        0.3084104         0.1718612

Outstanding issues:

  • as before cluster/stratified estimation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant