[docs]classFisherSnedecor(Distribution):r""" Creates a Fisher-Snedecor distribution parameterized by :attr:`df1` and :attr:`df2`. Example:: >>> # xdoctest: +IGNORE_WANT("non-deterinistic") >>> m = FisherSnedecor(torch.tensor([1.0]), torch.tensor([2.0])) >>> m.sample() # Fisher-Snedecor-distributed with df1=1 and df2=2 tensor([ 0.2453]) Args: df1 (float or Tensor): degrees of freedom parameter 1 df2 (float or Tensor): degrees of freedom parameter 2 """arg_constraints={"df1":constraints.positive,"df2":constraints.positive}support=constraints.positivehas_rsample=Truedef__init__(self,df1,df2,validate_args=None):self.df1,self.df2=broadcast_all(df1,df2)self._gamma1=Gamma(self.df1*0.5,self.df1)self._gamma2=Gamma(self.df2*0.5,self.df2)ifisinstance(df1,Number)andisinstance(df2,Number):batch_shape=torch.Size()else:batch_shape=self.df1.size()super().__init__(batch_shape,validate_args=validate_args)
To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.