density calculation by Octave

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

density calculation by Octave

Surandokht Nikzad
Hi there,

I am beginner in Octave.
I am using this for calculation kernel density for some concentrations.

This is one example data:

ssw ef
1.85 1.497297297
1.21 1.719008264
1.44 1.451388889
1.71 1.514619883
1.4         1.192857143
0.396 1.795454545

Here is the codes:

doc_ef=a(:,2);
doc_ssw=a(:,1);
run_doc=0:d:20;
dens_est_doc_ef=kernel_dens(ones(size(run_doc)),doc_ef,run_doc);
plot(run_doc,dens_est_doc_ef,'b')

The integral of each distribution should be equal to one!My question is how can I avoid having plots over one in my graph. The example for graph is attached by this email.

Any idea and suggestion would be appreciated.

Thanks,
Sue

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev

ef_example.pdf (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: density calculation by Octave

Juan Pablo Carbajal-2
On Tue, Oct 30, 2012 at 3:03 PM, Surandokht Nikzad <[hidden email]> wrote:

> Hi there,
>
> I am beginner in Octave.
> I am using this for calculation kernel density for some concentrations.
>
> This is one example data:
>
> ssw ef
> 1.85 1.497297297
> 1.21 1.719008264
> 1.44 1.451388889
> 1.71 1.514619883
> 1.4         1.192857143
> 0.396 1.795454545
>
> Here is the codes:
>
> doc_ef=a(:,2);
> doc_ssw=a(:,1);
> run_doc=0:d:20;
> dens_est_doc_ef=kernel_dens(ones(size(run_doc)),doc_ef,run_doc);
> plot(run_doc,dens_est_doc_ef,'b')
>
> The integral of each distribution should be equal to one!My question is how
> can I avoid having plots over one in my graph. The example for graph is
> attached by this email.
>
> Any idea and suggestion would be appreciated.
>
> Thanks,
> Sue
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Octave-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/octave-dev
>

As you said the integral of probability density function is one, but
the density function itself could be bigger then one. Think of the
delta distribution.
http://en.wikipedia.org/wiki/Delta_distribution

If you want, you can plot the normalized frequency plot using hist
with the normalization argument equal to 1.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev
Reply | Threaded
Open this post in threaded view
|

Re: density calculation by Octave

Surandokht Nikzad
I am afraid, I am not sure how to code/ compute it...

On 12-10-30 5:08 PM, "Juan Pablo Carbajal" <[hidden email]> wrote:

>On Tue, Oct 30, 2012 at 3:03 PM, Surandokht Nikzad <[hidden email]>
>wrote:
>> Hi there,
>>
>> I am beginner in Octave.
>> I am using this for calculation kernel density for some concentrations.
>>
>> This is one example data:
>>
>> ssw ef
>> 1.85 1.497297297
>> 1.21 1.719008264
>> 1.44 1.451388889
>> 1.71 1.514619883
>> 1.4         1.192857143
>> 0.396 1.795454545
>>
>> Here is the codes:
>>
>> doc_ef=a(:,2);
>> doc_ssw=a(:,1);
>> run_doc=0:d:20;
>> dens_est_doc_ef=kernel_dens(ones(size(run_doc)),doc_ef,run_doc);
>> plot(run_doc,dens_est_doc_ef,'b')
>>
>> The integral of each distribution should be equal to one!My question is
>>how
>> can I avoid having plots over one in my graph. The example for graph is
>> attached by this email.
>>
>> Any idea and suggestion would be appreciated.
>>
>> Thanks,
>> Sue
>>
>>
>>-------------------------------------------------------------------------
>>-----
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>> _______________________________________________
>> Octave-dev mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/octave-dev
>>
>
>As you said the integral of probability density function is one, but
>the density function itself could be bigger then one. Think of the
>delta distribution.
>http://en.wikipedia.org/wiki/Delta_distribution
>
>If you want, you can plot the normalized frequency plot using hist
>with the normalization argument equal to 1.



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev
Reply | Threaded
Open this post in threaded view
|

Re: density calculation by Octave

Juan Pablo Carbajal-2
On Tue, Oct 30, 2012 at 3:12 PM, Surandokht Nikzad <[hidden email]> wrote:

> I am afraid, I am not sure how to code/ compute it...
>
> On 12-10-30 5:08 PM, "Juan Pablo Carbajal" <[hidden email]> wrote:
>
>>On Tue, Oct 30, 2012 at 3:03 PM, Surandokht Nikzad <[hidden email]>
>>wrote:
>>> Hi there,
>>>
>>> I am beginner in Octave.
>>> I am using this for calculation kernel density for some concentrations.
>>>
>>> This is one example data:
>>>
>>> ssw ef
>>> 1.85 1.497297297
>>> 1.21 1.719008264
>>> 1.44 1.451388889
>>> 1.71 1.514619883
>>> 1.4         1.192857143
>>> 0.396 1.795454545
>>>
>>> Here is the codes:
>>>
>>> doc_ef=a(:,2);
>>> doc_ssw=a(:,1);
>>> run_doc=0:d:20;
>>> dens_est_doc_ef=kernel_dens(ones(size(run_doc)),doc_ef,run_doc);
>>> plot(run_doc,dens_est_doc_ef,'b')
>>>
>>> The integral of each distribution should be equal to one!My question is
>>>how
>>> can I avoid having plots over one in my graph. The example for graph is
>>> attached by this email.
>>>
>>> Any idea and suggestion would be appreciated.
>>>
>>> Thanks,
>>> Sue
>>>
>>>
>>>-------------------------------------------------------------------------
>>>-----
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>>> _______________________________________________
>>> Octave-dev mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/octave-dev
>>>
>>
>>As you said the integral of probability density function is one, but
>>the density function itself could be bigger then one. Think of the
>>delta distribution.
>>http://en.wikipedia.org/wiki/Delta_distribution
>>
>>If you want, you can plot the normalized frequency plot using hist
>>with the normalization argument equal to 1.
>
>

do
help hist
in your Octave prompt

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev