我正在尝试使用以下 PDF 创建倾斜正态分布
我正在使用以下命令(引用自 http://en.wikipedia.org/wiki/Skew_normal_distribution):
我正在尝试执行以下操作:
SkewedNormal := Distribution(PDF = unapply(2*phi(x, mu, sigma)*Phi(alpha*x, mu, sigma), x, mu, sigma, alpha))
该命令执行没有错误,与以下命令相同:
R := RandomVariable(SkewNormal)
但当我尝试执行以下操作时,问题就开始了:
CDF(R,x)
错误,(在统计中:-CDF)无效输入:q 使用第三个参数 sigma,该参数缺失
好的,我添加第三个参数:
CDF(R,x,y)
错误,(在统计中:-CDF)意外参数:y
如果您之前尝试通过以下方式初始化随机变量:
R := RandomVariable(SkewNormal(mu, sigma))
错误,(在统计:-Distribution 中)输入无效:IsKnownDistribution 期望其第一个参数 dn 为类型
name 类型,但收到 module () 导出条件,PDF,类型;期权分布,连续; end module
如何在 Maple 14 中创建参数分布?
I'm trying to create Skewed Normal distribution with the following PDF
I'm using the following command for that (referenced from http://en.wikipedia.org/wiki/Skew_normal_distribution):
I'm trying to do the following:
SkewedNormal := Distribution(PDF = unapply(2*phi(x, mu, sigma)*Phi(alpha*x, mu, sigma), x, mu, sigma, alpha))
This command executes without errors, the same as the following command:
R := RandomVariable(SkewNormal)
but the problems start when I try to do the following:
CDF(R,x)
Error, (in Statistics:-CDF) invalid input: q uses a 3rd argument, sigma, which is missing
Ok, I add the third parameter:
CDF(R,x,y)
Error, (in Statistics:-CDF) unexpected parameters: y
If you try previously to init random variable the following way:
R := RandomVariable(SkewNormal(mu, sigma))
Error, (in Statistics:-Distribution) invalid input: IsKnownDistribution expects its 1st argument, dn, to be of type
name, but received module () export Conditions, PDF, Type; option Distribution, Continuous; end module
How do you create parametric distribution in Maple 14?
发布评论
评论(2)
不能只对x取消申请吗? (请注意,您在发布的代码中存在拼写错误,使用 SkewedNormal 与 SkewNormal。)
最终结果是一个包含 alpha、mu 和 sigma 的表达式。因此,可以使用
subs
或eval
来实例化参数的值。Can you not unapply with respect to only x? (Note you had a typo in the posted code, using SkewedNormal vs SkewNormal.)
The final result there is an expression containing alpha, mu, and sigma. So
subs
oreval
could then be used to instantiate at values for the parameters.如果有人遇到同样的问题,这里是我设法以这种方式解决它的方法:
这种方式允许定义参数分布
示例:
它还可以与Statistics包中的函数一起使用,例如RandomVariable:
并调用:
给出
In case anybody will face the same problem here's how I managed to solve it this way:
This way allows defining parametric distribution
Examples:
It also works with functions from Statistics package, such as RandomVariable:
And calling:
Gives