K i FddlmZddlmZddlmZmZmZGddeZy))Basic) ProductPSpace) ProductDomain_symbol_converter DistributioncheZdZdZd dZedZedZedZedZ d dZ d d Z y) StochasticPSpacea Represents probability space of stochastic processes and their random variables. Contains mechanics to do computations for queries of stochastic processes. Explanation =========== Initialized by symbol, the specific process and distribution(optional) if the random indexed symbols of the process follows any specific distribution, like, in Bernoulli Process, each random indexed symbol follows Bernoulli distribution. For processes with memory, this parameter should not be passed. Nct|}ddlm}t||s t d| t }t j||||S)Nr)StochasticProcessz3`process` must be an instance of StochasticProcess.)r$sympy.stats.stochastic_process_typesr isinstance TypeErrorrr__new__)clssymprocess distributionr s d/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/stats/stochastic_process.pyrzStochasticPSpace.__new__sH$J'#45QR R  '>L}}S#w ==c |jdS)z4 The associated stochastic process. argsselfs rrzStochasticPSpace.process s yy|rcjt|jj|jjSN)rr index_set state_spacers rdomainzStochasticPSpace.domain's(T\\33!\\557 7rc |jdS)Nrrrs rsymbolzStochasticPSpace.symbol,yy|rc |jdS)Nrrs rrzStochasticPSpace.distribution0r#rc @|jj|||fi|Sz Transfers the task of handling queries to the specific stochastic process because every process has their own logic of handling such queries. )r probability)r conditiongiven_conditionevaluatekwargss rr(zStochasticPSpace.probability4s% (t||'' ?HWPVWWrc @|jj|||fi|Sr')r expectation)rexprr)r+r,s rcompute_expectationz$StochasticPSpace.compute_expectation<s$ (t||''iLVLLrr)NT) __name__ __module__ __qualname____doc__rpropertyrr r"rr(r0rrr r sh > 77XMrr N) sympy.core.basicrsympy.stats.joint_rvrsympy.stats.rvrrrr r6rrr:s".II<M}<Mr