distribution function #2

Hi,

i'm a beginner in matlab.I need to create distribution function of a meixner distribution:
function y=meixner(x,a,b,d,m)
x=x(:);
n=length(x);
for k=1:n
y(k)=(2*cos(b/2))^(2*d)*exp(b*(x(k)'-m)./a)*abs(gamma(d+i*(x(k)-m)./a)).^2/(2*a*pi*gamma(2*d));
y=y(:);
end

and i don't know how.
could someone please help me?
thanks a lot
0
Yoggi (4)
3/14/2010 1:18:02 PM
comp.soft-sys.matlab 206915 articles. 560 followers. lunamoonmoon (258) is leader. Post Follow

8 Replies
135 Views

Similar Articles

[PageSpeed] 9
"jeny hu" <Yoggi@post.sk> wrote in message <hninma$k1$1@fred.mathworks.com>...

If you don't know how, what does the code you posted do?
0
mattjacREMOVE (3194)
3/14/2010 1:25:05 PM
"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <hnio3h$6bt$1@fred.mathworks.com>...
> "jeny hu" <Yoggi@post.sk> wrote in message <hninma$k1$1@fred.mathworks.com>...
> 
> If you don't know how, what does the code you posted do?

the code creates a probability density function and i need to create a distribution function
0
Yoggi (4)
3/14/2010 1:32:05 PM
"jeny hu" <Yoggi@post.sk> wrote in message <hniogl$c6p$1@fred.mathworks.com>...

> the code creates a probability density function and i need to create a distribution function
===============

help cumsum
0
mattjacREMOVE (3194)
3/14/2010 1:35:23 PM
"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <hniomr$eu4$1@fred.mathworks.com>...
> "jeny hu" <Yoggi@post.sk> wrote in message <hniogl$c6p$1@fred.mathworks.com>...
> 
> > the code creates a probability density function and i need to create a distribution function
> ===============
> 
> help cumsum
I need the cdf for statistical testing(kstest,kuiper test....) and i know the result(accept H0) and I've already tried cumsum but this ends with rejecting H0
0
Yoggi (4)
3/14/2010 1:48:02 PM
"jeny hu" <Yoggi@post.sk> wrote in message <hnipei$pn5$1@fred.mathworks.com>...

> > help cumsum
> I need the cdf for statistical testing(kstest,kuiper test....) and i know the result(accept H0) and I've already tried cumsum but this ends with rejecting H0
==============

That doesn't mean cumsum is wrong. It could mean there's aproblem somewhere else.
0
mattjacREMOVE (3194)
3/14/2010 2:34:05 PM
jeny hu wrote:
> "Matt J " <mattjacREMOVE@THISieee.spam> wrote in message 
> <hniomr$eu4$1@fred.mathworks.com>...
>> "jeny hu" <Yoggi@post.sk> wrote in message 
>> <hniogl$c6p$1@fred.mathworks.com>...
>>
>> > the code creates a probability density function and i need to create 
>> a distribution function
>> ===============
>>
>> help cumsum
> I need the cdf for statistical testing(kstest,kuiper test....) and i 
> know the result(accept H0) and I've already tried cumsum but this ends 
> with rejecting H0

Your original code was:

function y=meixner(x,a,b,d,m)
x=x(:);
n=length(x);
for k=1:n
y(k)=(2*cos(b/2))^(2*d)*exp(b*(x(k)'-m)./a)*abs(gamma(d+i*(x(k)-m)./a)).^2/(2*a*pi*gamma(2*d));
y=y(:);
end


There is no H0 anywhere in there, so cumsum() applied to the output of 
this function is not going to have any problem with H0.

What you do with the distribution function after you have it is a 
different matter. Be sure you are asking us the right question.
0
roberson (2980)
3/14/2010 5:08:35 PM
On 3/14/2010 9:18 AM, jeny hu wrote:

> i'm a beginner in matlab.I need to create distribution function of a
> meixner distribution:

This is a continuous distribution, correct?  And presumably there is no closed form for the distribution?  So you might consider using (for example) QUADGK to numerically integrate your PDF.  CUMSUM probably isn't what you want, unless you are using it as a poor-man's numerical integration.

But you have a bit of a problem here:   this line

> y(k)=(2*cos(b/2))^(2*d)*exp(b*(x(k)'-m)./a)*abs(gamma(d+i*(x(k)-m)./a)).^2/(2*a*pi*gamma(2*d));

calls the gamma function with a complex argument, and as the help says,

>> help gamma
  GAMMA Gamma function.
     Y = GAMMA(X) evaluates the gamma function for each element of X.
     X must be real.

So you will have to find something other than GAMMA.  The MATLAB File Exchange has what seems like a well-written version (also the very first google hit for "complex gamma matlab):

<http://www.mathworks.com/matlabcentral/fileexchange/978>

Other than that, there's no reason to loop over elements in computing the PDF, you can do it with one vectorized statement.
0
3/15/2010 1:45:08 PM
Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <hnldl4$s0f$1@fred.mathworks.com>...
> On 3/14/2010 9:18 AM, jeny hu wrote:
> 
> > i'm a beginner in matlab.I need to create distribution function of a
> > meixner distribution:
> 
> This is a continuous distribution, correct?  And presumably there is no closed form for the distribution?  So you might consider using (for example) QUADGK to numerically integrate your PDF.  CUMSUM probably isn't what you want, unless you are using it as a poor-man's numerical integration.
> 
> But you have a bit of a problem here:   this line
> 
> > y(k)=(2*cos(b/2))^(2*d)*exp(b*(x(k)'-m)./a)*abs(gamma(d+i*(x(k)-m)./a)).^2/(2*a*pi*gamma(2*d));
> 
> calls the gamma function with a complex argument, and as the help says,
> 
> >> help gamma
>   GAMMA Gamma function.
>      Y = GAMMA(X) evaluates the gamma function for each element of X.
>      X must be real.
> 
> So you will have to find something other than GAMMA.  The MATLAB File Exchange has what seems like a well-written version (also the very first google hit for "complex gamma matlab):
> 
> <http://www.mathworks.com/matlabcentral/fileexchange/978>
> 
> Other than that, there's no reason to loop over elements in computing the PDF, you can do it with one vectorized statement.


I use in that code gamma function for complex numbers,but still i have problem with the CDF
0
Yoggi (4)
3/15/2010 3:50:27 PM
Reply:
Similar Artilces:

Possible Delay of iPad 2 until June due to design changes
According to research note from Yuanta Securities Co. today, Apple=92s iPad 2 may be delayed until June due to a number of reasons. One of possible delay is due to =93production bottlenecks=94 at Apple=92s sourced manufacturing plant Hon Hai Precision Industry Co. since Apple request to make design changes to iPad 2 before the Lunar New Year around 3 weeks ago. This delay of June release date seems odd as Apple typically announce releases of new version iPhone during this month. Lots of rumors going about Apple=92s iPad 2 =96 thinner, lighter, faster, more memory and faster graphi...

function webcam from airis photo camera
hi i've a Airis Photo Star dc51 with function webcam (usb) but its driver is available only for windows. i tried with http://webcam-osx.sourceforge.net/ but this program don't recognised the camera, either is listed in supported cameras Do you know any alternative? ...

Re: Pay Phone Regulations #2
Robert Pierce wrote: > [Pat, please remove my e-mail address. thx] > Good afternoon. > I have a client who would like to have a pay phone in their break area > for employee use. The COCOT vendor they were using wasn't making > enough money, and so they pulled out. > They're not looking to turn a profit; they just want to give employees > without cell phones a chance to call home etc. without having to open > up an outside line to long distance charges, abuse, etc. > They would like to put a simple pay phone in place -- something like a &...

The same function the second time evaluated is faster. Why?
Dear gurus? I evaluate the below function , Int[1]:=1+1 Int[2]:=Timing[(f2[x1_] := Integrate[Sin[x^3], {x, 0, x1}]; f2[Range[10]]);] Out[2]:= {12.261, Null} I repeat the evaluation is faster Out[2]:={1.389, Null} and the third faster Out[3]:= {0.281, Null} Even writting f3 instead f2 Timing[(f3[x1_] := Integrate[Sin[x^3], {x, 0, x1}]; f3[Range[10]]);] {0.281, Null} Why the second and third evaluation are faster? Guillermo In article <ir857q$beh$1@smc.vnet.net>, Guillermo Sanchez <guillermo.sanchez@hotmail.com> wrote: > Dear gurus? &g...

Re: Creating combinations in SAS #2
saurabhkdas@GMAIL.COM wrote: >Hi All , > >I am new to SAS, however I am asked to do some work beyond that >knowledge level and its going over my head and understanding . ok lets >get to it .... > >Ok the present method what I am doing is .... > >I have a set of 20 variables. I need combinations of 4 each. I got some >thing around 4895 combinations. I got this out put using a C++ program >. Now I dumped all of those in an excel sheet. , and did a text to >columns , because it was in a csv format. Now I am running >Proc Reg on these , and fixing one as a...

kde 3.3.2 crashing while initializing devices
Hi! Since I upgrades to KDE 3.3.2 I can't login to kde anymore. KDE is crashing while initializing devices. Anyone else seen this? Any hints where to look? I've tried to blanken all user dependent stuff. No help. Keeps crashing. I can on the other hand start any kde-application with twm. No problem. Only the kde desktop isn't available. arts-1.3.2,1 Audio system for the KDE integrated X11 desktop de-kde-i18n-3.3.2 German messages and documentation for KDE3 kde-3.3.2 The "meta-port" for KDE kdebase-3.3.2 Basic applications for the K...

compaq deskpro et linux #2
Suse linux 7.0 Pas moyen de faire fonctionner la partie son int�gr�e � la carte-m�re ess1869. M�me si cette carte son appara�t dans la liste des cartes reconnues ! En revanche, j'ai mis une vieille SB64 et l� aucun probl�me linux. Quel en est la raison ? It's impossible to get the on-board ess1869 working. Nevertheless this soundchip appears on the list of recognized soundcard ! I have taken an old SB64 and linux have recognize it without any problem. What is the reason why ? -- Ceci est une signature automatique de MesNews. Site : http://mesnews.no-ip.com ...

Why I cannot call public non-virtual member function of DLL?
Hi, Hmm. seems a little silly.. Here comes the puzzle. -----dll------------ class TestAdd { public: void TestNormal(); virtual void TestVirtual(); } extern "C" TestAdd* TestAddCreate(){ return new(std::nothrow) TestAdd(); } ------------------ Above is part of the dll class. The implementation part is missed deliberately. TestAdd* instance = TestAddCreate(); When I call "instance->TestNormal()", it says ------message----- error LNK2019: unresolved external symbol "public: void __thiscall TestAdd::TestNormal(void)" ...

The Modernization of Emacs #2
[this post is a excerpt from The Modernization of Emacs, Xah Lee, 2006-04 at http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and most versatile text editor. And, besides text editing, it also serves as a email application, newsgroup application, ftp application, irc application, web browser, shell interface, file management application, programable calculator, calendar and personal info management application, lisp language system, among other things. These s...

Just finished Quake 2 on hard difficulty
Bit of a nostalgia trip but really had great fun playing through this old classic again. Had to rediscover some of my old multiplayer skills to get through some sections as it really gets intense and kind of served to show me just how easy most single player shooters are these days. Might go play the mission packs now. :p [CUT] > Might go play the mission packs now. :p Don't forget EraserBots and titanic quake2 just to recall the goo'old days, by the way, try getting all those secrets that level designers don't put anymore in levels, that was the best part IMO.Nowadays th...

Classify Function
Hi, I tried to use classify function with Mahalanobis method. I got the follow error: ??? Error using ==> classify at 298 The covariance matrix of each group in TRAINING must be positive definite. what that it means? What should I do about? This is the code [P, T, Eig] = princomp(spec'); T1=T(:,1:6); [r,c]=size(T1); R=rand(r,1); Itrain=find(R>=0.2); Iclass=find(R<0.2); training=T1(Itrain,:); sample=T1(Iclass,:); group=type(Itrain); class = classify(sample,training,group,'mahalanobis'); Where 'spec'...

How to install glib 2.3.2 on debian woody?
Hello, I'm running a program, which requires glib 2.3.2. On my debian woody distribution the highest version available is 2.2.5. Is it possible to get 2.3.2 via dselect from sarge and install it, so that the program can use it? If not, then is there a way that I can just get the plain library and put it somewhere so that the program can access it? Thanks for any advice, Fritz <fritz-bayer@web.de> wrote in message news:1107333297.638557.231750@c13g2000cwb.googlegroups.com... > Hello, > > I'm running a program, which requires glib 2.3.2. On my debi...

roc function
Could anyone explain the usage of roc command ? I have predicted and observed values of a logistic regression model on hand. [tpr,fpr,thresholds] = roc(targets,outputs) What targets and outputs refer to in roc command and is the thresholds optimum cut off point ? Thanks in advance cyd ...

Getsnapshot #2
My goal is to acquire a frame of video (live) and process it fast as possible. My camera is rated to up to 60 frames per sec. I am using a manually configured trigger setting. Tic; getsnapshot; toc. Implies a fast frame rate. of 35 fps. Which I would be happy with. However when I put get snapshot in a while loop I get a much slower rate 12 fps. I am following the demo for calling getsnapshot In a while loop. Playing around, it seems as if calling get snapshot TOO frequently actually slows it down. Addition of pauses can actually improve frame rate. Got me wondering I'd there i...

RE: [Info-ingres] Re: Ingres/ICE (3.0.2) and Apache 2.0.54
m00n, I have uploaded a DLL for PHP 5.0.5 to http://www.ingres.co.uk/files/php/php-5.0.5-ingres_dll.zip. You should know that the code has been tested with BLOBs of varying sizes up to 100Mb; it should work with larger files I did not have any laying about to test with. The code will fetch data in segments defined by the connect option "blog_segment_length". I believe the maximum segment size is 32k. See http://www.ingres.co.uk/files/php/blob_read.php for an example of setting connect options. Later on it will be possible to set the segment length dynamically not just at c...

The five fastest-booting Linux distributions
http://www.techrepublic.com/blog/five-apps/the-five-fastest-booting-linux-d= istributions/1198 |1: Puppy Linux |[...]will boot faster than your standard OS, |even when it=92s booting from the Live CD |[...] |26 seconds | One assumes "your standard OS" means M$'s bloated crap. |5: Ubuntu 11.10 |[...]the king of quick boots[...] |10 seconds JeffM wrote: > http://www.techrepublic.com/blog/five-apps/the-five-fastest-booting-linux- distributions/1198 > |1: Puppy Linux > |[...]will boot faster than your standard OS, > |even when it’s booting from the Live CD > |[...] ...

PS/2 55 HD
Turned off a 55SX for about a week. CMOS (DALLAS) battery died. Restored computer with reference disk, hard drive seemed to now have 4 odd sized non-DOS partitions. I have the dedicated software, so I reformed HD (60 meg.), fdisked it first, placed the operating system on it (DOS 5.0), however computer will no longer boot from HD. HD light remains on the entire time system is counting memory, then turns off. Floppy drive light turns on and without a floppy computer will sit forever (no place disk in floppy F1 message). Diagnostics on reference disk produces no errors. Is there a spe...

'invalid fid' error on fprintf function
Dear all, Why do I get invalid fid error for the fprintf function below? I am using this code on a linux cluster with a pbs job system. Other codes with fprintf works fine but this one not. I could not figure the reason out. Thanks for the replies. fid1=fopen('surface.dat','w'); if fid1==-1 mes='file can not be opened' exit; else mode_num=1; for l=-0.02:0.001:0.02; for w=-0.02:0.001:0.02; params_vec=[l,w]; % Write VL input files writeVLFiles(params_vec,'./','plate'); % Wait for files to be read and processed by VL while(exist('../nas...

Functions for handling EPOC Sheet
Is there a "Sheet OPX" or similar available for EPOC? David -- David Sumbler Please reply to the newsgroup. However, if you _really_ want to send me an e-mail, replace "nospam" in my address with "aeolia". ...

ACCESS ADO-Update Function does not work correctly
Hi, I have a major problem. I use Windows 2000 highest SP and ACCESS 2000 inside Office 2000 SP-3. I want to use the following simple command inside ACCESS in VBA UPDATE tbl_SATURN_Benutzer SET bool_IstDatensatzAktuell = False, bool_ImportCheckFlag = True, dat_L�schdatum = #01/25/2005 18:38:17# WHERE ((bool_ImportCheckFlag = False) AND (dat_L�schdatum = Null) AND (byte_Anwendung = 2)); This means: With the above command I want to update three columns in a table with UPDATE and SET using a WHERE clause. Theoreticall y one row should be found and updated. But inside VBA no single row ...

4 functions how to write in nested function or can write in another way
Hi everybody, Could you help me? I have just started in MATLAB. I have problem about nested function. I have 4 functions examples; 1. function ode23 (dTdt) 2. function dTdt (x(t),coefficient) 3. function x(t) 4. function coefficient I think function 2,3 and 4 should in 1 m-file like nested function and function ode23 is separate to call the function 1. But I don't know how to write it exactly.Could you help me? Thanks for your attemption and sorry for my english Best Regards, Tarn "Tarn" <wacharakorn@gmail.com> wrote in message news...

no-op function pointer
Ahoy... before I go off scouring particular platforms for specialized answers, I thought I would see if there is a portable C answer to this question: I want a function pointer that, when called, can be a genuine no-op. Consider: typedef int(*polymorphic_func)(int param); struct various_funcs { polymorphic_func func_a; polymorphic_func func_b; }; int really_does_something(int param) { return ++param; } int really_a_noop(int param) { (void)param; return 0; } struct various_funcs does_stuff = { really_does_something, really_does_something }; struct various_funcs noop_funcs = { rea...

MSN messanger for iPhone #2
Hi iPhone-ers, Simple way for using MSN on your iPhone: start your Safari on iPhone, open http://iphone-msn.com and... it is your iPhone MSN messanger on-line in any place and any time! Waiting for 29 of June :-) ...

Quick-PDF Software Releases PDF to Word Converter v.2.3
For immediate release Quick-PDF Software Tamara Anikeeva support@quick-pdf.com October 4, 2010 - Quick-PDF today announces PDF to Word ver.2.3, a new version of the converter for quick export of PDF documents to MS Word RTF/DOC format. Designed as a super-light and inexpensive alternative to Adobe Acrobat, PDF to Word will help home and office users to convert protected PDF files to documents that can be edited in any word processor, such as Microsoft Word, WordPad, or OpenOffice. Adobe PDF documents have become an integral part of the workflow in business organizations and ...

Lots of errors, having 'lame' day, suggestions? #2
Look at some web stats, I saw a traffic drop over the weekend on a few sites. Looking into it, I am stumped. Here are a few named log snips: 17-Nov-2008 05:47:26.582 security: info: client 203.162.4.198#40307: query (cache) 'nuclearrabbit.com/MX/IN' denied 17-Nov-2008 05:47:27.375 security: info: client 200.0.194.46#3632: query (cache) 'nuclearrabbit.com/MX/IN' denied 17-Nov-2008 05:47:28.170 security: info: client 200.0.194.78#38941: query (cache) 'nuclearrabbit.com/MX/IN' denied 17-Nov-2008 05:47:28.495 security: info: client 190.216.29.147#37276: ...