Skip to content

Update sample code in the docs front page #5217

Closed
@martinacantaro

Description

@martinacantaro

Currently the front page of the documentation page displays a code snippet to show how easy it is to use PyMC. Update this code snippet to PyMC version 4

    import pymc3 as pm

    X, y = linear_training_data()
    with pm.Model() as linear_model:
        weights = pm.Normal("weights", mu=0, sigma=1)
        noise = pm.Gamma("noise", alpha=2, beta=1)
        y_observed = pm.Normal(
            "y_observed",
            mu=X @ weights,
            sigma=noise,
            observed=y,
        )

        prior = pm.sample_prior_predictive()
        posterior = pm.sample()
        posterior_pred = pm.sample_posterior_predictive(posterior)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions