Coder Social home page Coder Social logo

chancehaycock / csr-stat Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 477 KB

Python package for analysis of 2D Spatial Point Processes including basic utility functions and calculation of summary statistics. To be primarily used to test the hypothesis of CSR.

Python 5.85% Jupyter Notebook 94.15%
summary-statistics

csr-stat's Introduction

csr-stat

Package for introductory analysis of Spatial Point Processes, including basic utility functions, summary statistics and metrics for 2D point processes. To be primarily used to test the hypothesis of CSR.


Installation

git clone https://github.com/chancehaycock/csrstat.git

# Create conda environment if you don't already have one
conda create -n my_env python==3.7
conda activate my_env
conda install pytest
cd csrstat
pip install .

Check installation with

pytest test/

Included Summary Statistics

These functions calculate the associated metric of an observed Point Process PP. When restrict_domain is a valid argument, the metric is calculated on a subset of the original domain, in a first attempt to account for edge effects.

F_hat(PP, r, num_sampled_points=1000, plot=False)

G_hat(PP, r, plot=False)

J_hat(PP, r, num_F_sampled_points=1000, plot=False)

K_hat(PP, r, restrict_domain=False, plot=False)

L_hat(PP, r, restrict_domain=False, plot=False)

O_hat(PP, r, bandwidth=0.1, restrict_domain=False, kernel="BK", plot=False)

PC_hat(PP, r, bandwidth=0.1, restrict_domain=False, kernel="BK", plot=False)

Additional Fast Functions

Good for simulation inference.

K_hat_fast(PP, r, plot=False)

L_hat_fast(PP, r, plot=False)

Simulation

Any of the above summary statistic functions can be simulated by calling the following. Resulting max/min envelopes will then be plotted and can be compared against a given realisation. Currently, only the default arguments of a summary statistic function can be used during simulation.

simulate_summary_statistic(PP, r, summary_func, n_sims=100, plot=False)

Real-Valued Hypothesis Test

CSR_hypothesis_test_dmin(observed_PP, significance_level, n_sim=500, plot_dist=False)

Testing

pytest test/utils_test.py

csr-stat's People

Contributors

chancehaycock avatar teddytw avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.