@@ -516,7 +516,8 @@ def ConstantData(
516
516
) -> TensorConstant :
517
517
"""Alias for ``pm.Data(..., mutable=False)``.
518
518
519
- Registers the ``value`` as a ``TensorConstant`` with the model.
519
+ Registers the ``value`` as a :class:`~aesara.tensor.TensorConstant` with the model.
520
+ For more information, please reference :class:`pymc.Data`.
520
521
"""
521
522
return Data (
522
523
name ,
@@ -538,7 +539,8 @@ def MutableData(
538
539
) -> SharedVariable :
539
540
"""Alias for ``pm.Data(..., mutable=True)``.
540
541
541
- Registers the ``value`` as a ``SharedVariable`` with the model.
542
+ Registers the ``value`` as a :class:`~aesara.compile.sharedvalue.SharedVariable`
543
+ with the model. For more information, please reference :class:`pymc.Data`.
542
544
"""
543
545
return Data (
544
546
name ,
@@ -562,35 +564,46 @@ def Data(
562
564
"""Data container that registers a data variable with the model.
563
565
564
566
Depending on the ``mutable`` setting (default: True), the variable
565
- is registered as a ``SharedVariable``, enabling it to be altered
566
- in value and shape, but NOT in dimensionality using ``pm.set_data()``.
567
+ is registered as a :class:`~aesara.compile.sharedvalue.SharedVariable`,
568
+ enabling it to be altered in value and shape, but NOT in dimensionality using
569
+ :func:`pymc.set_data`.
570
+
571
+ To set the value of the data container variable, check out
572
+ :func:`pymc.Model.set_data`.
573
+
574
+ For more information, read the notebook :ref:`nb:data_container`.
567
575
568
576
Parameters
569
577
----------
570
- name: str
571
- The name for this variable
572
- value: {List, np.ndarray, pd.Series, pd.Dataframe}
573
- A value to associate with this variable
574
- mutable : bool, optional
575
- Switches between creating a ``SharedVariable`` (``mutable=True``, default)
576
- vs. creating a ``TensorConstant`` (``mutable=False``).
577
- Consider using ``pm.ConstantData`` or ``pm.MutableData`` as less verbose
578
- alternatives to ``pm.Data(..., mutable=...)``.
579
- dims: {str, tuple of str}, optional, default=None
578
+ name : str
579
+ The name for this variable.
580
+ value : array_like or pandas.Series, pandas.Dataframe
581
+ A value to associate with this variable.
582
+ dims : str or tuple of str, optional
580
583
Dimension names of the random variables (as opposed to the shapes of these
581
- random variables). Use this when `value` is a pandas Series or DataFrame. The
582
- `dims` will then be the name of the Series / DataFrame's columns. See ArviZ
584
+ random variables). Use this when `` value` ` is a pandas Series or DataFrame. The
585
+ `` dims` ` will then be the name of the Series / DataFrame's columns. See ArviZ
583
586
documentation for more information about dimensions and coordinates:
584
587
:ref:`arviz:quickstart`.
585
- export_index_as_coords: bool, optional, default=False
586
- If True, the `Data` container will try to infer what the coordinates should be
587
- if there is an index in `value`.
588
- **kwargs: dict, optional
588
+ If this parameter is not specified, the random variables will not have dimension
589
+ names.
590
+ export_index_as_coords : bool, default=False
591
+ If True, the ``Data`` container will try to infer what the coordinates should be
592
+ if there is an index in ``value``.
593
+ mutable : bool, optional
594
+ Switches between creating a :class:`~aesara.compile.sharedvalue.SharedVariable`
595
+ (``mutable=True``) vs. creating a :class:`~aesara.tensor.TensorConstant`
596
+ (``mutable=False``).
597
+ Consider using :class:`pymc.ConstantData` or :class:`pymc.MutableData` as less
598
+ verbose alternatives to ``pm.Data(..., mutable=...)``.
599
+ If this parameter is not specified, the value it takes will depend on the
600
+ version of the package. Since ``v4.1.0`` the default value is
601
+ ``mutable=False``, with previous versions having ``mutable=True``.
602
+ **kwargs : dict, optional
589
603
Extra arguments passed to :func:`aesara.shared`.
590
604
591
605
Examples
592
606
--------
593
-
594
607
>>> import pymc as pm
595
608
>>> import numpy as np
596
609
>>> # We generate 10 datasets
@@ -609,12 +622,6 @@ def Data(
609
622
... # Switch out the observed dataset
610
623
... model.set_data('data', data_vals)
611
624
... idatas.append(pm.sample())
612
-
613
- To set the value of the data container variable, check out
614
- :func:`pymc.model.set_data()`.
615
-
616
- For more information, take a look at this example notebook
617
- https://docs.pymc.io/notebooks/data_container.html
618
625
"""
619
626
if isinstance (value , list ):
620
627
value = np .array (value )
0 commit comments