Skip to main content

Multiple Resolution Goodness of Fit.

The thesis of [cuevs2013]_ is that:

"... there is no one 'proper' resolution, but rather a range of
     resolutions is necessary to adequately describe the fit of
     models with reality."

Usage

#!/usr/bin/env python3
# -*- Coding: UTF-8 -*-
"""
Example from [costanza89]_.

References
----------

.. [costanza89] COSTANZA, Robert. Model goodness of fit: a multiple resolution
                 procedure. Ecological modelling, v. 47, n. 3-4,
                 p. 199-215, 1989.
"""
from multiresolutionfit import Multiresoutionfit
from numpy import  arange, array
from numpy.random import randint
import matplotlib.pyplot as plt

scene1 = array([[1, 1, 1, 1, 2, 2, 2, 3, 3, 3],
                [1, 1, 1, 2, 2, 2, 3, 3, 3, 3],
                [1, 1, 2, 2, 2, 3, 3, 3, 3, 3],
                [3, 3, 2, 2, 3, 3, 3, 3, 3, 3],
                [1, 3, 3, 3, 3, 3, 3, 3, 3, 3],
                [1, 1, 1, 3, 3, 3, 3, 3, 3, 3],
                [2, 2, 2, 2, 2, 2, 2, 2, 3, 3],
                [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
                [3, 3, 3, 3, 2, 2, 3, 3, 3, 3],
                [3, 3, 3, 3, 2, 2, 2, 2, 3, 3]
                ])

scene2 = array([[1, 1, 2, 2, 2, 2, 2, 2, 3, 3],
                [1, 1, 1, 1, 2, 3, 3, 3, 3, 3],
                [1, 1, 1, 2, 3, 3, 3, 3, 3, 3],
                [3, 1, 2, 2, 3, 3, 3, 4, 4, 4],
                [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
                [1, 1, 1, 3, 3, 3, 3, 3, 3, 3],
                [1, 1, 2, 2, 2, 2, 2, 2, 3, 3],
                [1, 2, 2, 3, 3, 2, 2, 3, 3, 3],
                [3, 3, 3, 3, 2, 2, 2, 3, 3, 3],
                [3, 3, 3, 3, 2, 2, 2, 2, 3, 3]
                ])


obj = Multiresoutionfit(scene1, scene2, verbose=True)
MAXW = 10
k = 0.1
wins = arange(1, 11, 1, dtype=int)
ftot, fw, wins = obj.ft(k=k, wins=wins)
print(f"\nWeighted fit: {ftot:.2f}\n")
z, fit = obj.zvalue(k=k, wins=wins, permutations=30)
print(f"z value {z:.2f}.")
plt.plot(wins, fw, marker='D')
plt.xticks(wins)
plt.ylim(ymax=0.95, ymin=0.75)
plt.xlim(xmax=MAXW, xmin=1)
plt.grid(True)
plt.show()

References


COSTANZA, Robert. Model goodness of fit: a multiple resolution procedure. Ecological modelling, v. 47, n. 3-4, p. 199-215, 1989.

Release files for multiresolutionfit 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multiresolutionfit 1.0.0
File Size Uploaded
multiresolutionfit-1.0.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for multiresolutionfit 1.0.0
File Interpreter ABI Platform
multiresolutionfit-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / multiresolutionfit-1.0.0.tar.gz

Download URL multiresolutionfit-1.0.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
667d5ae553812283a84189d0ab1d268cceadc72414f3f280092ebf90f140c3d3
BLAKE2b-256 checksum
How to use checksums
1c06ac8f394c3981c100a492b7964facbf98ac162f0dfd16671a45d105c4683f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release files / multiresolutionfit-1.0.0-py3-none-any.whl

Download URL multiresolutionfit-1.0.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b4c3b53c0d8791c7021c9204a64ee155a81d2675755e9b6bba6ac62f15f4a92
BLAKE2b-256 checksum
How to use checksums
15d784ba45152f71f21d1bb964822d0bc6fa9e5b28ebaeaa765dce59cbdabc78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page