DateDistribution

DateDistribution[dist,dunit,dorig]

represents a distribution dist of dates with date scale unit dunit and date origin dorig.

Details and Options

• DateDistribution works by rescaling the distribution dist to the space of quantities with the unit dunit and then mapping to the space of dates, where the numeric origin becomes the date origin dorig.
• For a continuous distribution dist, the DateGranularity is taken to be "Instant". »
• For a discrete distribution dist, the DateGranularity is given by dunit. »
• The distribution dist can be any univariate distribution that satisfies DistributionParameterQ. »
• The date scale unit dunit should be a time unit as returned by UnitDimensions[dscale]. »
• The date origin dorig should be a DateObject.
• DateDistribution[dist,dunit] is equivalent to DateDistribution[dist,dunit,Now].
• Sampling from DateDistribution gives DateObject.
• The following options can be given:
•  CalendarType "Gregorian" which calendar system to use TimeSystem Automatic how to measure the advance of time TimeZone \$TimeZone associated time zone
• DateDistribution can used in functions such as RandomVariate, Mean, ....

Examples

open allclose all

Basic Examples(2)

Define a continuous date distribution:

Compute the mean of the distribution:

Simulate a random date from this distribution:

Simulate a list of dates and visualize their distribution:

Define a discrete date distribution:

Compute the median of the distribution:

Simulated random date from this distribution has granularity of year:

Simulate a list of dates and visualize their distribution:

Scope(5)

Define a nonsymmetric distribution of dates starting at midnight of today:

Simulate the instances:

Estimate DateDistribution from the collection of dates:

Since the data histogram is bell shaped, fit a normal distribution to the data:

The arguments to distribution functions of a DateDistribution must be dates:

Compute distribution moments of a DateDistribution:

Moment and FactorialMoment are not defined:

Use a nonparametric distribution to define DateDistribution:

Create the series data of times between the starting date and a serious earthquake:

Create a nonparametric model of the data:

Use the model to create distribution of dates:

Simulate and visualize the sample:

Options(3)

CalendarType(1)

Specifying CalendarType will override the date origin input:

TimeSystem(1)

Specifying TimeSystem will override the date origin input:

TimeZone(1)

Specifying TimeZone will override the date origin input:

Applications(1)

List of dates when class of students submitted an assignment:

Visualize the dates distribution:

Fit a GammaDistribution to the dates:

Plot the PDF with steps of one minute and compare with the histogram:

Properties & Relations(3)

Extract properties of a DateDistribution:

List of properties:

Granularity of a discrete date distribution is given by the date scale unit:

Granularity of a continuous date distribution is always "Instant":

Possible Issues(2)

The input distribution must be a valid distribution:

Check if a distribution is valid:

Create a valid distribution:

The unit must be a valid time unit:

Check if a unit is a time unit:

For a time unit:

Or use KnownUnitQ with second argument set as "Time":

Wolfram Research (2024), DateDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/DateDistribution.html.

Text

Wolfram Research (2024), DateDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/DateDistribution.html.

CMS

Wolfram Language. 2024. "DateDistribution." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DateDistribution.html.

APA

Wolfram Language. (2024). DateDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DateDistribution.html

BibTeX

@misc{reference.wolfram_2024_datedistribution, author="Wolfram Research", title="{DateDistribution}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/DateDistribution.html}", note=[Accessed: 15-August-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_datedistribution, organization={Wolfram Research}, title={DateDistribution}, year={2024}, url={https://reference.wolfram.com/language/ref/DateDistribution.html}, note=[Accessed: 15-August-2024 ]}