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 the graph 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.2.tar.gz (4.1 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.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for daosim-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c04c1388c78773bd2be2cb2b548c6d9e1c90914a05d24778f796b44c9feff421
MD5 b593ca590510629281a08cd6e4c00ad4
BLAKE2b-256 6bc2baacc46c74bdd6ebb9d7036dbba29349109a430fb835386214d91e054a2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: daosim-0.0.2-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.11

File hashes

Hashes for daosim-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55715be9d9fc2851934d890f157fdda3a6c385bad7bc920c99ee3ae8a1352a26
MD5 3d6dc0e086ca385ba5a108262f08e4b3
BLAKE2b-256 6fbf6229e9da5236e85c785984226e2613b54896c95596d00524acd34e9f0568

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