Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

I would like to estimate the parameters of a distribution that I obtain via TransformedDistribution:

bDist[σ_, λ_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[λ], 
                  noise \[Distributed] NormalDistribution[0, σ]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using FindDistributionParameters:

FindDistributionParameters[data, bDist[σ, λ]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the TransformedDistribution I form above.

It seems to me that these errors suggest that I need to "manually" tell Mathematica what the support of this transformed distribution is. This seems odd - I would have thought that Mathematica could determine that the distribution has support over the entire real line.

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using EstimatedDistribution, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where Mathematica uses derived distributions formed from TransformedDistribution on the help page for the FindDistributionParameters function. Neither is there any information on how one could define support on a function.

Finally, I tried using Maximize on a LogLikelihood object, but this takes far longer (as this questionthis question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

I would like to estimate the parameters of a distribution that I obtain via TransformedDistribution:

bDist[σ_, λ_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[λ], 
                  noise \[Distributed] NormalDistribution[0, σ]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using FindDistributionParameters:

FindDistributionParameters[data, bDist[σ, λ]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the TransformedDistribution I form above.

It seems to me that these errors suggest that I need to "manually" tell Mathematica what the support of this transformed distribution is. This seems odd - I would have thought that Mathematica could determine that the distribution has support over the entire real line.

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using EstimatedDistribution, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where Mathematica uses derived distributions formed from TransformedDistribution on the help page for the FindDistributionParameters function. Neither is there any information on how one could define support on a function.

Finally, I tried using Maximize on a LogLikelihood object, but this takes far longer (as this question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

I would like to estimate the parameters of a distribution that I obtain via TransformedDistribution:

bDist[σ_, λ_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[λ], 
                  noise \[Distributed] NormalDistribution[0, σ]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using FindDistributionParameters:

FindDistributionParameters[data, bDist[σ, λ]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the TransformedDistribution I form above.

It seems to me that these errors suggest that I need to "manually" tell Mathematica what the support of this transformed distribution is. This seems odd - I would have thought that Mathematica could determine that the distribution has support over the entire real line.

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using EstimatedDistribution, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where Mathematica uses derived distributions formed from TransformedDistribution on the help page for the FindDistributionParameters function. Neither is there any information on how one could define support on a function.

Finally, I tried using Maximize on a LogLikelihood object, but this takes far longer (as this question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

Tweeted twitter.com/StackMma/status/701427812536864768
Formatted code
Source Link
MarcoB
  • 67.7k
  • 18
  • 96
  • 197

I would like to estimate the parameters of a distribution that I obtain via $TransformedDistribution$TransformedDistribution:

bDist[\[Sigma]_bDist[σ_, \[Lambda]_]λ_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[\[Lambda]]ExponentialDistribution[λ], 
                  noise \[Distributed] NormalDistribution[0, \[Sigma]]σ]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using $FindDistributionParameters$FindDistributionParameters:

FindDistributionParameters[data, bDist[\[Sigma]bDist[σ, \[Lambda]]]λ]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the $TransformedDistribution$TransformedDistribution I form above.

It seems to me that these errors suggest that I need to 'manually'"manually" tell MathematicaMathematica what the support of this transformed distribution is. This seems odd - I would have thought that MathematicaMathematica could determine that the distribution has support over the entire real line?.

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using $EstimatedDistribution$EstimatedDistribution, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where MathematicaMathematica uses derived distributions formed from $TransformedDistribution$TransformedDistribution on the help page for the $FindDistributionParameters$FindDistributionParameters function. Neither is there any information on how one could define support on a function.

Finally, I tried using $Maximize$Maximize on a $LogLikelihood$LogLikelihood object, but this takes far longer (as this question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

Best,

Ben

I would like to estimate the parameters of a distribution that I obtain via $TransformedDistribution$:

bDist[\[Sigma]_, \[Lambda]_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[\[Lambda]], 
                  noise \[Distributed] NormalDistribution[0, \[Sigma]]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using $FindDistributionParameters$:

FindDistributionParameters[data, bDist[\[Sigma], \[Lambda]]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the $TransformedDistribution$ I form above.

It seems to me that these errors suggest that I need to 'manually' tell Mathematica what the support of this transformed distribution is. This seems odd - I would have thought that Mathematica could determine that the distribution has support over the entire real line?

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using $EstimatedDistribution$, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where Mathematica uses derived distributions formed from $TransformedDistribution$ on the help page for the $FindDistributionParameters$ function. Neither is there any information on how one could define support on a function.

Finally, I tried using $Maximize$ on a $LogLikelihood$ object, but this takes far longer (as this question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

Best,

Ben

I would like to estimate the parameters of a distribution that I obtain via TransformedDistribution:

bDist[σ_, λ_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[λ], 
                  noise \[Distributed] NormalDistribution[0, σ]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using FindDistributionParameters:

FindDistributionParameters[data, bDist[σ, λ]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the TransformedDistribution I form above.

It seems to me that these errors suggest that I need to "manually" tell Mathematica what the support of this transformed distribution is. This seems odd - I would have thought that Mathematica could determine that the distribution has support over the entire real line.

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using EstimatedDistribution, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where Mathematica uses derived distributions formed from TransformedDistribution on the help page for the FindDistributionParameters function. Neither is there any information on how one could define support on a function.

Finally, I tried using Maximize on a LogLikelihood object, but this takes far longer (as this question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

Source Link
ben18785
  • 3.2k
  • 16
  • 29

FindDistributionParameters failing for a TransformedDistribution

I would like to estimate the parameters of a distribution that I obtain via $TransformedDistribution$:

bDist[\[Sigma]_, \[Lambda]_] := TransformedDistribution[real + noise, 
                  {real \[Distributed] ExponentialDistribution[\[Lambda]], 
                  noise \[Distributed] NormalDistribution[0, \[Sigma]]}]

(This new object is an exponentially-modified Gaussian for reference.) So, I generate some data using the newly-created distribution:

data = RandomVariate[bDist[2, 1/3], {10000}];

Then try to estimate its parameters, using $FindDistributionParameters$:

FindDistributionParameters[data, bDist[\[Sigma], \[Lambda]]]

Which produces an error:

"The support of the distribution TransformedDistribution.... could not be determined. 
The validity of the data for TransformedDistribution.... could not be determined"

Where "..." is the full detail of the $TransformedDistribution$ I form above.

It seems to me that these errors suggest that I need to 'manually' tell Mathematica what the support of this transformed distribution is. This seems odd - I would have thought that Mathematica could determine that the distribution has support over the entire real line?

I have tried placing assumptions on the parameters (constraining them to be positive), but this doesn't seem to work. I have also tried using $EstimatedDistribution$, which produces the same errors as above (makes sense since I think they are the same thing under the hood.)

I have also tried using the Laplace distribution which naturally has support over all the real line (opposed to the exponential which is only over the positive reals), but this produces the same error.

There aren't any examples where Mathematica uses derived distributions formed from $TransformedDistribution$ on the help page for the $FindDistributionParameters$ function. Neither is there any information on how one could define support on a function.

Finally, I tried using $Maximize$ on a $LogLikelihood$ object, but this takes far longer (as this question taught me), and only works for small data samples.

Does anyone have an idea as to how I can solve this problem?

Best,

Ben