comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Help!!!!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Help!!!! [message #90807] Sat, 18 April 2015 07:15 Go to next message
alepliee is currently offline  alepliee
Messages: 4
Registered: April 2015
Junior Member
Make a chart of ' distance x speed
2- Make a linear fit and compare with robust tuning ( comment )
3- Determine the correlation coefficients ( Pearson, Spearman and Kendall ) and comment
4- Use the bootstrap technique to determine H0 ( km / s / Mpc ) . Making the histogram of values
obtained. Set a Gaussian and give the value of H0 with uncertainty.
5- Take an error of 5 % in the variables . Use boot_xyfit.pro program. Make a histogram
for the given values . Compare the average value with the value obtained by robust adjustment .
6 Assuming the uncertainty in the Y variable, do residue analysis. Display the graph. Is there any solution available ?
Re: Help!!!! [message #90808 is a reply to message #90807] Sat, 18 April 2015 09:21 Go to previous messageGo to next message
rryan%stsci.edu is currently offline  rryan%stsci.edu
Messages: 16
Registered: October 2014
Junior Member
On Saturday, April 18, 2015 at 10:15:18 AM UTC-4, alep...@gmail.com wrote:
> Make a chart of ' distance x speed
> 2- Make a linear fit and compare with robust tuning ( comment )
> 3- Determine the correlation coefficients ( Pearson, Spearman and Kendall ) and comment
> 4- Use the bootstrap technique to determine H0 ( km / s / Mpc ) . Making the histogram of values
> obtained. Set a Gaussian and give the value of H0 with uncertainty.
> 5- Take an error of 5 % in the variables . Use boot_xyfit.pro program. Make a histogram
> for the given values . Compare the average value with the value obtained by robust adjustment .
> 6 Assuming the uncertainty in the Y variable, do residue analysis. Display the graph. Is there any solution available ?

This sounds an awful lot like a homework problem. I don't think you're going to get much help, or at least you're not going to get someone to do your homework for you. And anyone who does is doing you a disservice and, in my opinion, is a wildly unethical thing to do. Maybe you should help us help you. What have you got so far? what exactly is tripping you up?
Re: Help!!!! [message #90809 is a reply to message #90807] Sat, 18 April 2015 10:25 Go to previous messageGo to next message
alepliee is currently offline  alepliee
Messages: 4
Registered: April 2015
Junior Member
How to linear and robust adjustment ?
LINFIT : y = A + Bx
LINFIT result = (X, Y = MEASURE_ERRORS measure_errors )
PRINT , result

What data put in X , Y ?
Re: Help!!!! [message #90810 is a reply to message #90809] Sat, 18 April 2015 12:26 Go to previous messageGo to next message
rryan%stsci.edu is currently offline  rryan%stsci.edu
Messages: 16
Registered: October 2014
Junior Member
On Saturday, April 18, 2015 at 1:25:30 PM UTC-4, alep...@gmail.com wrote:
> How to linear and robust adjustment ?
> LINFIT : y = A + Bx
> LINFIT result = (X, Y = MEASURE_ERRORS measure_errors )
> PRINT , result
>
> What data put in X , Y ?

It sounds like your professor is trying to get you to infer the Hubble constant from a bunch of data. He or she must have given you some data. Those data are x and y. At a fundamental level, it matters which is which, and you should try to understand that. Typically you have a "dependent" and "independent" variable. You need to realize which is which, of course I know, but I can't just tell you. Start by thinking what physically does Hubble constant represent? What are its units? km/s per Mpc. Now, what are the units of a slope of a line? Which variable should be x and should be y, now?

Once you get that sorted out, the IDL code is simple...

http://www.exelisvis.com/docs/LINFIT.html

result = linfit (x, y, measure_errors=dy)

where dy are the errors on y.
Re: Help!!!! [message #90812 is a reply to message #90807] Sat, 18 April 2015 20:29 Go to previous message
alepliee is currently offline  alepliee
Messages: 4
Registered: April 2015
Junior Member
Em sábado, 18 de abril de 2015 11:15:18 UTC-3, alep...@gmail.com escreveu:
> Make a chart of ' distance x speed
> 2- Make a linear fit and compare with robust tuning ( comment )
> 3- Determine the correlation coefficients ( Pearson, Spearman and Kendall ) and comment
> 4- Use the bootstrap technique to determine H0 ( km / s / Mpc ) . Making the histogram of values
> obtained. Set a Gaussian and give the value of H0 with uncertainty.
> 5- Take an error of 5 % in the variables . Use boot_xyfit.pro program. Make a histogram
> for the given values . Compare the average value with the value obtained by robust adjustment .
> 6 Assuming the uncertainty in the Y variable, do residue analysis. Display the graph. Is there any solution available ?


home='C:\Users\Cliente02\.idl\itt\projetos\'
;hubble=rd_tfile('teste.rtf',/auto,/convert)
openr,1,home+'distancia1.txt'

dados=fltarr(2,24)
readf,1,dados
close,1

openr,1,home+'velocidade1.txt'

luz=fltarr(1,24)
readf,1,luz
close,1

openr,1,home+'erro1.txt'

erros=fltarr(1,24)
readf,1,erros
close,1

redshift=dados(0,*)
velocidade=luz(0,*)
erroy=erros(0,*)

plot,redshift,velocidade,psym=2,xrange=[0.0,2.5],yrange=[-50 0.0,1500.0],$
xtit='Distancia(10E6)',ytit='Velocidade (km/s)',charsize=1.0,xminor=11,yminor=11
oploterror,redshift,velocidade,erroy,psym=3,errcolor=fsc_col or('red')
plots,2.2,1350,psym=2,symsize=1.
redshift2=[0.0,2.5]
xyouts,2.22,1350,'Amostras',charsize=1.
xyouts,2.22,1250,'Aj.Linear',charsize=1.,color=fsc_color('re d')
xyouts,2.22,1150,'Aj.Robusto',charsize=1.,color=fsc_color('g reen')

result=LINFIT(distancia,velocidade)
print,result
yfit=result(0)+result(1)*redshift2
oplot,redshift2,yfit,linestyle=3,color=fsc_color('red')
robusto=robust_linefit(redshift,velocidade,/bisect,NumIT = 1000)
yrob=robusto(0)+robusto(1)*redshift2
oplot,redshift2,yrob,linestyle=2,color=fsc_color('green')

end


Can someone tell me Why NOT appears as lines ?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: "Subtitle=" in Function graphics
Next Topic: mrd_struct failure for string values inside the VM

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:11:55 PDT 2025

Total time taken to generate the page: 0.00598 seconds