Skip to main content

The DAG adaptation of the Onion method

Project description

DaOsim

The DAG adaptation of the Onion method

Exmaple Usage

import pandas as pd

from daosim import er_dag            # generates a Erdos-Renyi directed acyclic graph
from daosim import sf_out            # rewires a DAG to have scale-free out degree
from daosim import randomize_graph   # randomly shuffles the order of the variables
from daosim import corr              # samples a correlation matrix 
from daosim import simulate          # simulates a dataset
from daosim import standardize       # standardizes a dataset

p = 10    # number of variables
ad = 4    # average degree
n = 100   # number of samples

g = er_dag(p, ad=ad)
g = sf_out(g)
g = randomize_graph(g)

R, B, O = corr(g)
X = simulate(B, O, n)
X = standardize(X)

cols = [f"X{i + 1}" for i in range(p)]
df = pd.DataFrame(X, columns=cols)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daosim-0.0.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

daosim-0.0.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file daosim-0.0.3.tar.gz.

File metadata

  • Download URL: daosim-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for daosim-0.0.3.tar.gz
Algorithm Hash digest
SHA256 89a67d5cc57b8ac9ec10b12d254495502bdfb2bc3e1a5d6297fe7f37bcedf74b
MD5 02f125cc3e19f618199567ffe15ee504
BLAKE2b-256 a7e4b0f108f8ff4d33ac470d9d7d0c764e437bd5b4ab2da28e6bf88eee5f4f93

See more details on using hashes here.

File details

Details for the file daosim-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: daosim-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for daosim-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32d32af35ad853e79cef757041ec32ab4f757f8cae79ceb627d88700d44eeef3
MD5 3473bbb11f1ad93488241fa037afced1
BLAKE2b-256 6908071bad9dda0da28f7a86ca8d0dfec498073691b93685cd1e625ccf42036c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page